feat(test): add unit test infrastructure with py_itf_unittest#94
Open
clanghans wants to merge 4 commits into
Open
feat(test): add unit test infrastructure with py_itf_unittest#94clanghans wants to merge 4 commits into
clanghans wants to merge 4 commits into
Conversation
3 tasks
clanghans
added a commit
to etas-contrib/score_itf
that referenced
this pull request
May 11, 2026
Documents the four design decisions made in PR eclipse-score#94: - py_itf_unittest macro (thin wrapper, no plugin machinery) - surgical Bazel target splitting for atomic deps - pytest bootstrap via shared main.py - pytest-mock over unittest.mock References: eclipse-score#94
Co-authored-by: $(git config user.name) <$(git config user.email)>
b15b5a7 to
e478402
Compare
- Introduce py_itf_unittest macro: lightweight py_test wrapper with no ITF plugin infrastructure, pytest-mock included by default - Export py_itf_unittest via defs.bzl alongside py_itf_test - Move existing tests to test/integration/ - Add test/unit/ with test_ping (mocker) and test_qemu_config_schema (pure Pydantic model validation, no file I/O) - Add integration-level test_qemu_config_schema (load_configuration with real JSON files) and test_attribute_plugin - Set coverage instrumentation filter to //score/itf[/:]
Split //score/itf/plugins/qemu into :config (config.py + pydantic only) and :qemu (rest of plugin, depends on :config). Unit tests depend on :config to avoid pulling in qemu infrastructure as coverage denominator.
e478402 to
238efe0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
py_itf_unittestBazel macro: lightweightpy_testwrapper without ITF plugin infrastructure, withpytest-mockincluded by defaulttest/intotest/integration/(existing tests) andtest/unit/(new pure unit tests)configure_coverage_tool = Trueand--instrumentation_filterping(mocker-based) andqemuconfig schema (pure Pydantic model validation, no file I/O)test_attribute_pluginandqemu_config_schema//score/itf/plugins/qemu:configas a separate Bazel target so unit tests only pull inconfig.py+pydantic, keeping the coverage denominator minimalTest plan
bazel test //test/unit:unitpassesbazel coverage //test/unit:unitproduces a non-empty LCOV reportbazel test //test/integration:test_rules_are_working_correctlystill passesbazel build //score/itf/plugins/qemustill builds