diff --git a/test_harness.jl b/test_harness.jl index 43e9c14..5644b6a 100644 --- a/test_harness.jl +++ b/test_harness.jl @@ -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