Skip to content

Canonicalize QA group to @safetestset#102

Closed
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:canonicalize-safetestset
Closed

Canonicalize QA group to @safetestset#102
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:canonicalize-safetestset

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

What

Canonicalizes the test suite toward the standard SciML/OrdinaryDiffEq structure where each independent unit runs in its own module via @safetestset (isolation + world-age safety).

Changes

  • QA group: @testset "JET static analysis"@safetestset "JET static analysis" begin include("jet_tests.jl") end. The body was extracted into the new test/jet_tests.jl. The include() form is required (not an inline @safetestset body) because the body uses the JET @test_opt macro and StaticArrays' @SVector macro, which must resolve after their using lines run — include evaluates statements sequentially, whereas an inline @safetestset body macroexpands the whole block before the in-body usings take effect.
  • SafeTestsets added to test/qa/Project.toml (the QA group activates its own environment).

Already canonical / intentionally unchanged

  • regression.jl and reinit.jl are already wrapped in @safetestset in runtests.jl.
  • The backend-parameterized units (gpu.jl, constraints.jl, lbfgs.jl) run inside the @testset for BACKEND in unique(("CPU", CI_GROUP)) dispatch loop. They are left unchanged because:
    1. their testset name is a dynamic interpolated string ("$(BACKEND) optimizers tests"), and @safetestset only accepts a literal String (it throws ArgumentError otherwise); and
    2. they depend on the loop-set GROUP/backend globals (via utils.jl), which a fresh @safetestset module cannot see.
      Converting them would require restructuring the GROUP/backend dispatch loop, which is out of scope for this behavior-preserving change.

Verification

Ran the QA group locally on Julia 1.11:

Test Summary:       | Pass  Total   Time
JET static analysis |    5      5  27.7s

Exit code 0. No assertions or test logic changed.

Ignore until reviewed by @ChrisRackauckas.

🤖 Generated with Claude Code

Convert the QA group's `@testset "JET static analysis"` unit to
`@safetestset` so it runs in its own isolated module, matching the
canonical OrdinaryDiffEq structure. The testset body is extracted into
a new `test/jet_tests.jl` and loaded via `@safetestset "..." begin
include("jet_tests.jl") end`; the include() form is required because the
body uses the JET `@test_opt` macro and the StaticArrays `@SVector`
macro, which must be resolved after their `using` lines run (include
evaluates statements sequentially, whereas an inline @safetestset body
would macroexpand before the in-body `using`s take effect).

The two backend-independent units (Regression, Reinitialization tests)
already use @safetestset. The backend-parameterized units (gpu/
constraints/lbfgs) are left unchanged: they run inside a
`@testset for BACKEND in ...` dispatch loop with a dynamic interpolated
name (which @safetestset rejects — it requires a literal String) and
depend on the loop-set `GROUP`/`backend` globals, so they cannot be
wrapped in @safetestset without restructuring the GROUP dispatch.

SafeTestsets added to test/qa/Project.toml (the QA group activates its
own env). No assertions or test logic changed.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor Author

Superseded by the v1.2 folder conversion on sciml-testing-rollout (#101). The QA @safetestset canonicalization from this branch is incorporated there (test/qa/qa.jl + test/qa/jet_tests.jl). Closing as duplicate.

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.

2 participants