diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d9db234..81d25df2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/test/imgcomp.jl b/test/imgcomp.jl index 4a06a0ef..3a0af3ca 100644 --- a/test/imgcomp.jl +++ b/test/imgcomp.jl @@ -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; - 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) - i in skip && continue - if only === nothing || i in only - @test image_comparison_tests(pkg, i, debug=debug, sigma=sigma, tol=tol) |> success == true +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 = 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 + end end - end end diff --git a/test/runtests.jl b/test/runtests.jl index adc4eaf8..67b6e6b1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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