|
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
|
@@ -462,26 +462,28 @@ def pytest_configure(config): # noqa: D103
|
462 | 462 | config.test_cases = index.test_cases
|
463 | 463 |
|
464 | 464 | # Create XDistGroupMapper for enginex simulator if needed
|
465 |
| - if ( |
466 |
| - hasattr(config, "_supported_fixture_formats") |
467 |
| - and BlockchainEngineXFixture.format_name in config._supported_fixture_formats |
468 |
| - ): |
469 |
| - max_group_size = getattr(config, "enginex_max_group_size", 400) |
470 |
| - config.xdist_group_mapper = XDistGroupMapper(max_group_size) |
471 |
| - config.xdist_group_mapper.build_mapping(config.test_cases) |
472 |
| - |
473 |
| - # Log statistics about group splitting |
474 |
| - split_stats = config.xdist_group_mapper.get_split_statistics() |
475 |
| - if split_stats: |
476 |
| - rich.print("[bold yellow]Pre-allocation group splitting for load balancing:[/]") |
477 |
| - for pre_hash, stats in split_stats.items(): |
478 |
| - rich.print( |
479 |
| - f" Group {pre_hash[:8]}: {stats['total_tests']} tests → " |
480 |
| - f"{stats['num_subgroups']} sub-groups " |
481 |
| - f"(~{stats['tests_per_subgroup']} tests each)" |
482 |
| - ) |
483 |
| - rich.print(f" Max group size: {max_group_size}") |
484 |
| - else: |
| 465 | + # Check if enginex options are present (indicates enginex simulator is being used) |
| 466 | + try: |
| 467 | + max_group_size = config.getoption("--enginex-max-group-size", None) |
| 468 | + if max_group_size is not None: |
| 469 | + config.xdist_group_mapper = XDistGroupMapper(max_group_size) |
| 470 | + config.xdist_group_mapper.build_mapping(config.test_cases) |
| 471 | + |
| 472 | + # Log statistics about group splitting |
| 473 | + split_stats = config.xdist_group_mapper.get_split_statistics() |
| 474 | + if split_stats: |
| 475 | + rich.print("[bold yellow]Pre-allocation group splitting for load balancing:[/]") |
| 476 | + for pre_hash, stats in split_stats.items(): |
| 477 | + rich.print( |
| 478 | + f" Group {pre_hash[:8]}: {stats['total_tests']} tests → " |
| 479 | + f"{stats['num_subgroups']} sub-groups " |
| 480 | + f"(~{stats['tests_per_subgroup']} tests each)" |
| 481 | + ) |
| 482 | + rich.print(f" Max group size: {max_group_size}") |
| 483 | + else: |
| 484 | + config.xdist_group_mapper = None |
| 485 | + except ValueError: |
| 486 | + # enginex options not available, not using enginex simulator |
485 | 487 | config.xdist_group_mapper = None
|
486 | 488 |
|
487 | 489 | for fixture_format in BaseFixture.formats.values():
|
|
0 commit comments