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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ReTestItems"
uuid = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
version = "1.31.0"
version = "1.32.0"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
12 changes: 8 additions & 4 deletions src/ReTestItems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,17 @@ function _runtests_in_current_env(
inc_time = time()
@debugv 1 "Including tests in $paths"
testitems, _ = include_testfiles!(proj_name, projectfile, paths, ti_filter, cfg.verbose_results, cfg.report)
@debugv 1 "Done including tests in $paths"
nworkers = cfg.nworkers
nworker_threads = cfg.nworker_threads
ntestitems = length(testitems.testitems)
@debugv 1 "Done including tests in $paths"
@info "Finished scanning for test items in $(round(time() - inc_time, digits=2)) seconds." *
" Scheduling $ntestitems tests on pid $(Libc.getpid())" *
(nworkers == 0 ? "" : " with $nworkers worker processes and $nworker_threads threads per worker.")
@info "Finished scanning for test items in $(round(time() - inc_time, digits=2)) seconds."
if ntestitems == 0
@warn "No test items found."
else
@info "Scheduling $ntestitems tests on pid $(Libc.getpid())" *
(nworkers == 0 ? "" : " with $nworkers worker processes and $nworker_threads threads per worker.")
end
try
if nworkers == 0
length(cfg.worker_init_expr.args) > 0 && error("worker_init_expr is set, but will not run because number of workers is 0.")
Expand Down
16 changes: 16 additions & 0 deletions test/integrationtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1547,4 +1547,20 @@ end
@test_throws "`test_end_expr` must be a `:block` expression" runtests(; test_end_expr=:(@assert false))
end

@testset "warn if no test items" begin
msg = "No test items found."
@test_logs (:warn, msg) match_mode=:any begin
runtests(joinpath(TEST_FILES_DIR, "_empty_file_test.jl"))
end
@test_logs (:warn, msg) match_mode=:any begin
runtests(joinpath(TEST_FILES_DIR, "_empty_file_test.jl"); nworkers=1)
end
@test_logs (:warn, msg) match_mode=:any begin
runtests(joinpath(TEST_FILES_DIR, "_happy_tests.jl"); name="blahahahaha_nope")
end
@test_logs (:warn, msg) match_mode=:any begin
runtests(joinpath(TEST_FILES_DIR, "_happy_tests.jl"); tags=[:blahahahaha_nope])
end
end

end # integrationtests.jl testset
Loading