Skip to content

Commit

Permalink
Use a temporary environment to perform the BugReporting post-processi…
Browse files Browse the repository at this point in the history
…ng in.
  • Loading branch information
maleadt committed Jul 22, 2022
1 parent a382b8d commit 3a9844f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/run.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
Expand Down

0 comments on commit 3a9844f

Please sign in to comment.