Skip to content

Commit

Permalink
Merge pull request #279 from eric-wieser/run-slow-tests-separately
Browse files Browse the repository at this point in the history
Partially addresses #278, by reducing the total CI time.

This runs the really slow tests just once, rather than 4 times, `(3.5, 3.8) x (conda, not conda)`.
  • Loading branch information
eric-wieser committed Mar 11, 2020
2 parents e4412b0 + da5f482 commit f330719
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 15 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
3 changes: 2 additions & 1 deletion clifford/test/test_g3c_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def test_general_logarithm_TRS(self):
random_point_pair, random_line, random_circle, random_plane
])
def test_general_logarithm_conformal(self, obj_gen):
for i in range(10000):
for i in range(1000):
X = obj_gen()
Y = obj_gen()
R = rotor_between_objects(X, Y)
Expand Down 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 f330719

Please sign in to comment.