Skip to content

Commit ca60419

Browse files
committed
travis: collapse phase1/2 into test stage
This change speeds-up testing and provides faster and better feedback. Previously testing on py3 would start only if py27 was passing. Change-Id: I50b798b63a234da826b624017284989bd615ef36
1 parent 08936b8 commit ca60419

File tree

4 files changed

+19
-27
lines changed

4 files changed

+19
-27
lines changed

.travis.yml

+10-19
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ os:
2020
- linux
2121
stages:
2222
- maintenance
23-
- phase1
24-
- phase2
23+
- test
2524
- deploy
2625
before_install:
2726
# begin: workaround to enable support for py37:
@@ -46,10 +45,8 @@ jobs:
4645
- stage: maintenance
4746
script:
4847
- python -m tox -e maintenance
49-
on:
50-
condition: $TRAVIS_EVENT_TYPE = cron
51-
- stage: phase1
52-
script:
48+
if: type = cron
49+
- script:
5350
# package building added here purely to fail-fast if is broken
5451
- python setup.py sdist bdist_wheel
5552
- python -m tox
@@ -58,37 +55,31 @@ jobs:
5855
language: nodejs
5956
node_js:
6057
- "8"
61-
- stage: phase1
62-
script: python -m tox
58+
- script: python -m tox
6359
python: "2.7"
6460
env: TOXENV=docs
65-
- stage: phase1
66-
script: python -m tox
61+
- script: python -m tox
6762
python: "2.7"
6863
env: TOXENV=py27
6964
after_success:
7065
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
7166
- requires.io update-site -t ac3bbcca32ae03237a6aae2b02eb9411045489bb -r
72-
- stage: phase2
73-
script: python -m tox
67+
- script: python -m tox
7468
python: "3.4"
7569
env: TOXENV=py34
7670
after_success:
7771
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
78-
- stage: phase2
79-
script: python -m tox
72+
- script: python -m tox
8073
python: "3.5"
8174
env: TOXENV=py35
8275
after_success:
8376
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
84-
- stage: phase2
85-
script: python -m tox
77+
- script: python -m tox
8678
python: "3.6"
8779
env: TOXENV=py36 PYTHON='3.6' PYENV_VERSION='system'
8880
after_success:
8981
- bash <(curl -s https://codecov.io/bash) -e TOX_ENV
90-
- stage: phase2
91-
script: python -m pip install -q tox-travis && python -m tox
82+
- script: python -m pip install -q tox-travis && python -m tox
9283
python: "3.7"
9384
env: TOXENV=py37 PYTHON='3.7'
9485
after_success:
@@ -101,7 +92,7 @@ jobs:
10192
script:
10293
- python setup.py sdist bdist_wheel
10394
- python -m twine upload dist/*
104-
if: tag IS present
95+
if: tag IS present AND type != cron
10596
deploy:
10697
- provider: releases
10798
api_key:

docs/requirements-rtd.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
pbr>=3.0.0
2-
sphinx>=2.0.1
2+
Sphinx>=1.8.5
33
sphinx_rtd_theme>=0.4.3

tests/test_client.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import getpass
44
import pytest
55
from tenacity import retry
6-
from tenacity import wait_random_exponential
6+
from tenacity import wait_incrementing
77
from tests import get_unique_project_name
88
from tests import JiraTestManager
99

@@ -57,15 +57,14 @@ def remove_by_slug():
5757
return slug
5858

5959

60-
@retry(wait=wait_random_exponential(multiplier=1, max=180))
60+
@retry(wait=wait_incrementing(start=0, increment=1, max=60))
6161
def test_delete_project(cl_admin, cl_normal, slug):
6262

6363
with pytest.raises(JIRAError) as ex:
64-
assert cl_normal.delete_project(slug)
65-
66-
assert 'Not enough permissions to delete project' in str(ex.value) \
67-
or str(ex.value).endswith('is not a Project, projectID or slug')
68-
64+
cl_normal.delete_project(slug)
65+
# verify that normal user cannot delete project
66+
assert 'Not enough permissions to delete project' in str(ex.value)
67+
# verify that admin user can delete project
6968
assert cl_admin.delete_project(slug)
7069

7170

tox.ini

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ commands=
3636
setenv =
3737
PIP_LOG={envdir}/pip.log
3838
PIP_DISABLE_PIP_VERSION_CHECK=1
39+
# Avoid 2020-01-01 warnings: https://github.com/pypa/pip/issues/6207
40+
PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command
3941

4042
passenv =
4143
CI

0 commit comments

Comments
 (0)