Skip to content

Commit cfd8338

Browse files
chores(fill): remove --flat-output and all logic associated with it (#2018)
Co-authored-by: danceratopz <[email protected]>
1 parent bf117bf commit cfd8338

File tree

6 files changed

+9
-160
lines changed

6 files changed

+9
-160
lines changed

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Users can select any of the artifacts depending on their testing needs for their
8282
- ✨ Added support for the `--benchmark-gas-values` flag in the `fill` command, allowing a single genesis file to be used across different gas limit settings when generating fixtures. ([#1895](https://github.com/ethereum/execution-spec-tests/pull/1895)).
8383
- ✨ Static tests can now specify a maximum fork where they should be filled for ([#1977](https://github.com/ethereum/execution-spec-tests/pull/1977)).
8484
- ✨ Static tests can now be filled in every format using `--generate-all-formats` ([#2006](https://github.com/ethereum/execution-spec-tests/pull/2006)).
85+
- 💥 Flag `--flat-output` has been removed due to having been unneeded for an extended period of time ([#2018](https://github.com/ethereum/execution-spec-tests/pull/2018)).
8586
- ✨ Add support for `BlockchainEngineSyncFixture` format for tests marked with `pytest.mark.verify_sync` to enable client synchronization testing via `consume sync` command ([#2007](https://github.com/ethereum/execution-spec-tests/pull/2007)).
8687

8788
#### `consume`

src/ethereum_test_fixtures/collector.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ class FixtureCollector:
108108
"""Collects all fixtures generated by the test cases."""
109109

110110
output_dir: Path
111-
flat_output: bool
112111
fill_static_tests: bool
113112
single_fixture_per_file: bool
114113
filler_path: Path
@@ -121,21 +120,16 @@ class FixtureCollector:
121120

122121
def get_fixture_basename(self, info: TestInfo) -> Path:
123122
"""Return basename of the fixture file for a given test case."""
124-
if self.flat_output:
125-
if self.single_fixture_per_file:
126-
return Path(info.get_single_test_name(mode="test"))
127-
return Path(info.get_single_test_name(mode="module"))
128-
else:
129-
module_relative_output_dir = info.get_module_relative_output_dir(self.filler_path)
123+
module_relative_output_dir = info.get_module_relative_output_dir(self.filler_path)
130124

131-
# Each legacy test filler has only 1 test per file if it's a !state test!
132-
# So no need to create directory Add11/add11.json it can be plain add11.json
133-
if self.fill_static_tests:
134-
return module_relative_output_dir.parent / info.original_name
125+
# Each legacy test filler has only 1 test per file if it's a !state test!
126+
# So no need to create directory Add11/add11.json it can be plain add11.json
127+
if self.fill_static_tests:
128+
return module_relative_output_dir.parent / info.original_name
135129

136-
if self.single_fixture_per_file:
137-
return module_relative_output_dir / info.get_single_test_name(mode="test")
138-
return module_relative_output_dir / info.get_single_test_name(mode="module")
130+
if self.single_fixture_per_file:
131+
return module_relative_output_dir / info.get_single_test_name(mode="test")
132+
return module_relative_output_dir / info.get_single_test_name(mode="module")
139133

140134
def add_fixture(self, info: TestInfo, fixture: BaseFixture) -> Path:
141135
"""Add fixture to the list of fixtures of a given test case."""

src/pytest_plugins/filler/filler.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -477,13 +477,6 @@ def pytest_addoption(parser: pytest.Parser):
477477
default=False,
478478
help="Clean (remove) the output directory before filling fixtures.",
479479
)
480-
test_group.addoption(
481-
"--flat-output",
482-
action="store_true",
483-
dest="flat_output",
484-
default=False,
485-
help="Output each test case in the directory without the folder structure.",
486-
)
487480
test_group.addoption(
488481
"--single-fixture-per-file",
489482
action="store_true",
@@ -1061,7 +1054,6 @@ def fixture_collector(
10611054

10621055
fixture_collector = FixtureCollector(
10631056
output_dir=fixture_output.directory,
1064-
flat_output=fixture_output.flat_output,
10651057
fill_static_tests=request.config.getoption("fill_static_tests_enabled"),
10661058
single_fixture_per_file=fixture_output.single_fixture_per_file,
10671059
filler_path=filler_path,

src/pytest_plugins/filler/fixture_output.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ class FixtureOutput(BaseModel):
1414
"""Represents the output destination for generated test fixtures."""
1515

1616
output_path: Path = Field(description="Directory path to store the generated test fixtures")
17-
flat_output: bool = Field(
18-
default=False,
19-
description="Output each test case in the directory without the folder structure",
20-
)
2117
single_fixture_per_file: bool = Field(
2218
default=False,
2319
description=(
@@ -221,7 +217,6 @@ def from_config(cls, config: pytest.Config) -> "FixtureOutput":
221217

222218
return cls(
223219
output_path=output_path,
224-
flat_output=config.getoption("flat_output"),
225220
single_fixture_per_file=config.getoption("single_fixture_per_file"),
226221
clean=config.getoption("clean"),
227222
generate_pre_alloc_groups=config.getoption("generate_pre_alloc_groups"),

src/pytest_plugins/filler/tests/test_filler.py

Lines changed: 0 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -150,44 +150,6 @@ def test_shanghai_two(state_test, x):
150150
[2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 6, 6],
151151
id="build-name-in-fixtures-ini-file",
152152
),
153-
pytest.param(
154-
["--flat-output"],
155-
[
156-
Path("fixtures/blockchain_tests/paris_one.json"),
157-
Path("fixtures/blockchain_tests_engine/paris_one.json"),
158-
Path("fixtures/state_tests/paris_one.json"),
159-
Path("fixtures/blockchain_tests/paris_two.json"),
160-
Path("fixtures/blockchain_tests_engine/paris_two.json"),
161-
Path("fixtures/state_tests/paris_two.json"),
162-
Path("fixtures/blockchain_tests/shanghai_one.json"),
163-
Path("fixtures/blockchain_tests_engine/shanghai_one.json"),
164-
Path("fixtures/state_tests/shanghai_one.json"),
165-
Path("fixtures/blockchain_tests/shanghai_two.json"),
166-
Path("fixtures/blockchain_tests_engine/shanghai_two.json"),
167-
Path("fixtures/state_tests/shanghai_two.json"),
168-
],
169-
[2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 6, 6],
170-
id="flat-output",
171-
),
172-
pytest.param(
173-
["--flat-output", "--output", "other_fixtures"],
174-
[
175-
Path("other_fixtures/blockchain_tests/paris_one.json"),
176-
Path("other_fixtures/blockchain_tests_engine/paris_one.json"),
177-
Path("other_fixtures/state_tests/paris_one.json"),
178-
Path("other_fixtures/blockchain_tests/paris_two.json"),
179-
Path("other_fixtures/blockchain_tests_engine/paris_two.json"),
180-
Path("other_fixtures/state_tests/paris_two.json"),
181-
Path("other_fixtures/blockchain_tests/shanghai_one.json"),
182-
Path("other_fixtures/blockchain_tests_engine/shanghai_one.json"),
183-
Path("other_fixtures/state_tests/shanghai_one.json"),
184-
Path("other_fixtures/blockchain_tests/shanghai_two.json"),
185-
Path("other_fixtures/blockchain_tests_engine/shanghai_two.json"),
186-
Path("other_fixtures/state_tests/shanghai_two.json"),
187-
],
188-
[2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 6, 6],
189-
id="flat-output_custom-output-dir",
190-
),
191153
pytest.param(
192154
["--single-fixture-per-file"],
193155
[
@@ -418,97 +380,6 @@ def test_shanghai_two(state_test, x):
418380
[1] * 36,
419381
id="single-fixture-per-file_custom_output_dir",
420382
),
421-
pytest.param(
422-
["--flat-output", "--single-fixture-per-file"],
423-
[
424-
Path(
425-
"fixtures/blockchain_tests/paris_one__fork_Paris_blockchain_test_from_state_test.json"
426-
),
427-
Path("fixtures/state_tests/paris_one__fork_Paris_state_test.json"),
428-
Path(
429-
"fixtures/blockchain_tests_engine/paris_one__fork_Paris_blockchain_test_engine_from_state_test.json"
430-
),
431-
Path(
432-
"fixtures/blockchain_tests/paris_one__fork_Shanghai_blockchain_test_from_state_test.json"
433-
),
434-
Path("fixtures/state_tests/paris_one__fork_Shanghai_state_test.json"),
435-
Path(
436-
"fixtures/blockchain_tests_engine/paris_one__fork_Shanghai_blockchain_test_engine_from_state_test.json"
437-
),
438-
Path(
439-
"fixtures/blockchain_tests/paris_two__fork_Paris_blockchain_test_from_state_test.json"
440-
),
441-
Path("fixtures/state_tests/paris_two__fork_Paris_state_test.json"),
442-
Path(
443-
"fixtures/blockchain_tests_engine/paris_two__fork_Paris_blockchain_test_engine_from_state_test.json"
444-
),
445-
Path(
446-
"fixtures/blockchain_tests/paris_two__fork_Shanghai_blockchain_test_from_state_test.json"
447-
),
448-
Path("fixtures/state_tests/paris_two__fork_Shanghai_state_test.json"),
449-
Path(
450-
"fixtures/blockchain_tests_engine/paris_two__fork_Shanghai_blockchain_test_engine_from_state_test.json"
451-
),
452-
Path(
453-
"fixtures/blockchain_tests/shanghai_one__fork_Paris_blockchain_test_from_state_test.json"
454-
),
455-
Path("fixtures/state_tests/shanghai_one__fork_Paris_state_test.json"),
456-
Path(
457-
"fixtures/blockchain_tests_engine/shanghai_one__fork_Paris_blockchain_test_engine_from_state_test.json"
458-
),
459-
Path(
460-
"fixtures/blockchain_tests/shanghai_one__fork_Shanghai_blockchain_test_from_state_test.json"
461-
),
462-
Path("fixtures/state_tests/shanghai_one__fork_Shanghai_state_test.json"),
463-
Path(
464-
"fixtures/blockchain_tests_engine/shanghai_one__fork_Shanghai_blockchain_test_engine_from_state_test.json"
465-
),
466-
Path(
467-
"fixtures/blockchain_tests/shanghai_two__fork_Paris_blockchain_test_from_state_test_x_1.json"
468-
),
469-
Path("fixtures/state_tests/shanghai_two__fork_Paris_state_test_x_1.json"),
470-
Path(
471-
"fixtures/blockchain_tests_engine/shanghai_two__fork_Paris_blockchain_test_engine_from_state_test_x_1.json"
472-
),
473-
Path(
474-
"fixtures/blockchain_tests/shanghai_two__fork_Paris_blockchain_test_from_state_test_x_2.json"
475-
),
476-
Path("fixtures/state_tests/shanghai_two__fork_Paris_state_test_x_2.json"),
477-
Path(
478-
"fixtures/blockchain_tests_engine/shanghai_two__fork_Paris_blockchain_test_engine_from_state_test_x_2.json"
479-
),
480-
Path(
481-
"fixtures/blockchain_tests/shanghai_two__fork_Paris_blockchain_test_from_state_test_x_3.json"
482-
),
483-
Path("fixtures/state_tests/shanghai_two__fork_Paris_state_test_x_3.json"),
484-
Path(
485-
"fixtures/blockchain_tests_engine/shanghai_two__fork_Paris_blockchain_test_engine_from_state_test_x_3.json"
486-
),
487-
Path(
488-
"fixtures/blockchain_tests/shanghai_two__fork_Shanghai_blockchain_test_from_state_test_x_1.json"
489-
),
490-
Path("fixtures/state_tests/shanghai_two__fork_Shanghai_state_test_x_1.json"),
491-
Path(
492-
"fixtures/blockchain_tests_engine/shanghai_two__fork_Shanghai_blockchain_test_engine_from_state_test_x_1.json"
493-
),
494-
Path(
495-
"fixtures/blockchain_tests/shanghai_two__fork_Shanghai_blockchain_test_from_state_test_x_2.json"
496-
),
497-
Path("fixtures/state_tests/shanghai_two__fork_Shanghai_state_test_x_2.json"),
498-
Path(
499-
"fixtures/blockchain_tests_engine/shanghai_two__fork_Shanghai_blockchain_test_engine_from_state_test_x_2.json"
500-
),
501-
Path(
502-
"fixtures/blockchain_tests/shanghai_two__fork_Shanghai_blockchain_test_from_state_test_x_3.json"
503-
),
504-
Path("fixtures/state_tests/shanghai_two__fork_Shanghai_state_test_x_3.json"),
505-
Path(
506-
"fixtures/blockchain_tests_engine/shanghai_two__fork_Shanghai_blockchain_test_engine_from_state_test_x_3.json"
507-
),
508-
],
509-
[1] * 36,
510-
id="flat-single-per-file_flat-output",
511-
),
512383
],
513384
)
514385
def test_fixture_output_based_on_command_line_args(

src/pytest_plugins/filler/tests/test_generate_all_formats.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class MockConfig:
2727
def getoption(self, option):
2828
option_values = {
2929
"output": "/tmp/test",
30-
"flat_output": False,
3130
"single_fixture_per_file": False,
3231
"clean": False,
3332
"generate_pre_alloc_groups": False,
@@ -51,7 +50,6 @@ class MockConfig:
5150
def getoption(self, option):
5251
option_values = {
5352
"output": "/tmp/fixtures.tar.gz", # Tarball output
54-
"flat_output": False,
5553
"single_fixture_per_file": False,
5654
"clean": False,
5755
"generate_pre_alloc_groups": False,
@@ -76,7 +74,6 @@ class MockConfig:
7674
def getoption(self, option):
7775
option_values = {
7876
"output": "/tmp/fixtures", # Regular directory output
79-
"flat_output": False,
8077
"single_fixture_per_file": False,
8178
"clean": False,
8279
"generate_pre_alloc_groups": False,
@@ -101,7 +98,6 @@ class MockConfig:
10198
def getoption(self, option):
10299
option_values = {
103100
"output": "/tmp/fixtures.tar.gz", # Tarball output
104-
"flat_output": False,
105101
"single_fixture_per_file": False,
106102
"clean": False,
107103
"generate_pre_alloc_groups": False,

0 commit comments

Comments
 (0)