Canonicalize tests to @safetestset for module isolation#145
Closed
ChrisRackauckas-Claude wants to merge 1 commit into
Closed
Canonicalize tests to @safetestset for module isolation#145ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
Wrap each independent Core test unit in `@safetestset` so it runs in its own module, matching the canonical OrdinaryDiffEq structure (isolation between tests + world-age safety). "New Nodes Tests" and "Quality Assurance" were already `@safetestset`; this converts the remaining seven Core units (Tuple Nodes, Bisect Search Tests, Indexing and Creation Tests, Values Indexing, Get Indices Tests, Additional Fields Test, Dynamic DiffEq Tests, Single Layer DiffEq Tests) from `@testset` to `@safetestset`. The `@time` wrappers and the GROUP dispatch ladder are unchanged. Self-containment fixes required by per-module isolation: - bisect_search_tests.jl had no imports and relied on `using MultiScaleArrays` leaking from the runtests.jl `@eval using ...` into Main; added `using MultiScaleArrays, Test`. - values_indexing.jl and get_indices.jl referenced Cell/Population/Tissue/Embryo with their struct definitions commented out, relying on those types leaking from indexing_and_creation_tests.jl (run earlier in Main). Restored (uncommented) the identical struct definitions so each file is self-contained as its own module. All other included files already carried their own `using` blocks and struct definitions. Inner grouping `@testset`s inside a unit stay plain `@testset` (the unit-level `@safetestset` already isolates). Deps: bump SafeTestsets compat to "0.1, 1" in the main Project.toml and add SafeTestsets to test/qa/Project.toml ([deps] + [compat]). Behavior-preserving: same tests run under the same GROUP dispatch, same assertions. Verified locally on Julia 1.11: GROUP=Core passes (all units green, "Testing MultiScaleArrays tests passed"). Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Superseded by the v1.2 folder conversion on sciml-testing-rollout (#144). Closing. |
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
Wrap each independent Core test unit in
@safetestsetso it runs in its own module, matching the canonical OrdinaryDiffEq test structure (isolation between tests + world-age safety)."New Nodes Tests" and "Quality Assurance" were already
@safetestset. This converts the remaining Core units from@testsetto@safetestsetintest/runtests.jl:The
@timewrappers and theGROUPdispatch ladder are unchanged.Self-containment fixes required by per-module isolation
Under the old plain-
@testsetstructure,include()ran inMain, so some files relied on names leaking in from earlier-run files. With each unit now its own module, those files were made self-contained:bisect_search_tests.jlhad no imports and relied onusing MultiScaleArraysleaking from theruntests.jl@eval using ...intoMain. Addedusing MultiScaleArrays, Test.values_indexing.jlandget_indices.jlreferencedCell/Population/Tissue/Embryowith their struct definitions commented out, relying on those types leaking fromindexing_and_creation_tests.jl(run earlier inMain). Restored (uncommented) the identical struct definitions.All other included files already carried their own
usingblocks and struct definitions. Inner grouping@testsets inside a unit stay plain@testset(the unit-level@safetestsetalready isolates).Deps
SafeTestsetscompat to"0.1, 1"in the mainProject.toml.SafeTestsetstotest/qa/Project.toml([deps]+[compat]); the QA group activates its own env.Verification
Behavior-preserving: same tests run under the same GROUP dispatch, same assertions.
Verified locally on Julia 1.11,
GROUP=Core— all units pass:Indexing and Creation 133, Values Indexing 55, Get Indices 19, Dynamic DiffEq 3, Single Layer DiffEq 4, New Nodes 1; Additional Fields runs with no assertions (as on master); final "Testing MultiScaleArrays tests passed".
🤖 Generated with Claude Code
This PR is a draft. Ignore until reviewed by @ChrisRackauckas.