From 84ae027f31727ae253b6d48c316ee169d0077b55 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Thu, 25 Jun 2020 08:01:29 -0500 Subject: [PATCH 1/4] Control tests includes via env variable TESTS --- test/runtests.jl | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index a40d330e..25f611fd 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -7,13 +7,31 @@ using TimeZones const BOUND_PERMUTATIONS = product((Closed, Open), (Closed, Open)) -@testset "Intervals" begin - include("inclusivity.jl") - include("endpoint.jl") - include("interval.jl") - include("anchoredinterval.jl") - include("comparisons.jl") - include("plotting.jl") +const ALL_TESTS = ( + :inclusivity, + :endpoint, + :interval, + :anchoredinterval, + :comparisons, + :plotting, + :doctest, +) + +const TESTS = let + tests = Symbol.(split(get(ENV, "TESTS", ""), r"\s+", keepempty=false)) + if isempty(tests) + ALL_TESTS + else + tests + end +end - doctest(Intervals) +@testset "Intervals" begin + :inclusivity in TESTS && include("inclusivity.jl") + :endpoint in TESTS && include("endpoint.jl") + :interval in TESTS && include("interval.jl") + :anchoredinterval in TESTS && include("anchoredinterval.jl") + :comparisons in TESTS && include("comparisons.jl") + :plotting in TESTS && include("plotting.jl") + :doctest in TESTS && doctest(Intervals) end From afa03dca56fd03764baf1b1ac6c87790a02a2345 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Thu, 25 Jun 2020 08:10:02 -0500 Subject: [PATCH 2/4] Allow for test removal --- test/runtests.jl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 25f611fd..d8b6a8b3 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -18,12 +18,15 @@ const ALL_TESTS = ( ) const TESTS = let - tests = Symbol.(split(get(ENV, "TESTS", ""), r"\s+", keepempty=false)) - if isempty(tests) - ALL_TESTS - else - tests - end + # e.g. `TESTS="interval comparisons"` or `TEST="-plotting"` + tests = split(get(ENV, "TESTS", ""), r"\s+", keepempty=false) + + isexclude(x) = startswith(x, '-') + includes = Symbol.(filter(!isexclude, tests)) + excludes = Symbol.(replace.(filter(isexclude, tests), Ref(r"^-" => ""))) + + isempty(includes) && (includes = ALL_TESTS) + setdiff(includes, excludes) end @testset "Intervals" begin From 7296fae5ae6ae9ac7b844bbc98eca9028404eaa4 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Thu, 25 Jun 2020 08:15:17 -0500 Subject: [PATCH 3/4] Limit Appveyor to plotting testing only --- .travis.yml | 8 ++++++-- appveyor.yml | 9 +++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 08d0b778..f520d678 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,11 +2,11 @@ language: julia julia: - 1.0 # Latest LTS release - - 1 # Latest stable release + - 1 # Latest stable release - nightly os: - linux -# - windows # Can't use Travis to test windows because https://github.com/JuliaIO/FFMPEG.jl/issues/14 + - windows arch: - x64 - x86 @@ -25,6 +25,10 @@ jobs: - os: windows arch: x64 include: + # Windows plotting tests fail on Travis CI due to: https://github.com/JuliaIO/FFMPEG.jl/issues/14 + # Additionally, the build of FFMPEG.jl will fail but testing will still proceed + - os: windows + env: TESTS="-plotting" - stage: Documentation julia: 1.0 script: julia --project=docs -e ' diff --git a/appveyor.yml b/appveyor.yml index 8a29d201..985efbda 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,11 +1,12 @@ environment: + TESTS: plotting # Limit Appveyor testing to just plotting as Travis is faster matrix: - - julia_version: 1.0 # latest LTS - - julia_version: 1 # latest stable - - julia_version: nightly + - julia_version: 1.0 # Latest LTS + - julia_version: 1 # Latest stable + - julia_version: nightly platform: - - x64 # 64-bit + - x64 # 64-bit matrix: allow_failures: From 4b9c1793334bc4d3d6cc6de037c00a824c66663b Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Thu, 25 Jun 2020 10:29:17 -0500 Subject: [PATCH 4/4] Debug Travis failures --- test/runtests.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/runtests.jl b/test/runtests.jl index d8b6a8b3..c2b3bc04 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -29,6 +29,8 @@ const TESTS = let setdiff(includes, excludes) end +@show get(ENV, "TESTS", "") TESTS + @testset "Intervals" begin :inclusivity in TESTS && include("inclusivity.jl") :endpoint in TESTS && include("endpoint.jl")