Skip to content

tests: Add tests for NoopExecutionEngine mock API#4114

Merged
jtraglia merged 3 commits into
ethereum:devfrom
bshastry:add-tests-mock-execution-engine
Feb 3, 2025
Merged

tests: Add tests for NoopExecutionEngine mock API#4114
jtraglia merged 3 commits into
ethereum:devfrom
bshastry:add-tests-mock-execution-engine

Conversation

@bshastry

Copy link
Copy Markdown
Contributor

This PR adds test coverage for the mock Engine API interface methods in NoopExecutionEngine across multiple forks (Bellatrix, Deneb, Electra). The tests verify that each fork's implementation maintains its specific interface contract while providing mock behaviors for CL-EL interaction in test scenarios.

The Engine API interface has evolved across forks:

  • Bellatrix: Basic interface (notify_new_payload, is_valid_block_hash, get_payload, etc.)
  • Deneb: Added parent_beacon_block_root parameter
  • Electra: Added execution_requests_list parameter

Add fork-specific test files:

  • tests/core/pyspec/eth2spec/test/bellatrix/execution_engine/test_execution_engine_interface.py
  • tests/core/pyspec/eth2spec/test/deneb/execution_engine/test_execution_engine_interface.py
  • tests/core/pyspec/eth2spec/test/electra/execution_engine/test_execution_engine_interface.py

Improves coverage by 5 SLoC in CL-EL mock implementation, with proper fork-specific interface testing.

@jtraglia

Copy link
Copy Markdown
Member

Hey @bshastry, these are great, thank you!

Could you please move these to the unittests (eg unittests for bellatrix)directory? Like this:

  • tests/core/pyspec/eth2spec/test/bellatrix/unittests/test_execution_engine_interface.py

The reason I'm asking for this is because these directories (block_processing, fork, fork_choice, etc) are associated with a test format (see formats) which are exported and run by clients. unittests is the exception here, this directory contains tests which are not exported.

@bshastry bshastry force-pushed the add-tests-mock-execution-engine branch from 9347ee8 to c7ed324 Compare February 3, 2025 08:37
@bshastry

bshastry commented Feb 3, 2025

Copy link
Copy Markdown
Contributor Author

Hey @bshastry, these are great, thank you!

Could you please move these to the unittests (eg unittests for bellatrix)directory? Like this:

  • tests/core/pyspec/eth2spec/test/bellatrix/unittests/test_execution_engine_interface.py

The reason I'm asking for this is because these directories (block_processing, fork, fork_choice, etc) are associated with a test format (see formats) which are exported and run by clients. unittests is the exception here, this directory contains tests which are not exported.

Thank you for your review! I have moved the tests to the respective forks' unittests directory. 🙏

@jtraglia jtraglia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@jtraglia jtraglia merged commit 3b5084c into ethereum:dev Feb 3, 2025
@bshastry bshastry deleted the add-tests-mock-execution-engine branch February 4, 2025 08:56
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.

2 participants