Repository navigation
Test: Shared integration tests for the backends - #38
Draft
Alexander-Auer wants to merge 40 commits into
Draft
Alexander-Auer wants to merge 40 commits into
Alexander-Auer wants to merge 40 commits into
Conversation
4 tasks
Alexander-Auer
force-pushed
the
stack/htcondor-6-contract-suite
branch
from
November 6, 2026 13:11
0405f83 to
07dfe7e
Compare
Alexander-Auer
force-pushed
the
stack/htcondor-6-contract-suite
branch
from
November 16, 2026 08:24
07dfe7e to
e827eb9
Compare
Moves test_fake_backend.py to tests/unit/backends/fake/, ready for the HTCondor tests that follow. The tests themselves do not change. Part of DIRACGrid#23.
Renders a submit description from a plan: one process per copy, per-copy values indexed by ProcId, quoting, and refusing what a description cannot hold. It sets no policy on the job except keeping finished jobs until they are purged, so output can be collected again. Shared with the HTCondor scheduler to come (DIRACGrid#21), so it knows nothing about any backend. Expected values were checked against HTCondor 25. Part of DIRACGrid#23.
Builds the tools' command lines and reads what they print: condor_submit -terse, condor_rm, and the job ads of condor_q and condor_history, mapped to the common JobStatus. A finished job's result comes from its exit, a removed job keeps the result it had, and any hold that interCEde did not cause counts as aborted. Part of DIRACGrid#23.
interCEde no longer supports proxies, so a description has nothing to say about one.
The core is tested through the HTCondor-CE backend that uses it, and on the htcondor stack by the shared suite.
A stack's tests run with pytest-xdist (stacks.yml `workers`, default 4), and `-rs --no-fold-skipped` makes the log name every skipped test and why. The workflow also runs when src/ changes, since that is what it exists to test. Part of DIRACGrid#23.
An HTCondor-CE in front of a one-machine HTCondor pool. The image refuses package mirrors below 1 MB/s and caches its slow installs per version. No test selects this stack yet, so its CI job only shows that the stack starts (pytest exit 5 is tolerated). The shared suite lands later. Part of DIRACGrid#23.
For one of several CEs on a host, or a CE behind a forwarded address. The endpoint and schedd end up on the tools' command lines, so they are checked when the configuration is read: neither can pass as an option. Part of DIRACGrid#23.
The contract says inputs are read before submit returns, so an unreadable one is a SpecificationRejectedError, not a raw OSError. The conformance suite now asks for it, and the fake does it. Part of DIRACGrid#23.
- process: runs one tool, killing it on a timeout - session: one operation's credentials in private files that exist only while it runs, the tools' environment, and telling a rejected token from an unreachable CE - staging: the private working area, and what a submission puts in it Nothing uses these yet. The backend follows in the next commit. Part of DIRACGrid#23.
Spooled submission to a remote schedd, token authentication, and an optional X.509 proxy for sites that account on VOMS attributes. Copies whose variable names differ get separate clusters, because HTCondor merges each process's environment onto the previous one. Registered as `htcondor-ce`. Kill, purge and output follow in their own branches. Part of DIRACGrid#23.
FakeCondor answers the way HTCondor 25 does (checked against a live schedd), so these run without HTCondor installed: credentials, error classification, staging, secrets, containers and the working area. Part of DIRACGrid#23.
The credential provider now returns one credential instead of a set, and proxies are gone: no proxy file, and no delegation setting to go with it. The kind is checked once, where the token comes from, so the rest only deals with a token. X509_CERT_DIR stays. It holds the CAs the CE's host certificate is checked against, which has nothing to do with a proxy.
…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.
…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.
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.
…rt of every operation
Kill only removes active jobs, because removing a finished one would release output that has not been collected. That is what purge is for. A job removed a moment ago is still queued but already released, so purging twice is harmless. Token scopes follow the operation: compute.cancel here. Part of DIRACGrid#23.
Whether a purged job's status is then UNKNOWN or a final state depends on whether the resource still remembers it: a schedd's history does, an in-memory fake does not. Both are within the contract. Part of DIRACGrid#23.
Killing and purging are the shared suite's, on the htcondor stack.
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.
Written once against the interCEde protocols and run on every stack: a new backend writes no integration tests of its own. Tests carry the `contract` marker, and a test that needs an optional capability takes its fixture and is skipped on a backend that lacks it. [refusals] in a stack's client config says what its backend cannot honour, and the suite checks each is refused at submit. Part of DIRACGrid#23.
condor_transfer_data into the private working area, then moved into dest. The job ad comes from the remote side, so the CE can never choose where this host writes: links are refused and the output limits apply. Two collections of one job take turns, and the backend remembers nothing about jobs afterwards. Part of DIRACGrid#23.
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.
…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.
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.
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.
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.
… it starts condor_transfer_data authenticates anew each time, so one token for the whole operation had to outlast every transfer, several rounds of transfer_timeout_s.
Alexander-Auer
force-pushed
the
stack/htcondor-6-contract-suite
branch
from
December 1, 2026 16:47
df4d9fe to
8bd1968
Compare
…emaps Each is written on a line of its own, so a line break would start another submit command. A stream name given by the consumer is also written as it is: its "$" is escaped, and only the default names one file per process.
With -match it stops reading the history file at the number of jobs asked about, as DIRAC's HTCondorCEComputingElement does.
…ory's -match The submitter leaves stdout and stderr unset for the per-process default, which the description now writes itself.
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: 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.contractmarker, which selects these tests whatever a stack'smarkerssay.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-utilsin the pixi testing environment, plus the docs and the stack template.Result
The same content passed on
ltsandlateston my fork (eb0fec6). Three tests skip on this stack, and the log names them: the refusal checks forurl_inputsandurl_outputs(HTCondor supports both), and the test for a backend that cannot collect output.