Skip to content

Commit d1bb974

Browse files
committed
add Travis CI test isolation controls
1 parent 7b0ae7d commit d1bb974

File tree

4 files changed

+28
-10
lines changed

4 files changed

+28
-10
lines changed

.travis.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,45 @@ matrix:
44
include:
55
# CPython 2.7
66
- python: 2.7
7-
env: TOXENV=py27-local-fast
7+
env: TOXENV=py27-travis-local-slow
88
- python: 2.7
9-
env: TOXENV=py27-integ-fast
9+
env: TOXENV=py27-travis-integ-slow
10+
- python: 2.7
11+
env: TOXENV=py27-travis-isolation
1012
# CPython 3.4
1113
- python: 3.4
12-
env: TOXENV=py34-local-fast
14+
env: TOXENV=py34-travis-local-slow
15+
- python: 3.4
16+
env: TOXENV=py34-travis-integ-slow
1317
- python: 3.4
14-
env: TOXENV=py34-integ-fast
18+
env: TOXENV=py34-travis-isolation
1519
# CPython 3.5
1620
- python: 3.5
17-
env: TOXENV=py35-local-fast
21+
env: TOXENV=py35-travis-local-slow
1822
- python: 3.5
19-
env: TOXENV=py35-integ-fast
23+
env: TOXENV=py35-travis-integ-slow
24+
- python: 3.5
25+
env: TOXENV=py35-travis-isolation
2026
# CPython 3.6
2127
- python: 3.6
22-
env: TOXENV=py36-local-fast
28+
env: TOXENV=py36-travis-local-slow
29+
- python: 3.6
30+
env: TOXENV=py36-travis-integ-slow
2331
- python: 3.6
24-
env: TOXENV=py36-integ-fast
32+
env: TOXENV=py36-travis-isolation
2533
# CPython 3.7
2634
# xenial + sudo are currently needed to get 3.7
2735
# https://github.com/travis-ci/travis-ci/issues/9815
2836
- python: 3.7
29-
env: TOXENV=py37-local-fast
37+
env: TOXENV=py37-travis-local-slow
38+
dist: xenial
39+
sudo: true
40+
- python: 3.7
41+
env: TOXENV=py37-travis-integ-slow
3042
dist: xenial
3143
sudo: true
3244
- python: 3.7
33-
env: TOXENV=py37-integ-fast
45+
env: TOXENV=py37-travis-isolation
3446
dist: xenial
3547
sudo: true
3648
# Upstream tests

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ markers =
2727
slow: mark a test as being known to take a long time to complete (order 5s < t < 60s)
2828
veryslow: mark a test as being known to take a very long time to complete (order t > 60s)
2929
nope: mark a test as being so slow that it should only be very infrequently (order t > 30m)
30+
travis_isolation: mark a test that crashes Travis CI when run with other tests
3031
log_level=NOTSET
3132

3233
# Flake8 Configuration

test/functional/delegated_keys/test_jce.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def build_short_key_cases():
7474
yield ("RSA", MinimumKeySizes.RSA.value // 2, True, message)
7575

7676

77+
@pytest.mark.travis_isolation
7778
@pytest.mark.parametrize("algorithm, key_bits, too_short, error_message", build_short_key_cases())
7879
def test_warn_on_short_keys(caplog, algorithm, key_bits, too_short, error_message):
7980
with caplog.at_level(logging.DEBUG):

tox.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ commands =
6363
integ-slow: {[testenv:base-command]commands} test/ -m "integ and not ddb_integ and not veryslow and not nope"
6464
ddb-slow: {[testenv:base-command]commands} test/ -m "ddb_integ and not veryslow and not nope"
6565
all-slow: {[testenv:base-command]commands} test/ -m "not veryslow and not nope"
66+
# Only run those tests that need to be isolated in Travis CI
67+
travis-isolation: {[testenv:base-command]commands} test/ -m travis_isolation
68+
travis-local-slow: {[testenv:base-command]commands} test/ -m "local and not veryslow and not nope and not travis_isolation"
69+
travis-integ-slow: {[testenv:base-command]commands} test/ -m "integ and not ddb_integ and not veryslow and not nope and not travis_isolation"
6670
# Also run very large test scenario sets
6771
local-full: {[testenv:base-command]commands} test/ -m "local and not nope"
6872
integ-full: {[testenv:base-command]commands} test/ -m "integ and not ddb_integ and not nope"

0 commit comments

Comments
 (0)