Skip to content

feat(test): add unit test infrastructure with py_itf_unittest#94

Open
clanghans wants to merge 4 commits intoeclipse-score:mainfrom
etas-contrib:feature/add-unittest-initial
Open

feat(test): add unit test infrastructure with py_itf_unittest#94
clanghans wants to merge 4 commits intoeclipse-score:mainfrom
etas-contrib:feature/add-unittest-initial

Conversation

@clanghans
Copy link
Copy Markdown
Contributor

Summary

  • Introduce py_itf_unittest Bazel macro: lightweight py_test wrapper without ITF plugin infrastructure, with pytest-mock included by default
  • Reorganize test/ into test/integration/ (existing tests) and test/unit/ (new pure unit tests)
  • Enable Bazel native LCOV coverage via configure_coverage_tool = True and --instrumentation_filter
  • Add unit tests for ping (mocker-based) and qemu config schema (pure Pydantic model validation, no file I/O)
  • Add integration-level counterparts for test_attribute_plugin and qemu_config_schema
  • Extract //score/itf/plugins/qemu:config as a separate Bazel target so unit tests only pull in config.py + pydantic, keeping the coverage denominator minimal

Test plan

  • bazel test //test/unit:unit passes
  • bazel coverage //test/unit:unit produces a non-empty LCOV report
  • bazel test //test/integration:test_rules_are_working_correctly still passes
  • bazel build //score/itf/plugins/qemu still builds

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
@clanghans clanghans marked this pull request as ready for review May 11, 2026 09:45
Co-authored-by: $(git config user.name) <$(git config user.email)>
@clanghans clanghans force-pushed the feature/add-unittest-initial branch 2 times, most recently from b15b5a7 to e478402 Compare May 11, 2026 10:18
clanghans added 3 commits May 11, 2026 12:24
- 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.
@clanghans clanghans force-pushed the feature/add-unittest-initial branch from e478402 to 238efe0 Compare May 11, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant