Skip to content

Test coverage for the cohort-mode shell scripts #360

Description

@amc-corey-cox

Parallel Multi-Consent mode (#333) added about 1,000 lines of shell — bdc-cohort-workflow.sh (713) and hv-dataqc-cohort.sh (292) — with no automated tests. The Python side of that PR did get tests, and the live COPDGene run gives real confidence the happy path works, so this is follow-up rather than a gap that should have blocked it.

Two areas are worth targeting specifically, because they are where a silent error is both plausible and expensive:

Parallelism arithmetic. CONSENT_PARALLELISM defaults to min(#cgs, max(1, floor(vCPU / JOBS))). The interaction between --jobs and --consent-parallelism already produced one review finding (division by zero on --jobs 0) and one docs/implementation mismatch. It is pure arithmetic on inputs, so it is cheap to test and easy to get subtly wrong.

Status aggregation. The mapping from per-consent result.env files to overall_status, and from there to the exit code, decides whether Seven Bridges sees a task as successful. A subshell bug in exactly this area — OVERALL_STATUS="FAIL" set inside a subshell and never propagating, so QC reported overall=PASS on failed steps — was already found and fixed once by hand in b287e81. That class of bug is invisible until someone reads a manifest.

Both are testable with a harness that stubs bdc-workflow.sh and feeds fixture result.env files, without needing BDC, real data, or credentials. bats or plain pytest driving the script through subprocess would both work.

Related: #297 (move bdc-workflow.sh entrypoint logic to Python) points the same direction — if that lands, some of this becomes Python-testable instead.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Quality ControlProcedures and workflows for quality controlfutureFuture work — not on current development roadmap

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions