|
23 | 23 | import rich
|
24 | 24 |
|
25 | 25 | from cli.gen_index import generate_fixtures_index
|
26 |
| -from ethereum_test_fixtures import BaseFixture, BlockchainEngineXFixture |
| 26 | +from ethereum_test_fixtures import BaseFixture |
27 | 27 | from ethereum_test_fixtures.consume import IndexFile, TestCases
|
28 | 28 | from ethereum_test_forks import get_forks, get_relative_fork_markers, get_transition_forks
|
29 | 29 | from ethereum_test_tools.utility.versioning import get_current_commit_hash_or_tag
|
@@ -473,26 +473,28 @@ def pytest_configure(config): # noqa: D103
|
473 | 473 | config.test_cases = index.test_cases
|
474 | 474 |
|
475 | 475 | # Create XDistGroupMapper for enginex simulator if needed
|
476 |
| - if ( |
477 |
| - hasattr(config, "_supported_fixture_formats") |
478 |
| - and BlockchainEngineXFixture.format_name in config._supported_fixture_formats |
479 |
| - ): |
480 |
| - max_group_size = getattr(config, "enginex_max_group_size", 400) |
481 |
| - config.xdist_group_mapper = XDistGroupMapper(max_group_size) |
482 |
| - config.xdist_group_mapper.build_mapping(config.test_cases) |
483 |
| - |
484 |
| - # Log statistics about group splitting |
485 |
| - split_stats = config.xdist_group_mapper.get_split_statistics() |
486 |
| - if split_stats: |
487 |
| - rich.print("[bold yellow]Pre-allocation group splitting for load balancing:[/]") |
488 |
| - for pre_hash, stats in split_stats.items(): |
489 |
| - rich.print( |
490 |
| - f" Group {pre_hash[:8]}: {stats['total_tests']} tests → " |
491 |
| - f"{stats['num_subgroups']} sub-groups " |
492 |
| - f"(~{stats['tests_per_subgroup']} tests each)" |
493 |
| - ) |
494 |
| - rich.print(f" Max group size: {max_group_size}") |
495 |
| - else: |
| 476 | + # Check if enginex options are present (indicates enginex simulator is being used) |
| 477 | + try: |
| 478 | + max_group_size = config.getoption("--enginex-max-group-size", None) |
| 479 | + if max_group_size is not None: |
| 480 | + config.xdist_group_mapper = XDistGroupMapper(max_group_size) |
| 481 | + config.xdist_group_mapper.build_mapping(config.test_cases) |
| 482 | + |
| 483 | + # Log statistics about group splitting |
| 484 | + split_stats = config.xdist_group_mapper.get_split_statistics() |
| 485 | + if split_stats: |
| 486 | + rich.print("[bold yellow]Pre-allocation group splitting for load balancing:[/]") |
| 487 | + for pre_hash, stats in split_stats.items(): |
| 488 | + rich.print( |
| 489 | + f" Group {pre_hash[:8]}: {stats['total_tests']} tests → " |
| 490 | + f"{stats['num_subgroups']} sub-groups " |
| 491 | + f"(~{stats['tests_per_subgroup']} tests each)" |
| 492 | + ) |
| 493 | + rich.print(f" Max group size: {max_group_size}") |
| 494 | + else: |
| 495 | + config.xdist_group_mapper = None |
| 496 | + except ValueError: |
| 497 | + # enginex options not available, not using enginex simulator |
496 | 498 | config.xdist_group_mapper = None
|
497 | 499 |
|
498 | 500 | for fixture_format in BaseFixture.formats.values():
|
|
0 commit comments