From 11af540831bd31517d01fff5d7cc7c19813375ab Mon Sep 17 00:00:00 2001 From: John Cobbler <44442232+JohnCobbler@users.noreply.github.com> Date: Sat, 6 Jun 2026 01:17:37 +0000 Subject: [PATCH 1/3] Record a failing @test_logs as a failure instead of erroring A failing @test_logs produces a Test.LogTestFailure, which is not a Fail/Error/Broken, so ReTestSet has no record method for it and the failure throws a MethodError instead of being reported. Convert it to a Fail in record, as Test.DefaultTestSet does, so it is counted and printed like any other failure. --- src/testset.jl | 3 +++ test/runtests.jl | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/src/testset.jl b/src/testset.jl index a0de8bd..6478e83 100644 --- a/src/testset.jl +++ b/src/testset.jl @@ -93,6 +93,9 @@ ReTestSet(desc::String; verbose::Bool=false) = # For a non-passed result, simply store the result record(ts::ReTestSet, t::Union{Broken,Fail,Error}) = (push!(ts.results, t); t) +# Convert a `LogTestFailure` to `Fail` like `Test.DefaultTestSet` +record(ts::ReTestSet, t::Test.LogTestFailure) = + (push!(ts.results, Fail(:test, t.orig_expr, t.logs, nothing, nothing, t.source, false)); t) # For a passed result, do not store the result since it uses a lot of memory record(ts::ReTestSet, t::Pass) = (ts.n_passed += 1; t) diff --git a/test/runtests.jl b/test/runtests.jl index 2f65ca7..23a5e1e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1280,6 +1280,20 @@ end # Failing """) end +module FailingTestLogs +using ReTest +using Test: @test_logs + +@testset "logs fail" begin + # pattern expects "x", actual log is "y" → LogTestFailure + @test_logs (:info, "x") @info "y" +end +end # FailingTestLogs + +@chapter FailingTestLogs begin + @test_throws Test.TestSetException retest(FailingTestLogs) +end + module FailingLoops # we test that toplevel testset-for don't make retest unresponsive @@ -1883,3 +1897,28 @@ end end @test Hijack.RUN == [1, 2, 3, 2, 3] end + +Test.@testset "record(::ReTestSet, ::LogTestFailure)" begin + ReTestSet = ReTest.Testset.ReTestSet + record = ReTest.Testset.record + anyfailed = ReTest.Testset.anyfailed + get_test_counts = ReTest.Testset.get_test_counts + + logfail = Test.LogTestFailure(:(@info "x"), LineNumberNode(1, :file), + Any[(:info, "x")], Any[]) + + # A failing `@test_logs` is recordable, and counts as a failure. + ts = ReTestSet(Main, "lt") + @test record(ts, logfail) === logfail + @test anyfailed(ts) + _, fails, errors, _ = get_test_counts(ts) + @test fails == 1 + @test errors == 0 + + # A testset with no failing result reports none. + ts2 = ReTestSet(Main, "lt_empty") + @test !anyfailed(ts2) + _, fails2, errors2, _ = get_test_counts(ts2) + @test fails2 == 0 + @test errors2 == 0 +end From ded967faa785180c60d880a8ec9d8ebe864f9668 Mon Sep 17 00:00:00 2001 From: JamesWrigley Date: Fri, 11 Sep 2026 23:07:10 +0200 Subject: [PATCH 2/3] Fix Revise call in the tests --- test/runtests.jl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 23a5e1e..6660fd0 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1820,8 +1820,18 @@ end replace(content, "load_path_function() = 1" => "load_path_function() = 2") end - Revise.revise() try + # Queue the tracked files explicitly, as Revise.revise() only processes changes + # that its file watcher task has already picked up, which is racy. + # Revise.revise(mod) can't be used since it looks up PkgId(mod), i.e. "Main". + @lock Revise.revise_lock for (id, pkgdata) in Revise.pkgdatas + if id.uuid === nothing && startswith(id.name, "Main.") + for file in pkgdata.info.files + push!(Revise.revision_queue, (pkgdata, file)) + end + end + end + Revise.revise() Test.@testset "revise works" begin retest(HijackTests2) @test Hijack.RUN == [2, 5, 4] From 75046bd6337c248e908f354935f89bd7136a552b Mon Sep 17 00:00:00 2001 From: JamesWrigley Date: Fri, 11 Sep 2026 23:07:43 +0200 Subject: [PATCH 3/3] Bump version and update CI --- .github/dependabot.yml | 15 +++++++++++++++ .github/workflows/CI.yml | 8 ++++---- Project.toml | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e6109a3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +version: 2 +enable-beta-ecosystems: true +updates: + - package-ecosystem: "julia" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + groups: + actions: + patterns: + - "*" diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 335dbde..5672a7d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -20,10 +20,10 @@ jobs: matrix: include: - { os: ubuntu-latest, version: 'nightly', arch: x64} - - { os: ubuntu-latest, version: '1.13.0-rc1', arch: x64 } - - { os: ubuntu-latest, version: '1.13.0-rc1', arch: x86 } - - { os: windows-latest, version: '1.13.0-rc1', arch: x64} - - { os: macOS-latest, version: '1.13.0-rc1', arch: aarch64} + - { os: ubuntu-latest, version: '1.13', arch: x64 } + - { os: ubuntu-latest, version: '1.13', arch: x86 } + - { os: windows-latest, version: '1.13', arch: x64} + - { os: macOS-latest, version: '1.13', arch: aarch64} steps: - uses: actions/checkout@v4 diff --git a/Project.toml b/Project.toml index 1203427..da389a1 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ReTest" uuid = "e0db7c4e-2690-44b9-bad6-7687da720f89" -version = "0.4.0" +version = "0.4.1" authors = ["Rafael Fourquet "] [deps]