Skip to content

test: add a testthat suite and CI - #14

Merged
eliotmcintire merged 1 commit into
developmentfrom
feat/add-testthat-ci
Sep 11, 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 piloted on PredictiveEcology/fireSense_EscapeFit#4.

What's added

  • .github/workflows/testthat-module.yaml calls the shared testthat-module workflow (Add testthat-module reusable workflow actions#44). 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.

Verified locally: testthat::test_dir("tests/testthat") passes (R 4.6.1, SpaDES.core 3.2.0, fireSenseUtils 0.2.3.9003). 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_0133867aFrmKtbhpNXasToP9

- .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 newModule() scaffolding (tests/testthat/test-template.R,
  tests/unitTests.R), which asserted nothing about this module.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133867aFrmKtbhpNXasToP9
@eliotmcintire
eliotmcintire merged commit 77e18b4 into development Sep 11, 2026
4 of 5 checks passed
@eliotmcintire
eliotmcintire deleted the feat/add-testthat-ci branch September 11, 2026 02:22
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