Skip to content

test: add missing using Test to runtests.jl (fixes @testset UndefVarError)#43

Closed
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-using-test
Closed

test: add missing using Test to runtests.jl (fixes @testset UndefVarError)#43
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-using-test

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Problem

test/runtests.jl opens with using Pkg but never imports Test. It then calls @testset/@test_throws at the top level (the "Invalid usage error path" block), so the test process dies with:

UndefVarError: `@testset` not defined

This is a test-harness scaffolding bug introduced by the grouped-tests conversion (the top-level @testset was added to runtests.jl itself, which unlike core.jl has no using Test). It breaks the Core, downgrade, and All-group CI.

Fix

Add the missing using Test immediately after using Pkg so Test is in scope before the top-level @testset. This is the minimal change — one import line. No test assertions or logic were touched. (core.jl already has its own using Test.)

Verification

Ran locally on Julia 1.11:

GROUP=Core julia +1.11 --project=. -e 'using Pkg; Pkg.test()'

Result — all groups pass, including the previously-failing top-level testset:

Test Summary: | Pass  Total  Time
Unit tests    |   23     23  1.7s
End-to-end tests |   11     11
Issue #3      |    1      1
Commutation with other Macros |    4      4
Invalid usage error path |    1      1   <-- was the @testset UndefVarError
     Testing ConcreteStructs tests passed

Ignore until reviewed by @ChrisRackauckas.

…rError)

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

Copy link
Copy Markdown
Member

Superseded by the SciMLTesting v1.2 migration (folder-based run_tests()). Master already carries this test as test/invalid_usage_tests.jl, and the missing-using Test issue no longer applies under run_tests(). Closing as already-fixed.

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