Canonicalize test units with @safetestset - #164
Closed
ChrisRackauckas-Claude wants to merge 1 commit into
Closed
Conversation
Wrap each independent test unit in test/runtests.jl in `@safetestset
"name" begin include("x.jl") end` so every unit runs in its own fresh
module (isolation between tests + world-age safety), matching the
canonical OrdinaryDiffEq structure. Each included file already carries
its own `using`/`import` lines, so the bodies are self-contained.
The GROUP dispatch ladder, QA group, and all assertions are unchanged;
only the Core include() calls are wrapped.
Adds SafeTestsets to the test deps ([extras]/[targets].test + compat).
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
|
Superseded by the v1.2 folder conversion on |
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.
What
Wraps each independent Core test unit in
test/runtests.jlin@safetestset "name" begin include("x.jl") endso every unit runs in its own fresh module — isolation between tests and world-age safety, matching the canonical OrdinaryDiffEq structure.Before each unit was
include("x.jl"), which ran every file into the sharedMainmodule (so files silently shared/leaked imports and global names). Each included file already carries its ownusing/importlines at the top, so the bodies are already self-contained; this PR just wraps theinclude()calls.Behavior preserved
qa.jl, a flatAqua.test_*sequence in its own activated env) are unchanged.SafeTestsetsto the test deps ([extras]/[targets].test+[compat] SafeTestsets = "0.1, 1").Verification
Verified locally with Julia 1.11:
GROUP=Core julia --project Pkg.test()— all 16@safetestsetunits pass (Types 3427, Polynomial Chaos 4950, Scalar Products 810, Evaluate 164, etc.). No package-macro gotchas: the StaticArrays usages are theSVector(...)constructor (a function call), not the@SVectormacro, so they expand correctly inside the safetestset modules.Ignore until reviewed by @ChrisRackauckas.
🤖 Generated with Claude Code