Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[deps]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DustExtinction = "fb44c06c-c62f-5397-83f5-69249e0a3c8e"
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc"
Expand Down
6 changes: 6 additions & 0 deletions test/doctests.jl
Original file line number Diff line number Diff line change
@@ -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.

@eval Main using Spectra
using Documenter: DocMeta, doctest

DocMeta.setdocmeta!(Main.Spectra, :DocTestSetup, :(using Spectra); recursive=true)
doctest(Main.Spectra)
Loading