fix undefined is_ci
This commit is contained in:
parent
0a929d6022
commit
ddc89e54f1
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
||||
|
||||
name: Julia ${{ matrix.version }} - ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
continue-on-error: ${{ matrix.version == 'nightly' || (matrix.version == '1.3' && matrix.os == 'windows-latest')}}
|
||||
continue-on-error: ${{ matrix.version == 'nightly' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
@ -16,14 +16,21 @@ function fix_rand!(ex)
|
||||
pushfirst!(ex.args[1].args, :(rng = StableRNG(1234)))
|
||||
end
|
||||
|
||||
function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, popup = !is_ci(), sigma = [1,1], tol = 1e-2)
|
||||
function image_comparison_tests(
|
||||
pkg::Symbol,
|
||||
idx::Int;
|
||||
debug = false,
|
||||
popup = !is_ci(),
|
||||
sigma = [1, 1],
|
||||
tol = 1e-2,
|
||||
)
|
||||
Plots._debugMode.on = debug
|
||||
example = Plots._examples[idx]
|
||||
Plots.theme(:default)
|
||||
@info("Testing plot: $pkg:$idx:$(example.header)")
|
||||
backend(pkg)
|
||||
backend()
|
||||
default(size=(500,300))
|
||||
default(size = (500, 300))
|
||||
|
||||
fn = "ref$idx.png"
|
||||
reffn = reference_file(pkg, idx, _current_plots_version)
|
||||
@ -40,19 +47,22 @@ function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, popup = !i
|
||||
|
||||
# the test
|
||||
vtest = VisualTest(func, reffn, idx)
|
||||
test_images(vtest, popup=popup, sigma=sigma, tol=tol, newfn = newfn)
|
||||
test_images(vtest, popup = popup, sigma = sigma, tol = tol, newfn = newfn)
|
||||
end
|
||||
|
||||
function image_comparison_facts(pkg::Symbol;
|
||||
function image_comparison_facts(
|
||||
pkg::Symbol;
|
||||
skip = [], # skip these examples (int index)
|
||||
only = nothing, # limit to these examples (int index)
|
||||
debug = false, # print debug information?
|
||||
sigma = [1,1], # number of pixels to "blur"
|
||||
tol = 1e-2) # acceptable error (percent)
|
||||
for i in 1:length(Plots._examples)
|
||||
sigma = [1, 1], # number of pixels to "blur"
|
||||
tol = 1e-2,
|
||||
) # acceptable error (percent)
|
||||
for i = 1:length(Plots._examples)
|
||||
i in skip && continue
|
||||
if only === nothing || i in only
|
||||
@test image_comparison_tests(pkg, i, debug=debug, sigma=sigma, tol=tol) |> success == true
|
||||
@test image_comparison_tests(pkg, i, debug = debug, sigma = sigma, tol = tol) |>
|
||||
success == true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -44,8 +44,8 @@ include("imgcomp.jl")
|
||||
# don't actually show the plots
|
||||
Random.seed!(1234)
|
||||
default(show=false, reuse=true)
|
||||
const IS_CI = get(ENV, "CI", "false") == "true"
|
||||
const IMG_TOL = VERSION < v"1.4" && Sys.iswindows() ? 1e-1 : IS_CI ? 1e-2 : 1e-3
|
||||
is_ci() = get(ENV, "CI", "false") == "true"
|
||||
const IMG_TOL = VERSION < v"1.4" && Sys.iswindows() ? 1e-1 : is_ci() ? 1e-2 : 1e-3
|
||||
|
||||
## Uncomment the following lines to update reference images for different backends
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user