-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started as a small tweak `leaves` -> `BenchmarkTools.leaves` (symbol no longer exported) Then CI wouldn't pass and now we're here. On the plus side, the new system: - use ReTestItems - Actually creates a fake Example project - more or less cleans up after it's self
- Loading branch information
Showing
14 changed files
with
407 additions
and
443 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
@testitem "compat" setup=[ExamplePkg] begin | ||
using Test | ||
using JSON | ||
using PkgJogger | ||
using CodecZlib | ||
using BenchmarkTools | ||
using Dates | ||
|
||
# Get Benchmarking results | ||
jogger, cleanup = ExamplePkg.create_jogger() | ||
b = jogger.benchmark() | ||
|
||
# Save using JSON | ||
function save_benchmarks(filename, results::BenchmarkTools.BenchmarkGroup) | ||
# Collect system information to save | ||
mkpath(dirname(filename)) | ||
out = Dict( | ||
"julia" => PkgJogger.julia_info(), | ||
"system" => PkgJogger.system_info(), | ||
"datetime" => string(Dates.now()), | ||
"benchmarks" => results, | ||
"git" => PkgJogger.git_info(filename), | ||
) | ||
|
||
# Write benchmark to disk | ||
open(GzipCompressorStream, filename, "w") do io | ||
JSON.print(io, out) | ||
end | ||
end | ||
|
||
@testset "Compat *.json.gz" begin | ||
f = tempname(; cleanup=false) * ".json.gz" | ||
finalizer(rm, f) | ||
save_benchmarks(f, b) | ||
|
||
# Check that the deprecated warming is logged | ||
local b2 | ||
b2 = @test_logs (:warn, r"Legacy `\*\.json\.gz` format is deprecated.*") begin | ||
jogger.load_benchmarks(f) | ||
end | ||
|
||
# Check that benchmarks are still there | ||
@test b2 isa Dict | ||
@test haskey(b2, "benchmarks") | ||
@test b2["benchmarks"] isa BenchmarkTools.BenchmarkGroup | ||
end | ||
|
||
cleanup() | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@testitem "ci" setup=[ExamplePkg] begin | ||
pkgjogger_env = Base.active_project() | ||
jogger, cleanup = ExamplePkg.create_jogger() | ||
dir = abspath(joinpath(jogger.BENCHMARK_DIR, "..")) | ||
env = copy(ENV) | ||
env["JULIA_LOAD_PATH"] = join(["@", "@stdlib", pkgjogger_env], Sys.iswindows() ? ";" : ":") | ||
cmd = Cmd(`$(Base.julia_cmd()) --startup-file=no -e 'using PkgJogger; PkgJogger.ci()'`; env, dir) | ||
p = run(cmd; wait=true) | ||
@test success(p) | ||
cleanup() | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.