From 3a9844f47766a7d6550a2ec73bfdfe71cf2a985b Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Fri, 22 Jul 2022 20:35:43 +0200 Subject: [PATCH] Use a temporary environment to perform the BugReporting post-processing in. --- src/run.jl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/run.jl b/src/run.jl index a8e695bd..1c9ef899 100644 --- a/src/run.jl +++ b/src/run.jl @@ -344,11 +344,7 @@ function run_sandboxed_test(install::String, pkg; do_depwarns=false, rr=false, k using Pkg - if haskey(ENV, "_RR_TRACE_DIR") - Pkg.add([ARGS[1], "BugReporting"]) - else - Pkg.add(ARGS[1]) - end + Pkg.add(ARGS[1]) print("\n\n", '#'^80, "\n# Testing: $(now())\n#\n\n") @@ -368,11 +364,18 @@ function run_sandboxed_test(install::String, pkg; do_depwarns=false, rr=false, k println() if haskey(ENV, "_RR_TRACE_DIR") - # pack-up our rr trace. this is expensive, so we only do it for failures + print("\n\n", '#'^80, "\n# BugReporting post-processing: $(now())\n#\n\n") + + # pack-up our rr trace. this is expensive, so we only do it for failures. + # it also needs to happen in a clean environment, or BugReporting's deps + # could affect/be affected by the tested package's dependencies. + Pkg.activate(; temp=true) + Pkg.add("BugReporting") try using BugReporting trace_dir = BugReporting.find_latest_trace("/traces") BugReporting.compress_trace(trace_dir, "/traces/$(ARGS[1]).tar.zst") + println("\nBugReporting succeeded") catch err print("\nBugReporting failed: ") showerror(stdout, err)