Skip to content

Test: Shared integration tests for the backends - #38

Draft
Alexander-Auer wants to merge 117 commits into
DIRACGrid:mainfrom
Alexander-Auer:stack/htcondor-6-contract-suite
Draft

Alexander-Auer wants to merge 117 commits into
DIRACGrid:mainfrom
Alexander-Auer:stack/htcondor-6-contract-suite

Conversation

@Alexander-Auer

Copy link
Copy Markdown
Contributor

test: the shared contract suite, on the htcondor stack

Last PR for #23 (PR 6 of 6).

Important

Depends on #34 (stack/htcondor-2-integration-stack) and PR 5 (stack/htcondor-5-output). Merge after both.
Until then, this diff also shows the earlier PRs. This PR's own change: 799 lines

One set of tests, written against the interCEde protocols, runs on every stack, so a new backend writes no integration tests of its own.

What's added

  • tests/integration/test_*.py: 22 tests covering submit, status, output, kill, purge and what a consumer sees when things go wrong.
  • A contract marker, which selects these tests whatever a stack's markers say.
  • Capability fixtures (output_retriever, killable, purgeable), which skip a test on a backend without that capability.
  • [refusals] in a stack's client config, which says what its backend cannot honour. The suite checks each is refused at submit.
  • htcondor-utils in the pixi testing environment, plus the docs and the stack template.

Result

The same content passed on lts and latest on my fork (eb0fec6). Three tests skip on this stack, and the log names them: the refusal checks for url_inputs and url_outputs (HTCondor supports both), and the test for a backend that cannot collect output.

Alexander-Auer and others added 30 commits October 2, 2026 16:54
* 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>
@Alexander-Auer
Alexander-Auer force-pushed the stack/htcondor-6-contract-suite branch from 0405f83 to 07dfe7e Compare November 6, 2026 13:11
@Alexander-Auer
Alexander-Auer force-pushed the stack/htcondor-6-contract-suite branch from 07dfe7e to e827eb9 Compare November 16, 2026 08:24
@Alexander-Auer Alexander-Auer changed the title Stack/htcondor 6 contract suite Test: Shared integration tests for the backends Nov 16, 2026
…e any job is submitted

A line break in an argument or variable raised a raw ValueError, after the
clusters before it were already submitted: those jobs stayed queued without a
handle. Every description is now written first, and such a value is a
SpecificationRejectedError.
The core is tested through the HTCondor-CE backend that uses it, and on the
htcondor stack by the shared suite.
…show

Normal submit and status are the shared suite's, on the htcondor stack. One
file stays, through the backend's public operations: the states a stack never
reaches, refusals, partial submissions, secrets and the token, resources, and
the answers of a CE that refuses or cannot be read.
…ill-purge

# Conflicts:
#	tests/unit/backends/htcondorce/test_process.py
#	tests/unit/backends/htcondorce/test_status.py
Killing and purging are the shared suite's, on the htcondor stack.
# Conflicts:
#	tests/unit/backends/htcondorce/test_cleanup.py
#	tests/unit/backends/htcondorce/test_working_area.py
…cannot show

Collecting output is the shared suite's, on the htcondor stack. What stays: a
CE that points outside the working area or sends links, the limits, transfers
that fail or bring nothing, and one job collected twice at once.
Arguments and variables arrive as written, or are refused at submit when the
way a backend starts a job would change them; a copy's variable wins over the
shared one and stays out of the other copies. The job checks this itself, so
a backend that cannot collect output runs these tests too.

A backend's unit tests now cover only what a healthy stack does not show.
Both were only checked against the fake backend: a backend reads local
files before submit returns, and a closed backend can be closed again
but does no more work.
The shared suite has landed and every stack runs it, so pytest's exit 5
(no test selected) no longer passes as green. The step's matrix values
reach the shell through its environment, as elsewhere in the workflow.
backend.py only builds the parts and checks that the backend is open.
Submitting is in submit.py; what every operation shares (which handles
are ours, the CE's job ads, the sessions, status) is in jobs.py.
backend.py only builds the parts and checks that the backend is open.
Submitting is in submit.py, kill and purge in cancel.py; what every
operation shares (which handles are ours, the CE's job ads, the
sessions, status) is in jobs.py.
…ill-purge

# Conflicts:
#	src/intercede/_backends/monolith/htcondorce/__init__.py
#	src/intercede/_backends/monolith/htcondorce/backend.py
#	src/intercede/_backends/monolith/htcondorce/jobs.py
backend.py only builds the parts and checks that the backend is open.
Submitting is in submit.py, output in output.py, kill and purge in
cancel.py; what every operation shares (which handles are ours, the
CE's job ads, the sessions, status) is in jobs.py.
# Conflicts:
#	src/intercede/_backends/monolith/htcondorce/__init__.py
#	src/intercede/_backends/monolith/htcondorce/backend.py
…-suite

# Conflicts:
#	.github/workflows/integration.yml

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: HTCondorCEBackend — grid CE over the shared _htcondor core

1 participant