test: add a testthat suite and CI - #14
Merged
Merged
Conversation
- .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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a testthat suite and CI to this module, as piloted on PredictiveEcology/fireSense_EscapeFit#4.
What's added
.github/workflows/testthat-module.yamlcalls the sharedtestthat-moduleworkflow (Add testthat-module reusable workflow actions#44). It installs the module'sreqdPkgs, converts the module into a package in a throwaway directory withconvertToPackage(destinationPath = ), runstests/testthat, and writes coverage to the job summary. Nothing is committed back.tests/testthat/setup.Ris actions'examples/module-tests-setup.R: options,moduleName/modulePath, and a temporary directory tree.tests/testthat/test-metadata.Rasserts 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.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'stestthat-modulerun is the check on the package-conversion path.🤖 Generated with Claude Code
https://claude.ai/code/session_0133867aFrmKtbhpNXasToP9