Skip to content

Conversation

@DeborahOlaboye
Copy link
Contributor

🗒️ Description

Implements the minimize-tests approach to dramatically reduce json_infra test execution time from hours to minutes while maintaining full code coverage.

This PR adds infrastructure to generate and run a minimal subset of json_infra tests using set cover optimization. The json_infra tests verify that EELS can execute filled JSON fixtures, so we don't need to run all fixtures.

Key additions:

  • tox -e json_infra_generate: Generates minimal test list using minimize-tests tool
  • tox -e json_infra_min: Runs minimal test set with coverage enforcement (fast)
  • Original tox -e json_infra: Unchanged (full suite)

🔗 Related Issues or PRs

Closes #1020

✅ Checklist

  • All: Ran fast tox checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    uvx tox -e static
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered adding an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

fselmo and others added 5 commits December 8, 2025 15:22
Fixes ethereum#1020

Implements minimize-tests integration to dramatically reduce json_infra
test execution time from hours to minutes while maintaining full coverage.

Changes:
- Added minimize-tests dependency to pyproject.toml test group
- Created generate_minimal_tests.py script to compute minimal test set
- Added tox environment 'json_infra_min' to run minimal tests with coverage enforcement
- Added tox environment 'json_infra_generate' to regenerate minimal test list
- Created minimal_tests.txt placeholder for generated test IDs

How it works:
1. Run all json_infra tests with --cov-context=test to track coverage per test
2. Use minimize-tests tool to solve set cover problem (find minimum tests covering all lines)
3. Run only the minimal test set with --cov-fail-under to enforce coverage threshold
4. Regenerate when coverage drops or code changes significantly

Usage:
  tox -e json_infra_min           # Run minimal tests (fast)
  tox -e json_infra_generate      # Regenerate minimal test list
  tox -e json_infra              # Run full suite (slow)

Expected impact: 20-50x speedup for json_infra tests while maintaining
same code coverage as the full test suite.
@DeborahOlaboye DeborahOlaboye changed the title test: Investigate and optimize running filled tests feat(pytest): add minimal test set infrastructure for json_infra Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate and optimize running filled tests

2 participants