test: add a testthat suite and CI - #114
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 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
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 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.yamlcalls the sharedtestthat-moduleworkflow. 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.tests/testthat/setup.Rwas already the shared template;test-dataYear.Randtest-estimateCoverModel.Rare 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'stestthat-modulerun is the check on the package-conversion path.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xc7e6r283jgq5aJq1xC1zm