Skip to content

[workr] Add testthat coverage for pull_workflows and resolve_package #43

@zdz2101

Description

@zdz2101

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

  1. Refactor system2("gh", ...) calls behind a thin wrapper so tests can swap it for a fixture-returning stub.
  2. Capture sample gh api JSON responses as fixtures under tests/testthat/fixtures/.
  3. Write tests for each scenario above.

QC Approach

  • Unit Tests
  • Qualification Test via Double Programming (independent reviewer validates fixtures match real gh api output)

Related

Part of the gismo.library snapshot pipeline requirement: Gilead-BioStats/gsm.roadmap#20 (Theme A)

Metadata

Metadata

Labels

testTesting functions need to be added

Type

No type

Projects

Status

Development

Relationships

None yet

Development

No branches or pull requests

Issue actions