Skip to content

Make reused-tarball tests work on Julia 1.7 - #1460

Merged
eschnett merged 2 commits into
JuliaPackaging:masterfrom
eschnett:eschnett/test-throws-julia17
Oct 20, 2026
Merged

eschnett merged 2 commits into
JuliaPackaging:masterfrom
eschnett:eschnett/test-throws-julia17

Conversation

@eschnett

@eschnett eschnett commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

It turns out we are running CI still with Julia 1.7. This makes tests fail. The approach here is a band-aid to make them work. Another solution would be to update CI to run on Julia 1.10.

The Azure CI (Julia 1.7) has failed on master since #1455: JLLs - reused tarballs reports 8 passed, 5 failed. The failures are the five @test_throws r"..." checks. @test_throws accepts a message pattern only since Julia 1.8; on 1.7 the regex is compared to the exception itself, so the checks fail even though the messages match. One of them (No usable build metadata) also gets an error wrapped in a CompositeException, which 1.8+ unwraps.

This adds a small @test_throws_msg pattern expr helper to test/jll.jl, which matches the pattern against sprint(showerror, err), and uses it for those five checks.

Tested: JLLs - reused tarballs passes on Julia 1.13 (13/13). On Julia 1.7.2 the helper passes for a matching plain error and a matching error wrapped by asyncmap, and fails when nothing is thrown or the message doesn't match.

@test_throws accepts a message pattern only since Julia v1.8, so on the
Julia 1.7 CI the five checks in "JLLs - reused tarballs" compared the
regex to the exception and failed although the message matched. Add a
small @test_throws_msg helper that matches the pattern against the
printed error, which also covers the error wrapped in a
CompositeException.
@eschnett
eschnett marked this pull request as ready for review October 19, 2026 23:44
@eschnett
eschnett requested a review from maleadt October 19, 2026 23:44

@maleadt maleadt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Small nit on the test macro.

Comment thread test/jll.jl Resolved
Co-authored-by: Tim Besard <tim.besard@gmail.com>
@eschnett
eschnett merged commit d2b11c2 into JuliaPackaging:master Oct 20, 2026
0 of 3 checks passed
@eschnett
eschnett deleted the eschnett/test-throws-julia17 branch October 20, 2026 17:19
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