-
Notifications
You must be signed in to change notification settings - Fork 151
refactor(consume): create explicit pytest plugin structure #1801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(consume): create explicit pytest plugin structure #1801
Conversation
689f212
to
b610953
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Refactor is very nice. We've needed this for a while. Couldn't spot anything out of the ordinary :)
1b80ed9
to
284cc03
Compare
Plugins called 'conftest' are registered automatically if in a sub-path to a test. This rename requires an explicit registration, which is specified by defining the `pytest_plugins` variable in 'engine/conftest.py', respectively, 'rlp/conftest.py'.
These are fixtures that can also be shared by multi-client architecture simulators.
…ectory Consolidate test_via_engine.py and test_via_rlp.py into a shared hive_tests/ directory to improve organization and prepare for future multi-client architectures. - Create src/pytest_plugins/consume/simulators/hive_tests/ directory. - Move test_via_engine.py from engine/ to hive_tests/. - Move test_via_rlp.py from rlp/ to hive_tests/. - Update get_command_paths() to reference new locations. - Maintain separation: plugin configs (conftest.py) stay with their simulators. This provides better logical organization of test execution files while maintaining explicit pytest plugin structure.
… configs With the move to hive_tests/, the simulator-specific conftest.py files are no longer automatically discovered. Add explicit plugin registration to ensure _supported_fixture_formats and other simulator configs are properly loaded. - Add command_name parameter to HiveEnvironmentProcessor. - Register simulator-specific plugins based on command name. - Update ConsumeCommand to pass command_name to processors. - Fix AttributeError: 'Config' object has no attribute '_supported_fixture_formats'.
…conftest files Move pytest_hive plugin registration from HiveEnvironmentProcessor to individual simulator conftest files to centralize all plugin configuration in one place per simulator.
cf865b4
to
b2e4a3b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of explanatory comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
🗒️ Description
This PR refactors the consume simulator architecture to use explicit pytest plugin structure, improving organization and preparing for future multi-client architectures.
With this PR, we now explicitly register a single plugin for each consume sub-command; this central sub-command specific plugin, specified in
src/cli/pytest_commands/processors.py
, then dynamically registers all the required plugins in order to define the sub-command behavior. This is achieved via thepytest_plugins
variable, e.g.,
execution-spec-tests/src/pytest_plugins/consume/simulators/engine/conftest.py
Lines 17 to 24 in b2e4a3b
🏗️ Explicit Pytest Plugin Structure
test_via_engine.py
/test_via_rlp.py
.base.py
,single_test_client.py
,exceptions.py
,test_case_description.py
,timing_data.py
.📁 Improved Directory Organization
hive_simulators/
→simulators/
for clarity.helpers/
sub-package.hive_tests/
directory (this will allow re-use oftest_via_engine.py
for theenginex
simulator.🔌 Plugin Registration System
src/cli/pytest_commands/
).🔗 Related Issues
This PR is a base for the new
enginex
simulator:consume enginex
simulator #1765✅ Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.