Testing and Validation
Purpose
Define the canonical testing and validation workflow for DSAMbayes v1.2.2, from local pre-merge checks through release-quality gates.
Audience
- Engineers running local checks before merge
- Maintainers preparing release candidates
- Reviewers validating release evidence
Validation layers
| Layer | Objective | Primary command(s) | Output proof |
|---|---|---|---|
| Lint | Catch style and static issues early | Rscript scripts/check.R --lint |
Exit code 0, no lint failures |
| Style | Enforce formatting compliance on changed files | Rscript scripts/check.R --style |
Exit code 0, no reformat-required files |
| Unit tests | Catch behavioural regressions in package logic | R -q -e 'testthat::test_dir("tests/testthat")' |
Exit code 0, no test failures |
| Package check | Validate package-level install and check behaviour | R -q -e 'rcmdcheck::rcmdcheck(...)' |
No ERROR; no unresolved WARNING |
| Runner validate | Validate config and data contracts without fitting | Rscript scripts/dsambayes.R validate ... |
Exit code 0, metadata artefacts |
| Runner run | Validate end-to-end runner execution and artefacts | Rscript scripts/dsambayes.R run ... |
Exit code 0, core run artefacts |
| Docs build | Validate pkgdown documentation buildability | Rscript -e 'pkgdown::build_site_github_pages(...)' |
Exit code 0, successful site build |
| CI workflows | Cross-platform and publish-path verification | GitHub Actions workflow runs | Green workflow status on candidate commit |
Environment setup
Run all commands from repository root:
Expected outcome: checks run in a repo-scoped environment with reproducible library and cache paths.
Local validation workflows
Developer fast path (pre-merge)
Run the consolidated local gate:
Expected outcome: lint, style, tests, and coverage complete successfully.
Implementation note: scripts/check.R --all is a convenience gate. It does not replace rcmdcheck, runner smoke tests, or docs build.
Release-candidate full path
Run mandatory gates in this exact order:
Expected outcome: all gates complete with exit code 0, with no unresolved release blockers.
Runner smoke-test expectations
Minimum release smoke expectations:
validatecommand succeeds and writes metadata artefacts.runcommand succeeds and writes model, posterior summary, and diagnostics artefacts.- Required runner artefact paths exist under
results/quality_gate_validate/andresults/quality_gate_run/.
For matrix and exact artefact paths, use Runner Smoke Tests.
CI validation expectations
Candidate commit should have:
- Passing
.github/workflows/R-CMD-check.yaml. - Passing
.github/workflows/pkgdown.yamlbuild. - Deploy-step eligibility confirmed for non-PR release flow.
For workflow semantics and expected proof, use CI Workflows.
Evidence capture requirements
Before sign-off, capture:
- Full command logs and exit codes for all mandatory gates.
- Runner smoke artefacts from validate and run directories.
- CI run URLs and statuses for both workflows.
- Candidate commit hash and top changelog section.
Use Release Evidence Pack as the authoritative bundle contract.
Failure handling
- Any gate failure is a release blocker until resolved.
- Re-run the full failed gate after remediation.
- If
rcmdcheckemitsNOTE, record reviewer rationale explicitly. - If runner artefacts are missing, inspect resolved config and
outputs.*flags.