Skip to content

Conversation

@FBartos
Copy link
Contributor

@FBartos FBartos commented Feb 8, 2026

Add includeExamples parameter (default TRUE) to testAnalysis and propagate it to getTestFilesMatchingName. Extend getTestFilesMatchingName to also scan test-example-*.R files for runAnalysis("Name") calls and include those matches, while preserving existing filename matches. Update error messaging and documentation (man/testAnalysis.Rd) and add details about the new option so callers can opt out by setting includeExamples = FALSE.

Add includeExamples parameter (default TRUE) to testAnalysis and propagate it to getTestFilesMatchingName. Extend getTestFilesMatchingName to also scan test-example-*.R files for runAnalysis("Name") calls and include those matches, while preserving existing filename matches. Update error messaging and documentation (man/testAnalysis.Rd) and add details about the new option so callers can opt out by setting includeExamples = FALSE.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates testAnalysis() so it can optionally include auto-generated example-based tests when running a single analysis’ tests, aligning testAnalysis() behavior with tests produced by makeTestsFromExamples().

Changes:

  • Add includeExamples parameter (default TRUE) to testAnalysis() and pass it through to getTestFilesMatchingName().
  • Extend getTestFilesMatchingName() to include test-example-*.R files that contain runAnalysis("AnalysisName", ...) calls.
  • Update roxygen/Rd documentation to describe the new behavior and opt-out mechanism.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
R/test.R Adds includeExamples parameter and implements example-test discovery by scanning test-example-*.R contents for runAnalysis("Name").
man/testAnalysis.Rd Documents the new includeExamples option and clarifies that example-generated tests can be included by default.

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