Skip to content

Commit fb8ddef

Browse files
Allow setting the logs argument via the environment (#111)
* Allow setting the `logs` argument via the environment With `RETESTITEMS_LOGS` set to the appropriate string ("batched", "eager" or "issues"). * Bump version * Update Project.toml --------- Co-authored-by: Nick Robinson <[email protected]>
1 parent ea52cd5 commit fb8ddef

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Project.toml

+1-1
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.18.0"
3+
version = "1.19.0"
44

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

src/ReTestItems.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ function runtests(
203203
name::Union{Regex,AbstractString,Nothing}=nothing,
204204
tags::Union{Symbol,AbstractVector{Symbol},Nothing}=nothing,
205205
report::Bool=parse(Bool, get(ENV, "RETESTITEMS_REPORT", "false")),
206-
logs::Symbol=default_log_display_mode(report, nworkers),
206+
logs::Symbol=Symbol(get(ENV, "RETESTITEMS_LOGS", default_log_display_mode(report, nworkers))),
207207
verbose_results::Bool=(logs !== :issues && isinteractive()),
208208
test_end_expr::Expr=Expr(:block),
209209
)

test/_test_log_capture.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file defines tests that are run (under various configurations) by `test/log_capture.jl`.
22
using ReTestItems, Test, Logging, IOCapture
3-
const log_display = Symbol(ENV["LOG_DISPLAY"])
3+
const log_display = Symbol(ENV["RETESTITEMS_LOGS"])
44

55
@testset "log capture logs=$(repr(log_display))" begin
66
@testset "TestItem" begin

test/log_capture.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ using Test
1010

1111
@testset "$log_display" for log_display in (:eager, :batched, :issues)
1212
# Need to run in a separate process to force --color=yes in CI.
13-
cmd = addenv(`$(Base.julia_cmd()) --project=$PROJECT_PATH --color=yes $LOG_CAPTURE_TESTS_PATH`, "LOG_DISPLAY" => log_display)
13+
cmd = addenv(`$(Base.julia_cmd()) --project=$PROJECT_PATH --color=yes $LOG_CAPTURE_TESTS_PATH`, "RETESTITEMS_LOGS" => log_display)
1414
p = run(pipeline(ignorestatus(cmd); stdout, stderr), wait=false)
1515
wait(p)
1616
@test success(p)

0 commit comments

Comments
 (0)