Skip to content

Commit 5b62f65

Browse files
committed
fix(ci): honor splits for --fork= release features
The `parse_until_fork` gate in `generate_build_matrix.build_matrix` silently disabled `splits: 4` for the `benchmark` feature because it uses `--fork=Osaka` rather than `--until=`. That check only belongs in `pre_alloc_matrix` (phase 1 fork-range splitting); pytest-split (phase 2) should apply whenever `splits > 1`. Dropping the gate requires two follow-on fixes for the new `--fork=`-with-splits path: - Gate `--use-pre-alloc-groups` on `pre_alloc_labels` rather than on `matrix.label`. `--fork=` features skip phase 1, so no groups folder exists and `fill` would raise `FileNotFoundError`. - Move `benchmark_genesis` generation to the `combine` job. Split builds no longer produce an unsplit `fixtures_benchmark.tar.gz` in `build-fixtures`; the merged tarball is only available after combine. The unsplit path in `build-fixtures` still covers `benchmark_fast`.
1 parent 578aaeb commit 5b62f65

3 files changed

Lines changed: 35 additions & 8 deletions

File tree

.github/scripts/generate_build_matrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def build_matrix(feature: dict, name: str) -> tuple[list[dict], str]:
102102
"""
103103
splits = feature.get("splits", 0)
104104

105-
if splits > 1 and parse_until_fork(feature["fill-params"]):
105+
if splits > 1:
106106
build = [
107107
{
108108
"feature": name,

.github/scripts/tests/test_release_scripts.py

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ def test_split_feature_produces_entries_per_group(self):
5151
assert out["feature_name"] == "mainnet"
5252
assert out["combine_labels"] != ""
5353
splits = matrix[0]["splits"]
54-
assert [e["group"] for e in matrix] == list(
55-
range(1, splits + 1)
56-
)
54+
assert [e["group"] for e in matrix] == list(range(1, splits + 1))
5755
assert all(e["splits"] == splits for e in matrix)
5856
assert all(e["label"] == str(e["group"]) for e in matrix)
5957

@@ -69,18 +67,36 @@ def test_split_feature_produces_pre_alloc_matrix(self):
6967
assert out["pre_alloc_labels"] != ""
7068

7169
def test_unsplit_feature_produces_single_entry(self):
72-
"""Verify a single-fork feature produces one unsplit entry."""
73-
result = run_script(BUILD_MATRIX_SCRIPT, "benchmark")
70+
"""Verify a feature without splits configured produces one entry."""
71+
result = run_script(BUILD_MATRIX_SCRIPT, "benchmark_fast")
7472
assert result.returncode == 0
7573
out = parse_matrix_output(result.stdout)
7674
matrix = json.loads(out["build_matrix"])
7775
assert len(matrix) == 1
78-
assert out["feature_name"] == "benchmark"
76+
assert out["feature_name"] == "benchmark_fast"
7977
assert out["combine_labels"] == ""
8078
assert matrix[0]["label"] == ""
8179
assert matrix[0]["splits"] == 0
8280
assert matrix[0]["group"] == 0
8381

82+
def test_split_feature_with_fork_param(self):
83+
"""Verify splits apply to --fork features, not just --until."""
84+
result = run_script(BUILD_MATRIX_SCRIPT, "benchmark")
85+
assert result.returncode == 0
86+
out = parse_matrix_output(result.stdout)
87+
matrix = json.loads(out["build_matrix"])
88+
assert len(matrix) > 1
89+
assert out["feature_name"] == "benchmark"
90+
splits = matrix[0]["splits"]
91+
assert [e["group"] for e in matrix] == list(range(1, splits + 1))
92+
assert all(e["splits"] == splits for e in matrix)
93+
assert all(e["label"] == str(e["group"]) for e in matrix)
94+
assert out["combine_labels"] == " ".join(
95+
str(i) for i in range(1, splits + 1)
96+
)
97+
# --fork features should not generate a pre-alloc matrix.
98+
assert json.loads(out["pre_alloc_matrix"]) == []
99+
84100
def test_feature_only_can_be_requested_explicitly(self):
85101
"""Verify feature_only entries work when named directly."""
86102
result = run_script(BUILD_MATRIX_SCRIPT, "bal")

.github/workflows/release_fixture_feature.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ jobs:
210210
splits: ${{ matrix.splits }}
211211
group: ${{ matrix.group }}
212212
store_durations: "true"
213-
use_pre_alloc_groups: ${{ matrix.label != '' && 'true' || 'false' }}
213+
use_pre_alloc_groups: ${{ needs.setup.outputs.pre_alloc_labels != '' && 'true' || 'false' }}
214214

215215
combine:
216216
name: combine (${{ needs.setup.outputs.feature_name }})
@@ -287,6 +287,17 @@ jobs:
287287
with:
288288
name: fixtures_${{ needs.setup.outputs.feature_name }}
289289
path: fixtures_${{ needs.setup.outputs.feature_name }}.tar.gz
290+
- name: Generate Benchmark Genesis Files
291+
if: contains(needs.setup.outputs.feature_name, 'benchmark')
292+
uses: ./.github/actions/build-benchmark-genesis
293+
with:
294+
fixtures_path: fixtures_${{ needs.setup.outputs.feature_name }}.tar.gz
295+
- name: Upload Benchmark Genesis Artifact
296+
if: contains(needs.setup.outputs.feature_name, 'benchmark')
297+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
298+
with:
299+
name: benchmark_genesis_${{ needs.setup.outputs.feature_name }}
300+
path: benchmark_genesis.tar.gz
290301

291302
release:
292303
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)