Repository navigation
test: expand test coverage - #29
Draft
Alexander-Auer wants to merge 35 commits into
Draft
Alexander-Auer wants to merge 35 commits into
Alexander-Auer wants to merge 35 commits into
Conversation
… have them link to each other
…ede into feat/core-contract
…a consumer should choose to use it or not
* feat: Models the core contract needs * Feat: Protocols and Exceptions added for the core contract * Feat: Private protocols for the BatchBackend * feat: a fake backend to run unit tests against * fix: some code cleanup in the helper functions * feat: setup for the unit test suite * chore: style fix * chore: styling, unit test fixture * chore: single letter var `h` refering to hanlde changed to `handle` * fix: unused parameter in `test_injected_failure_is_reported_per_job()` removed * feat: Models the core contract needs * Feat: Protocols and Exceptions added for the core contract * Feat: Private protocols for the BatchBackend * feat: a fake backend to run unit tests against * fix: some code cleanup in the helper functions * feat: setup for the unit test suite * chore: style fix * chore: styling, unit test fixture * chore: single letter var `h` refering to hanlde changed to `handle` * fix: unused parameter in `test_injected_failure_is_reported_per_job()` removed * fix: made the OutputSpec optional as it is not suppoerted by all and a consumer should choose to use it or not --------- Co-authored-by: alexander <alexander.auer@cern.ch>
…d of a hash of the full object
Add BackendConfig, one flat public model a consumer uses to describe any backend (kind, transport, scheduler, endpoint, host, ...). It is resolved internally into the settings of exactly one backend family, so a field that does not apply to the chosen kind is refused by name instead of ignored. Add the registry: registry.backend(config) builds the backend a configuration describes, from closed name -> "module:Class" tables. Entries are imported lazily and every built object is checked against its protocol, so a broken entry fails at resolution with a RegistryError. Part of DIRACGrid#18. Co-authored-by: alexander <alexander.auer@cern.ch>
Cover every field against every backend kind, every fake-backend operation against every job state, and the remaining registry and model paths. Add pytest-cov with branch coverage, measured in subprocesses too. Co-authored-by: alexander <alexander.auer@cern.ch>
This was referenced Oct 20, 2026
This branch has not been deployed
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.
test: expand unit test coverage to every logical case
Important
**Depends on #28 . Merge after #28 ** (PR 3 of 4; the full order is listed in #27).
Until #REGISTRY is merged, this diff also shows the earlier PRs. This PR's own change is one commit:
9dac6f5This PR adds tests only, apart from enabling coverage measurement. No library code changes.
What is covered
Configuration: a field × kind matrix (
test_config.py). Two tables define the five configuration shapes (arc, htcondor-ce, cloud, batch+local, batch+ssh) and which fields apply to each. From them, the tests generate every combination and check that:Two guard tests fail if a field or kind is added to
BackendConfigwithout being added to the tables. There are also tests for:authcombination, valid and invalid;The fake backend (
test_fake_backend.py):submitactually stores: local inputs read once at submit, URLs left to the resource, and per-copy secrets and environment;Models and smoke tests:
JobHandle.keyescaping;JobStatusvalues stay stable, since stored statuses are compared by value;OpOutcome;Tooling
pytest-covin thetestingextras.[tool.coverage]: branch coverage, subprocesses measured too, and protocol...bodies andTYPE_CHECKINGblocks excluded.With this PR, line and branch coverage of
src/intercedeis 100%. A coverage gate (fail_under) is not added; whether to enforce one is a decision for the team.477 tests pass on Python 3.11 and 3.13, and pre-commit passes.