Skip to content

Commit

Permalink
add a reproducer header
Browse files Browse the repository at this point in the history
Co-Authored-By: Sukera <[email protected]>
  • Loading branch information
IanButterworth and Seelengrab committed Oct 18, 2024
1 parent 53f7ca9 commit 960deee
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test_harness.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,30 @@ kwargs = Kwargs.kwargs(; coverage=ENV["COVERAGE"],
string("--compiled-modules=", ENV["COMPILED_MODULES"])],
test_args=ENV["TEST_ARGS"],
)
commit_info = ""
try
global commit_info
using LibGit2
repo = LibGit2.GitRepo(pwd())
commit = LibGit2.head(repo)
commit_sha = LibGit2.GitHash(commit)
commit_info = "commit $commit_sha of "
catch e
@info "Could not determine commit of repo in current directory" exception=(e, catch_backtrace())
end

kwargs_reprs = map(kv -> string(kv[1], "=", repr(kv[2])), collect(kwargs))
kwargs_repr = join(kwargs_reprs, ", ")

print("""
│ To reproduce this CI run locally, check out $(commit_info)this repo and
│ run the following in the environment on julia version $VERSION:
│ import Pkg
│ Pkg.test(;$kwargs_repr)
""")

if parse(Bool, ENV["ANNOTATE"]) && v"1.8pre" < VERSION < v"1.9.0-beta3"
push!(LOAD_PATH, "@tests-logger-env") # access dependencies
Expand Down

0 comments on commit 960deee

Please sign in to comment.