diff --git a/Project.toml b/Project.toml index 957e1ef..0f8517b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ReTestItems" uuid = "817f1d60-ba6b-4fd5-9520-3cf149f6a823" -version = "1.34.1" +version = "1.35.0" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" diff --git a/README.md b/README.md index 2fcb144..1014d3e 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,9 @@ If you want individual test-items to stop on their first test failure, but not s #### Running previous failures first -You can set `runtests` to run first any test-items that failed the last time they were run by passing `failures_first=true`. +By default `runtests` uses `failures_first=true` to run first any test-items that failed the last time they were run. +This became the default in v1.35.0. + When `failures_first=true` is set, test-items are order so that previously failing test-items run first, followed by previously unseen test-items, followed by previously passing test-items. This option can be combined with `failfast=true` to efficiently find the next failing test-item during development. diff --git a/src/ReTestItems.jl b/src/ReTestItems.jl index c278448..ee0c121 100644 --- a/src/ReTestItems.jl +++ b/src/ReTestItems.jl @@ -259,7 +259,7 @@ will be run. Defaults to the value passed to the `failfast` keyword. If a `@testitem` sets its own `failfast` keyword, then that takes precedence. Note that the `testitem_failfast` keyword only takes effect in Julia v1.9+ and is ignored in earlier Julia versions. -- `failures_first::Bool=false`: if `true`, first runs test items that failed the last time +- `failures_first::Bool=true`: if `true`, first runs test items that failed the last time they ran, followed by new test items, followed by test items that passed the last time they ran. Can also be set using the `RETESTITEMS_FAILURES_FIRST` environment variable. """ @@ -316,7 +316,7 @@ function runtests( gc_between_testitems::Bool=parse(Bool, get(ENV, "RETESTITEMS_GC_BETWEEN_TESTITEMS", string(nworkers > 1))), failfast::Bool=parse(Bool, get(ENV, "RETESTITEMS_FAILFAST", "false")), testitem_failfast::Bool=parse(Bool, get(ENV, "RETESTITEMS_TESTITEM_FAILFAST", string(failfast))), - failures_first::Bool=parse(Bool, get(ENV, "RETESTITEMS_FAILURES_FIRST", "false")), + failures_first::Bool=parse(Bool, get(ENV, "RETESTITEMS_FAILURES_FIRST", "true")), ) nworker_threads = _validated_nworker_threads(nworker_threads) paths′ = _validated_paths(paths, validate_paths) diff --git a/test/integrationtests.jl b/test/integrationtests.jl index 2265196..a5ff91e 100644 --- a/test/integrationtests.jl +++ b/test/integrationtests.jl @@ -1238,6 +1238,7 @@ end end @testset "logs are aligned" begin + ReTestItems.reset_test_status!() file = joinpath(TEST_FILES_DIR, "_skip_tests.jl") c1 = IOCapture.capture() do encased_testset(()->runtests(file)) @@ -1316,6 +1317,7 @@ end @test_skip case continue end + ReTestItems.reset_test_status!() c = IOCapture.capture() do encased_testset(() -> runtests(fullpath; nworkers, testitem_timeout, retries=1, failfast=true)) end