Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/ParallelTestRunner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,11 @@ function runtests(mod::Module, args::ParsedArgs;
# set-up
#


historical_durations, historical_failures = load_test_history(mod, history_key)

# list tests, if requested
if args.list !== nothing
historical_durations, historical_failures = load_test_history(mod, history_key)
sorted_tests = sort(collect(keys(testsuite)))
name_align = isempty(sorted_tests) ? 0 : maximum(textwidth, sorted_tests)
duration_strs = Dict(
Expand All @@ -270,13 +272,21 @@ function runtests(mod::Module, args::ParsedArgs;
# filter tests
filter_tests!(testsuite, args)

# remove tests that previously passed
if args.skippassed !== nothing
for test in keys(testsuite)
if test in keys(historical_durations) && test ∉ historical_failures
delete!(testsuite, test)
end
end
end

# filter serial list to only include tests that survived filtering
serial = filter(t -> haskey(testsuite, t), serial)

# determine test order
tests = collect(keys(testsuite))
Random.shuffle!(tests)
historical_durations, historical_failures = load_test_history(mod, history_key)
get_historical_duration(test) = TestHistoryEntry(get(historical_durations, test, Inf), test in historical_failures)
sort!(tests, by = x -> get_historical_duration(x), rev = true)

Expand Down
4 changes: 3 additions & 1 deletion src/args.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ struct ParsedArgs
verbose::Union{Some{Nothing}, Nothing}
quickfail::Union{Some{Nothing}, Nothing}
list::Union{Some{Nothing}, Nothing}
skippassed::Union{Some{Nothing}, Nothing}

custom::Dict{String,Any}

Expand Down Expand Up @@ -145,6 +146,7 @@ function parse_args(args; custom::Array{String} = String[])
verbose = extract_flag!(args, "--verbose")
quickfail = extract_flag!(args, "--quickfail")
list = extract_flag!(args, "--list")
skippassed = extract_flag!(args, "--skippassed") # Experimental

# boolean flags don't take values
for (flag, val) in (("--verbose", verbose), ("--quickfail", quickfail), ("--list", list))
Expand All @@ -164,7 +166,7 @@ function parse_args(args; custom::Array{String} = String[])
error("Unknown test options `$(join(optlike_args, " "))` (try `--help` for usage instructions)")
end

return ParsedArgs(jobs, verbose, quickfail, list, custom_args, args)
return ParsedArgs(jobs, verbose, quickfail, list, skippassed, custom_args, args)
end

"""
Expand Down
Loading