Repository navigation
test: add Conquest integration test - #211
Conversation
Run proWES against Conquest on a kind cluster: setup.sh applies PostgreSQL, an S3 server (versitygw) and their Secrets, and installs Conquest's chart from a pinned commit with its images pinned by digest. proWES joins kind's Docker network and reaches Conquest at a node port. Runs of the WESkit test's Snakefiles, fetched by Conquest from this repository at a commit of dev, complete, fail and are canceled; the test checks them at proWES and at Conquest (state, tasks, runner gone). The integration matrix gets the entry Conquest with a kind cluster. report_versions accepts service info without type, as Conquest's is. check-yaml allows multi-document YAML for the Kubernetes manifests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cancel the sleeping run once its task Pod runs, and check that its runner and task Pods are gone (by the run's label). setup.sh refuses contexts other than its kind cluster, whose name and node port are fixed. report_versions checks the type where a service info has one. CI shows runner and task logs on failure. Only cluster.yaml may have several YAML documents. The docs keep the kubeconfig out of the repository and list the Helm and kind pins of three jobs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewer's GuideImplementationAdd shared integration-test helpers for authenticated requests, tagged-run cleanup, and service-info validation that accommodates Conquest.
ConfigurationDefine the Conquest test cluster resources, pinned chart values, backend overlay, and Compose networking needed to run the test.
Add guarded cluster setup and CI wiring to install Conquest on kind, run the integration matrix entry, and report cluster diagnostics on failure.
DocumentationDocument the Conquest integration test, its local setup and maintenance, and the WES deviations and CI pins.
TestsExercise successful, failed, and canceled Snakemake and WDL runs through proWES and verify Conquest tasks, outputs, and cleanup.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
📖 1 file modified Preview · build overview · proWES · built Dec. 3, 2026, 9:43 p.m. UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #211 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 1404 1404
=========================================
Hits 1404 1404 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Linked issuesChecked at commit b403393 #193 test: run integration tests against Conquest · 6 of 6 met
|
There was a problem hiding this comment.
Hey - I've found 4 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="tests/integration/conquest/setup.sh" line_range="27" />
<code_context>
+
+# Only on the kind cluster: the script installs into the current context
+context="$(kubectl config current-context)"
+if [ "${context}" != "kind-${CLUSTER}" ]; then
+ echo "The current context is ${context}, not kind-${CLUSTER}" >&2
+ exit 1
</code_context>
<issue_to_address>
**Setup can target another cluster**
When the active kubeconfig context is named `kind-prowes-conquest` but points to a different cluster, the context-name check accepts any cluster configured under `kind-prowes-conquest`; `kubectl apply` and `helm upgrade --install` then create or modify the test namespace and release on that cluster, potentially changing unrelated cluster state.
Validate that the selected context actually targets the expected kind cluster before applying manifests or installing the chart.
</issue_to_address>
### Comment 2
<location path="tests/integration/conquest/check.sh" line_range="64" />
<code_context>
+ kubectl -n conquest get pods -l "conquest.io/run-id=${remote}" \
+ --field-selector "$2" --no-headers \
+ -o custom-columns='TYPE:.metadata.labels.conquest\.io/job-type,NAME:.metadata.name' \
+ 2> /dev/null || true
+}
+
</code_context>
<issue_to_address>
**Pod query failures pass cleanup check**
When a Kubernetes query fails during the post-cancellation Pod check, `run_pods` suppresses `kubectl` errors and returns empty output, so `active_pods` makes the cleanup assertion report success without verifying that the runner and task Pods are gone.
Let Kubernetes query failures propagate so the cleanup check fails instead of treating an error as an empty Pod list.
Also at `tests/integration/conquest/check.sh:63`, `tests/integration/conquest/check.sh:135`.
</issue_to_address>
### Comment 3
<location path="tests/integration/conquest/check.sh" line_range="69" />
<code_context>
+
+# The Pods of a run that haven't ended
+active_pods() {
+ run_pods "$1" status.phase!=Succeeded,status.phase!=Failed
+}
+
</code_context>
<issue_to_address>
**Terminal Pods pass cleanup check**
When the canceled run leaves runner or task Pods in a `Succeeded` or `Failed` phase, `active_pods` excludes those phases, so the cleanup check reports success while the Pods still exist in Kubernetes.
Check for all remaining Pods belonging to the run, including terminal Pods.
Also at `tests/integration/conquest/check.sh:64`.
</issue_to_address>
### Comment 4
<location path="tests/integration/conquest/check.sh" line_range="49" />
<code_context>
+# is in `${id}`
+create() {
+ check POST /runs 200 '.run_id | length > 0' \
+ "workflow_params=$2" 'workflow_type=SMK' 'workflow_type_version=9.17.3' \
+ "workflow_url=${workflow_repository}" \
+ "workflow_engine_parameters={\"revision\": \"${WORKFLOW_REVISION}\", \"snakefile\": \"tests/integration/weskit/workflows/$1\"}"
</code_context>
<issue_to_address>
**WDL workflow coverage**
Every submitted run uses `SMK`, while the configured Conquest deployment supplies a WDL runner image. Add the applicable run checks for WDL as well.
</issue_to_address>Sourcery assessment
Approval pending. 4 findings to address first.
Blocking findings: tests/integration/conquest/setup.sh:27, tests/integration/conquest/check.sh:64, tests/integration/conquest/check.sh:69, tests/integration/conquest/check.sh:49
setup.sh also checks that the context kind-prowes-conquest points to the API server of the kind cluster of that name. The Pod checks after a cancel let kubectl errors fail the test instead of reading as no Pods, and require that no Pod of the run is left in any phase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Conquest test runs its checks (complete, fail, cancel while running) for Snakemake and WDL, whose workflows Conquest fetches from this repository at a commit of dev; for WDL it also reads the greeting from Conquest's S3 server. The docs say why Nextflow isn't covered: Nextflow 24.10.4, which Conquest's runner runs, refuses a repository without main.nf at its root before it applies -main-script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WORKFLOW_REVISION moves to 5f501d5, the commit of the WDL workflows on dev (#212). The docs link the Conquest issue about Nextflow runs (elixir-cloud-aai/generic-issues#194). The workflow-type table carries the output key of the greeting instead of a WDL special case and the path with {} instead of a printf format. check.sh refuses contexts other than the kind cluster's, limits its kubectl calls to 60 seconds and reads only s3:// objects. Comments and docs are rewrapped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quote the workflow name in the path substitution (bash 5.2 replaces & in an unquoted replacement) and rewrap the header comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey - I've found 4 issues
Sourcery assessment
Approval pending. 4 findings to address first.
Blocking findings: tests/integration/conquest/check.sh:100, tests/integration/conquest/check.sh:171, tests/integration/conquest/check.sh:69, tests/integration/conquest/check.sh:165
kind.sh holds the cluster guard that setup.sh and check.sh now share: the context must be kind-prowes-conquest and point to that cluster's API server. The cancel check waits for a non-empty task Pod line (an empty Pod list read as a task before). The sleep run is tagged with a value of its own before it is created, and create() sets running itself; on_exit finds a run by that tag when its identifier never arrived (a lost response) and cancels it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tagged_runs filters the run list, which has the runs' tags, in one request; quietly sends any authenticated request without checks, also the cancel in on_exit. check.sh names Conquest's host from the cluster name of kind.sh and lists kind among its requirements, as the docs do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Conquest integration test (#211, merged into dev meanwhile) lists Conquest without `auth`, which now defaults to client_credentials, so the app and the worker refused the config. It sets `auth: none`. A unit test validates the app config of every smoke and integration overlay, so that such configs fail locally, not only in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat: authenticate at WES backends proWES authenticates at WES instances with credentials of its own, as the auth of their entries says: a token of its client at the identity provider of custom.wes.client_credentials (the default; client ID and secret in PROWES_CLIENT_ID and PROWES_CLIENT_SECRET), HTTP Basic credentials from named environment variables, or none. Discovered WES instances get the credentials of their registry entry. Credentials are looked up for each request from the current backend list, with FOCA's backend credentials; WES instances the list no longer yields get no request (no_credentials, not retried), and tracking their runs fails. Service infos are read without credentials. The worker task no longer takes a jwt argument. The startup check is FOCA's check_backends, which refuses missing environment variables and warns about basic, none and http. The smoke test's fake WES now issues tokens of proWES's client and requires them on its WES API over HTTPS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: document credentials of WES instances Access control gets a section on proWES's credentials at WES instances; configuration, deployment (Secret via prowes.extraEnv), getting started, API errors and the upgrade notes follow the new default auth: client_credentials. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: send no credentials to WESkit The WESkit integration test (#209) lists WESkit without auth, which now defaults to client_credentials: set auth: none, as for Sapporo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: accept tasks queued with a client token Tasks of earlier versions still pass jwt to the tracking task: keep it as an ignored argument, so that they run after an upgrade. One check of listed WES instances (WesClient.require_listed) serves the client and the worker. Docs: only the app checks credentials on startup (the worker fails to track runs), failed requests name the no_credentials cause, and init_app documents RuntimeError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: warn about shared tokens of discovered WES Registry entries default to auth: client_credentials, so without audience_parameter every discovered WES instance gets the token that the configured ones accept: warn on startup, and document the replay risk. The app keeps sending jwt: None to the tracking task, which workers of earlier versions require during a rolling update. Docs say how failed token fetches affect forwarding and tracking. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: look up WES instances of runs again The worker set runs to SYSTEM_ERROR after one lookup of their WES instance, e.g., when a registry couldn't be read when tracking started. It now looks the instance up again, up to polling_attempts times, polling_wait seconds apart, before giving up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: look up WES instances for each request Long-lived clients (the worker's) kept the entry found when they were created: a WES instance removed from the backend list kept getting requests. require_listed() now looks it up again for each request. Upgrade notes: upgrade workers together with the app. Test of a discovered WES instance with auth: none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: keep WES credentials out of chart values Rendering fails if prowes.extraEnv sets PROWES_CLIENT_SECRET, or a variable that the basic of a backend entry in config names, from a value instead of a Secret (valueFrom), as #182 asks: credentials of WES instances come from Secrets only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: require Secrets for WES credentials The chart refuses WES credentials in prowes.extraEnv unless they come from valueFrom.secretKeyRef (a ConfigMap or field ref was accepted). Docker Compose passes PROWES_CLIENT_ID and PROWES_CLIENT_SECRET from the host to the app and the worker, as proTES does. Docs: the upgrade snippet for the former WES instance sets auth: none; stored runs are tracked only while their WES instance stays listed; access control and the chart README say where the client comes from. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: render extraEnv with empty config sections The chart's check of WES credentials in prowes.extraEnv failed with a template error when config.custom or config.custom.wes was null or no map (e.g., an empty `wes:`); such sections now count as no backends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: send no credentials to Conquest The Conquest integration test (#211, merged into dev meanwhile) lists Conquest without `auth`, which now defaults to client_credentials, so the app and the worker refused the config. It sets `auth: none`. A unit test validates the app config of every smoke and integration overlay, so that such configs fail locally, not only in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Adds an integration test of proWES against Conquest, a third real WES implementation next to Sapporo and WESkit, that runs in CI without live services.
tests/integration/conquest/setup.shappliescluster.yaml(namespaceconquest, PostgreSQL, the S3 server versitygw and their Secrets, with fixed test credentials) and installs Conquest's chart from the pinned commit3147d10of itsmasterbranch (Conquest publishes no chart and no releases), with that commit's images pinned by digest (values.yaml).setup.shrefuses any kubectl context other thankind-prowes-conquest.compose.yaml); the config overlay adds Conquest as a backend (config.yaml).check.shruns its checks for both workflow types it can cover, Snakemake (the WESkit test's Snakefiles) and WDL (tests/integration/conquest/workflows/, added by test: add WDL workflows for Conquest test #212), which Conquest fetches from this repository at a commit ofdev(5f501d5): a run that completes (state, request, run log, ConquestCOMPLETE, its task's exit code0at Conquest, for WDL the greeting file in Conquest's S3 store holding the message, run list,409on cancel), one that fails (EXECUTOR_ERRORat both), and one canceled while its task Pod runs (CANCELEDat both, no Pod of the run left in any phase).setup.shandcheck.shrefuse kube contexts other than the kind cluster's, checked by name and API server (kind.sh). The sleep run carries a tag of its own, so thaton_exit(lib.sh) can find and cancel it when its identifier never arrived.tests/integration/lib.sh:report_versionsaccepts a service info withouttype(as Conquest's) and checks the type where there is one.integrationmatrix gets the entryIntegration (Conquest)withcluster: true, which sets up Helm and kind (pinned) and runssetup.sh; on failure it shows the cluster state and the Conquest, runner and task logs. The required gateCI passedis unchanged..pre-commit-config.yaml:check-yamlallows several YAML documents incluster.yamlonly.docs/development.md: how to run the Conquest test (kubeconfig outside the repository), how to move to another Conquest commit (by hand, not Dependabot), where Conquest differs from WES 1.1.0, and the Helm and kind pins in the CI table.Conquest deviations the test accommodates (documented):
revision(which must be on a branch, so a commit ofdev, not of a pull request);snakefilenames the Snakefile.id,name,type, ...), only the WES ones; the overlay states the WES version with the labelwes.version: "1.1.0".SMK9.17.3), added to proWES'sworkflow_type_versionsby the overlay, with WDL1.0.NFL) isn't covered: Conquest's runner hands the repository to Nextflow 24.10.4, which refuses a repository withoutmain.nfat its root before it applies-main-script(Conquest: Nextflow runs fail without main.nf at the repo root generic-issues#194).stdoutas ans3://URL, outputs (WDL only) ass3://URLs; the test reads the task's exit code fromGET /runs/{run_id}/tasks.No
pro_wes/code changes; no proWES bug found.Closes #193
Verification
tests/integration/conquest/setup.shandcheck.shagainst a local kind cluster and stack, at the final pin 5f501d5: passed (service info; complete, fail, cancel while running, for SMK and WDL).tests/integration/check.sh(Sapporo) andtests/integration/weskit/check.shafter thelib.shchange: passed locally before the rebase onto dev; CI runs all three.pytest: 1045 passed (chart tests afterhelm dependency build deployment).pre-commit run --all-files: passed; shellcheck 0.11.0 on all integration scripts and actionlint onci.yml: no findings;mkdocs build --strict: passed.check.sh, a cancel that could pass before a task Pod ran, a run left behind by a lost POST response or an interrupt) fixed in 11bb0ac and b403393, each change reviewed in two rounds.on_exitthrough its tag.Merge gate: none beyond automated reviews.
Declined review findings
s3_filerefuses keys containing..anywhere, not only as a path segment (low): Conquest's output keys don't contain..; a stricter check would buy nothing for this test.Open questions
None.
🤖 Generated with Claude Code