Skip to content

Commit

Permalink
Group tests into groups to avoid timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Jul 25, 2018
1 parent 5658fff commit 3f62e86
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ env:
# * https://gr-framework.org/about.html#file-formats
# * https://github.com/jheinen/gr/blob/v0.31.1/lib/gks/util.c#L67
- GKS_WSTYPE: png
matrix:
- CI_GROUP=0
- CI_GROUP=1
notifications:
email: false
git:
Expand Down
2 changes: 2 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ makedocs()
# https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
if get(ENV, "TRAVIS", "") != "true"
# Don't do anything outside Travis CI
if get(ENV, "CI_GROUP", "1") != "0"
info("Skipping deploy since CI_GROUP != 0.")
elseif startswith(get(ENV, "TRAVIS_BRANCH", ""), "pre/")
# For branches pre/*, deploy them into gh-pages.pre.
branch = ENV["TRAVIS_BRANCH"]
Expand Down
16 changes: 12 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ using Compat: @warn, stdout

RUNINFO = []

@testset "$file" for file in [
TEST_GROUPS = Dict{String, Vector{String}}(
# ENV["CI_GROUP"] => test files
"0" => [
"test_utils.jl",
"test_normal_form.jl",
"test_smoke.jl",
Expand All @@ -14,13 +16,19 @@ RUNINFO = []
"test_predator_prey.jl",
"test_bazykin_85.jl",
"test_bautin.jl",
"test_reparametrization.jl",
"test_reparametrized_bautin.jl",
"test_examples.jl",
"test_vs_svector.jl",
"test_duffing_van_der_pol.jl",
"test_hopf_to_lc.jl",
]
],
"1" => [
"test_reparametrization.jl",
"test_reparametrized_bautin.jl",
],
)
TEST_GROUPS["all"] = vcat(last.(sort(collect(TEST_GROUPS), by=first))...)

@testset "$file" for file in TEST_GROUPS[get(ENV, "CI_GROUP", "all")]
_, time, bytes, gctime, memallocs = @timed @time include(file)
push!(RUNINFO, Dict(
:file => file,
Expand Down

0 comments on commit 3f62e86

Please sign in to comment.