Skip to content

Commit 934912f

Browse files
Default to failures_first=true (#231)
* Default to `failures_first=true` * Reset status in some tests * Update README * Bump version
1 parent 0f3d119 commit 934912f

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ReTestItems"
22
uuid = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
3-
version = "1.34.1"
3+
version = "1.35.0"
44

55
[deps]
66
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ If you want individual test-items to stop on their first test failure, but not s
132132

133133
#### Running previous failures first
134134

135-
You can set `runtests` to run first any test-items that failed the last time they were run by passing `failures_first=true`.
135+
By default `runtests` uses `failures_first=true` to run first any test-items that failed the last time they were run.
136+
This became the default in v1.35.0.
137+
136138
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.
137139

138140
This option can be combined with `failfast=true` to efficiently find the next failing test-item during development.

src/ReTestItems.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ will be run.
259259
Defaults to the value passed to the `failfast` keyword.
260260
If a `@testitem` sets its own `failfast` keyword, then that takes precedence.
261261
Note that the `testitem_failfast` keyword only takes effect in Julia v1.9+ and is ignored in earlier Julia versions.
262-
- `failures_first::Bool=false`: if `true`, first runs test items that failed the last time
262+
- `failures_first::Bool=true`: if `true`, first runs test items that failed the last time
263263
they ran, followed by new test items, followed by test items that passed the last time they ran.
264264
Can also be set using the `RETESTITEMS_FAILURES_FIRST` environment variable.
265265
"""
@@ -316,7 +316,7 @@ function runtests(
316316
gc_between_testitems::Bool=parse(Bool, get(ENV, "RETESTITEMS_GC_BETWEEN_TESTITEMS", string(nworkers > 1))),
317317
failfast::Bool=parse(Bool, get(ENV, "RETESTITEMS_FAILFAST", "false")),
318318
testitem_failfast::Bool=parse(Bool, get(ENV, "RETESTITEMS_TESTITEM_FAILFAST", string(failfast))),
319-
failures_first::Bool=parse(Bool, get(ENV, "RETESTITEMS_FAILURES_FIRST", "false")),
319+
failures_first::Bool=parse(Bool, get(ENV, "RETESTITEMS_FAILURES_FIRST", "true")),
320320
)
321321
nworker_threads = _validated_nworker_threads(nworker_threads)
322322
paths′ = _validated_paths(paths, validate_paths)

test/integrationtests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,7 @@ end
12381238
end
12391239

12401240
@testset "logs are aligned" begin
1241+
ReTestItems.reset_test_status!()
12411242
file = joinpath(TEST_FILES_DIR, "_skip_tests.jl")
12421243
c1 = IOCapture.capture() do
12431244
encased_testset(()->runtests(file))
@@ -1316,6 +1317,7 @@ end
13161317
@test_skip case
13171318
continue
13181319
end
1320+
ReTestItems.reset_test_status!()
13191321
c = IOCapture.capture() do
13201322
encased_testset(() -> runtests(fullpath; nworkers, testitem_timeout, retries=1, failfast=true))
13211323
end

0 commit comments

Comments
 (0)