Skip to content

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

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

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

Conversation

@clanghans
Copy link
Copy Markdown

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

Co-authored-by: $(git config user.name) <$(git config user.email)>
- 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.
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