Skip to content

Conversation

@cgarling
Copy link
Member

@cgarling cgarling commented Nov 5, 2025

This should run the doctests as part of the test suite. I don't expect this to pass now because of printing / environment stuff that we probably need to be more careful about when writing the doctests.

@@ -0,0 +1,6 @@
# Need to load Spectra into Main to work with ParallelTestRunner
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the tip. I added the @eval approach to fix failures with Documenter.jl not recognizing the package module (see here). This problem only appeared when I switched to ParallelTestRunner so I may just be configuring something improperly. The errors are things like

│ ┌ Error: Failed to evaluate `CurrentModule = AstrochemicalYields` in `@meta` block.
│ │   exception =
│ │    UndefVarError: `AstrochemicalYields` not defined in `Main`
│ │    Suggestion: check for spelling errors or missing imports.
│ │    Hint: AstrochemicalYields is loaded but not imported in the active module Main.

I fixed this by explicitly importing the package into Main using @eval.

Looking at the code in Enzyme it's not clear to me why this error occurs in my project but not in Enzyme because Enzyme has a similar @meta block in their index.md file. Any tips would be appreciated

Copy link
Member

Choose a reason for hiding this comment

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

JuliaTesting/ParallelTestRunner.jl#68. It's not always necessary, but if the output depends on the exact module where the code is being evaluated, then something like that may be needed.

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.

3 participants