Skip to content

test: add a testthat suite and CI - #114

Merged
eliotmcintire merged 1 commit into
developmentfrom
feat/add-testthat-ci
Sep 14, 2026
Merged

eliotmcintire merged 1 commit into
developmentfrom
feat/add-testthat-ci

Conversation

@eliotmcintire

Copy link
Copy Markdown
Collaborator

Adds a testthat suite and CI to this module, as done across the fireSense family (e.g. PredictiveEcology/fireSense_spreadPredict#12), so the Biomass family is on the same test infrastructure before its development -> release-branch merge.

What's added

  • .github/workflows/testthat-module.yaml calls the shared testthat-module workflow. It installs the module's reqdPkgs, converts the module into a package in a throwaway directory with convertToPackage(destinationPath = ), runs tests/testthat, and writes coverage to the job summary. Nothing is committed back.
  • tests/testthat/setup.R is actions' examples/module-tests-setup.R: options, moduleName / modulePath, and a temporary directory tree.
  • tests/testthat/test-metadata.R asserts the declared inputs and outputs (names and classes) and the parameter names, which together are the module's public contract. It was generated from the module's own metadata rather than typed. A deliberate change to any of these should update this file in the same commit, with a matching version bump.
  • The newModule() scaffolding (tests/testthat/test-template.R, tests/unitTests.R) is removed.
  • tests/testthat/setup.R was already the shared template; test-dataYear.R and test-estimateCoverModel.R are kept as they are.
    Verified locally: testthat::test_dir("tests/testthat", filter = "metadata") passes (R 4.6.1, SpaDES.core 3.2.0). That goes through the module file directly; this PR's testthat-module run is the check on the package-conversion path.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xc7e6r283jgq5aJq1xC1zm

- .github/workflows/testthat-module.yaml calls the shared
  PredictiveEcology/actions testthat-module workflow (@main), which tests
  the module as a package via convertToPackage(destinationPath =).
- tests/testthat/setup.R is actions' examples/module-tests-setup.R.
- tests/testthat/test-metadata.R asserts the declared inputs and outputs
  (names and classes) and parameter names -- the module's public contract.
  Generated from the module's own metadata, not typed.
- Removes the unmodified newModule() scaffolding (tests/testthat/test-template.R,
  tests/unitTests.R).
- tests/testthat/setup.R was already the shared template; test-dataYear.R and
  test-estimateCoverModel.R are kept as they are.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xc7e6r283jgq5aJq1xC1zm
@eliotmcintire
eliotmcintire merged commit 6b94834 into development Sep 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant