Summary
Add testthat unit tests with mocked gh CLI calls for the snapshot helpers (pull_workflows, resolve_package, and related) so the v1.1 release (#44) is defensible.
Problem / Rationale
The snapshot logic in workr is gh api-heavy. There are no tests covering it today. Without coverage, #44's release is a coin flip — regressions land straight in gismo.library's nightly the moment Gilead-BioStats/gismo.library#90 pins the tag.
Scope
In scope: testthat tests covering tagged refs, branch refs, date-resolution fallback, missing inst/workflow, dir-vs-file recursion, base64 decoding of DESCRIPTION, malformed responses.
Out of scope: Integration tests that hit the live GitHub API.
Proposed Approach
- Refactor
system2("gh", ...) calls behind a thin wrapper so tests can swap it for a fixture-returning stub.
- Capture sample
gh api JSON responses as fixtures under tests/testthat/fixtures/.
- Write tests for each scenario above.
QC Approach
Related
Part of the gismo.library snapshot pipeline requirement: Gilead-BioStats/gsm.roadmap#20 (Theme A)
Summary
Add
testthatunit tests with mockedghCLI calls for the snapshot helpers (pull_workflows,resolve_package, and related) so the v1.1 release (#44) is defensible.Problem / Rationale
The snapshot logic in
workrisgh api-heavy. There are no tests covering it today. Without coverage, #44's release is a coin flip — regressions land straight ingismo.library's nightly the moment Gilead-BioStats/gismo.library#90 pins the tag.Scope
In scope: testthat tests covering tagged refs, branch refs, date-resolution fallback, missing
inst/workflow, dir-vs-file recursion, base64 decoding ofDESCRIPTION, malformed responses.Out of scope: Integration tests that hit the live GitHub API.
Proposed Approach
system2("gh", ...)calls behind a thin wrapper so tests can swap it for a fixture-returning stub.gh apiJSON responses as fixtures undertests/testthat/fixtures/.QC Approach
gh apioutput)Related
Part of the
gismo.librarysnapshot pipeline requirement: Gilead-BioStats/gsm.roadmap#20 (Theme A)