Skip to content

Commit

Permalink
Run the very slow tests in their own job
Browse files Browse the repository at this point in the history
Also reorders the travis jobs to be more logical
  • Loading branch information
eric-wieser committed Mar 11, 2020
1 parent 6426bf1 commit da5f482
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 14 deletions.
45 changes: 31 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,25 @@ x-clifford-templates:
- pip install codecov
script:
- |
PYTEST_ARGS=();
if [[ "${MODE}" == "bench" ]]; then
PYTEST_ARGS+=(--benchmark-only);
else
PYTEST_ARGS+=(--benchmark-skip);
fi;
if [[ "${MODE}" == "very_slow" ]]; then
PYTEST_ARGS+=(-m "veryslow");
else
PYTEST_ARGS+=(-m "not veryslow");
fi;
pytest clifford/test \
${PYTEST_ARGS} \
"${PYTEST_ARGS[@]}" \
--doctest-modules \
--junitxml=junit/test-results.xml \
--durations=25 \
--cov=clifford \
--cov-branch
--cov-branch;
after_success:
- codecov

Expand All @@ -64,52 +76,57 @@ matrix:
stage: Lint
<<: *lint_job

# fastest job first
- os: linux
python: '3.5'
python: '3.8'
env:
- CONDA=false
- PYTEST_ARGS=--benchmark-skip
- NUMBA_DISABLE_JIT=1
stage: Test
<<: *test_job

# really slow job second, so it runs in parallel with the others
- os: linux
python: '3.8'
env:
- CONDA=false
- PYTEST_ARGS=--benchmark-skip
- MODE=very_slow
stage: Test
<<: *test_job

# non-conda jobs
- os: linux
python: '3.8'
env:
- CONDA=false
- PYTEST_ARGS=--benchmark-only
stage: Test
<<: *test_job

- os: linux
python: '3.5'
stage: Test
<<: *test_job

# conda jobs
- os: linux
python: '3.8'
env:
- CONDA=true
- PYTEST_ARGS=--benchmark-skip
stage: Test
<<: *test_job

- os: linux
python: '3.8'
python: '3.5'
env:
- CONDA=true
- PYTEST_ARGS=--benchmark-skip
stage: Test
<<: *test_job

# benchmark
- os: linux
python: '3.8'
env:
- NUMBA_DISABLE_JIT=1
- MODE=bench
stage: Test
<<: *test_job

# deployment
- os: linux
python: '3.8'
stage: Deploy
Expand Down
1 change: 1 addition & 0 deletions clifford/test/test_algebra_initialisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def test_speed(self, n, benchmark):
benchmark(Cl, n)

@too_slow_without_jit
@pytest.mark.veryslow
@pytest.mark.parametrize(
'algebra',
[Cl(i) for i in [4]] + [conformalize(Cl(3)[0])],
Expand Down
1 change: 1 addition & 0 deletions clifford/test/test_g3c_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,7 @@ def test_assign_objects_to_objects(self, obj_gen):
@too_slow_without_jit
class TestModelMatching:

@pytest.mark.veryslow
def test_fingerprint_match(self):

object_generator = random_line
Expand Down
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ per-file-ignores =

# generated, so we don't really care
clifford/tools/g3c/cuda_products.py:F401,E302,E231,W391

[tool:pytest]
markers =
veryslow: mark a test as unreasonably slow (> 30s on travis)

0 comments on commit da5f482

Please sign in to comment.