Skip to content

Commit 7767b44

Browse files
authored
CircleCI 2.0 migration (#1109)
Port of test suite to 2.0, with improvements There is now a workflow for each Python version / test suite combination. This way all of the jobs can run in parallel. I also refactored the `core` tests to pull out the tests that rely on `plot.ly` interaction. These are currently the slowest tests, and pulling them out means that the core tests run really fast. It also means that if there is an intermittent failure due to plot.ly communication, we can restart only the plot.ly tests for the particular version of Python that had the failure. Updates: - [x] Split plot.ly tests into separate directory - [x] Add core and core+optional workflows for 2.7, 3.4, 3.5, 3.6, and 3.7 (These run pretty fast now without the plot.ly tests) - [x] plot.ly tests for 2.7, 3.4, and 3.7? - [x] Add pytest validator tests to optional (these tests need the extra dependencies)
1 parent 79b7a83 commit 7767b44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+438
-214
lines changed

Diff for: .circleci/config.yml

+252
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
version: 2
2+
3+
jobs:
4+
# Core
5+
"python-2.7-core":
6+
docker:
7+
- image: circleci/python:2.7-stretch-node-browsers
8+
environment:
9+
PLOTLY_TOX_PYTHON_27: python2.7
10+
11+
steps:
12+
- checkout
13+
- run:
14+
name: Install tox
15+
command: 'sudo pip install tox'
16+
- run:
17+
name: Test with tox
18+
command: 'tox -e py27-core'
19+
no_output_timeout: 20m
20+
21+
"python-3.4-core":
22+
docker:
23+
- image: circleci/python:3.4-stretch-node-browsers
24+
environment:
25+
PLOTLY_TOX_PYTHON_34: python3.4
26+
27+
steps:
28+
- checkout
29+
- run:
30+
name: Install tox
31+
command: 'sudo pip install tox'
32+
- run:
33+
name: Test with tox
34+
command: 'tox -e py34-core'
35+
no_output_timeout: 20m
36+
37+
"python-3.5-core":
38+
docker:
39+
- image: circleci/python:3.5-stretch-node-browsers
40+
environment:
41+
PLOTLY_TOX_PYTHON_35: python3.5
42+
43+
steps:
44+
- checkout
45+
- run:
46+
name: Install tox
47+
command: 'sudo pip install tox'
48+
- run:
49+
name: Test with tox
50+
command: 'tox -e py35-core'
51+
no_output_timeout: 20m
52+
53+
"python-3.6-core":
54+
docker:
55+
- image: circleci/python:3.6-stretch-node-browsers
56+
environment:
57+
PLOTLY_TOX_PYTHON_36: python3.6
58+
59+
steps:
60+
- checkout
61+
- run:
62+
name: Install tox
63+
command: 'sudo pip install tox'
64+
- run:
65+
name: Test with tox
66+
command: 'tox -e py36-core'
67+
no_output_timeout: 20m
68+
69+
"python-3.7-core":
70+
docker:
71+
- image: circleci/python:3.7-stretch-node-browsers
72+
environment:
73+
PLOTLY_TOX_PYTHON_37: python3.7
74+
75+
steps:
76+
- checkout
77+
- run:
78+
name: Install tox
79+
command: 'sudo pip install tox'
80+
- run:
81+
name: Test with tox
82+
command: 'tox -e py37-core'
83+
no_output_timeout: 20m
84+
85+
# Optional
86+
"python-2.7-optional":
87+
docker:
88+
- image: circleci/python:2.7-stretch-node-browsers
89+
environment:
90+
PLOTLY_TOX_PYTHON_27: python2.7
91+
92+
steps:
93+
- checkout
94+
- run:
95+
name: Install tox
96+
command: 'sudo pip install tox'
97+
- run:
98+
name: Install npm dependencies
99+
command: cd plotly/tests/test_optional/test_jupyter && npm install
100+
no_output_timeout: 20m
101+
- run:
102+
name: Test with tox
103+
command: 'tox -e py27-optional'
104+
no_output_timeout: 20m
105+
106+
"python-3.4-optional":
107+
docker:
108+
- image: circleci/python:3.4-stretch-node-browsers
109+
environment:
110+
PLOTLY_TOX_PYTHON_34: python3.4
111+
112+
steps:
113+
- checkout
114+
- run:
115+
name: Install tox
116+
command: 'sudo pip install tox'
117+
- run:
118+
name: Install npm dependencies
119+
command: cd plotly/tests/test_optional/test_jupyter && npm install
120+
no_output_timeout: 20m
121+
- run:
122+
name: Test with tox
123+
command: 'tox -e py34-optional'
124+
no_output_timeout: 20m
125+
126+
"python-3.5-optional":
127+
docker:
128+
- image: circleci/python:3.5-stretch-node-browsers
129+
environment:
130+
PLOTLY_TOX_PYTHON_35: python3.5
131+
132+
steps:
133+
- checkout
134+
- run:
135+
name: Install tox
136+
command: 'sudo pip install tox'
137+
- run:
138+
name: Install npm dependencies
139+
command: cd plotly/tests/test_optional/test_jupyter && npm install
140+
no_output_timeout: 20m
141+
- run:
142+
name: Test with tox
143+
command: 'tox -e py35-optional'
144+
no_output_timeout: 20m
145+
146+
"python-3.6-optional":
147+
docker:
148+
- image: circleci/python:3.6-stretch-node-browsers
149+
environment:
150+
PLOTLY_TOX_PYTHON_36: python3.6
151+
152+
steps:
153+
- checkout
154+
- run:
155+
name: Install tox
156+
command: 'sudo pip install tox'
157+
- run:
158+
name: Install npm dependencies
159+
command: cd plotly/tests/test_optional/test_jupyter && npm install
160+
no_output_timeout: 20m
161+
- run:
162+
name: Test with tox
163+
command: 'tox -e py36-optional'
164+
no_output_timeout: 20m
165+
166+
"python-3.7-optional":
167+
docker:
168+
- image: circleci/python:3.7-stretch-node-browsers
169+
environment:
170+
PLOTLY_TOX_PYTHON_37: python3.7
171+
172+
steps:
173+
- checkout
174+
- run:
175+
name: Install tox
176+
command: 'sudo pip install tox'
177+
- run:
178+
name: Install npm dependencies
179+
command: cd plotly/tests/test_optional/test_jupyter && npm install
180+
no_output_timeout: 20m
181+
- run:
182+
name: Test with tox
183+
command: 'tox -e py37-optional'
184+
no_output_timeout: 20m
185+
186+
# Plot.ly
187+
"python-2.7-plot_ly":
188+
docker:
189+
- image: circleci/python:2.7-stretch-node-browsers
190+
environment:
191+
PLOTLY_TOX_PYTHON_27: python2.7
192+
193+
steps:
194+
- checkout
195+
- run:
196+
name: Install tox
197+
command: 'sudo pip install tox'
198+
- run:
199+
name: Test with tox
200+
command: 'tox -e py27-plot_ly'
201+
no_output_timeout: 20m
202+
203+
"python-3.4-plot_ly":
204+
docker:
205+
- image: circleci/python:3.4-stretch-node-browsers
206+
environment:
207+
PLOTLY_TOX_PYTHON_34: python3.4
208+
209+
steps:
210+
- checkout
211+
- run:
212+
name: Install tox
213+
command: 'sudo pip install tox'
214+
- run:
215+
name: Test with tox
216+
command: 'tox -e py34-plot_ly'
217+
no_output_timeout: 20m
218+
219+
"python-3.7-plot_ly":
220+
docker:
221+
- image: circleci/python:3.7-stretch-node-browsers
222+
environment:
223+
PLOTLY_TOX_PYTHON_37: python3.7
224+
225+
steps:
226+
- checkout
227+
- run:
228+
name: Install tox
229+
command: 'sudo pip install tox'
230+
- run:
231+
name: Test with tox
232+
command: 'tox -e py37-plot_ly'
233+
no_output_timeout: 20m
234+
235+
workflows:
236+
version: 2
237+
build:
238+
jobs:
239+
- "python-2.7-core"
240+
- "python-3.4-core"
241+
- "python-3.5-core"
242+
- "python-3.6-core"
243+
- "python-3.7-core"
244+
- "python-2.7-optional"
245+
- "python-3.4-optional"
246+
- "python-3.5-optional"
247+
- "python-3.6-optional"
248+
# 3.7 optional disabled due to current shapely incompatibility
249+
# - "python-3.7-optional"
250+
- "python-2.7-plot_ly"
251+
- "python-3.4-plot_ly"
252+
- "python-3.7-plot_ly"

Diff for: _plotly_utils/tests/validators/test_angle_validator.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
#from ..basevalidators import AngleValidator
23
from _plotly_utils.basevalidators import AngleValidator
34
import numpy as np
45

@@ -33,7 +34,7 @@ def test_coercion(val, expected, validator):
3334
# ### Test rejection ###
3435
@pytest.mark.parametrize('val',
3536
['hello', (), [], [1, 2, 3], set(), '34'])
36-
def test_rejection(val, validator: AngleValidator):
37+
def test_rejection(val, validator):
3738
with pytest.raises(ValueError) as validation_failure:
3839
validator.validate_coerce(val)
3940

Diff for: _plotly_utils/tests/validators/test_any_validator.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def validator_aok():
2121
@pytest.mark.parametrize('val', [
2222
set(), 'Hello', 123, np.inf, np.nan, {}
2323
])
24-
def test_acceptance(val, validator: AnyValidator):
24+
def test_acceptance(val, validator):
2525
assert validator.validate_coerce(val) is val
2626

2727

@@ -36,7 +36,7 @@ def test_acceptance(val, validator: AnyValidator):
3636
['Hello', 'World'],
3737
[np.pi, np.e, {}]
3838
])
39-
def test_acceptance_array(val, validator_aok: AnyValidator):
39+
def test_acceptance_array(val, validator_aok):
4040
coerce_val = validator_aok.validate_coerce(val)
4141
if isinstance(val, np.ndarray):
4242
assert isinstance(coerce_val, np.ndarray)

Diff for: _plotly_utils/tests/validators/test_basetraces_validator.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def validator():
1616

1717
# Tests
1818
# -----
19-
def test_acceptance(validator: BaseDataValidator):
19+
def test_acceptance(validator):
2020
val = [Scatter(mode='lines'), Box(fillcolor='yellow')]
2121
res = validator.validate_coerce(val)
2222
res_present = validator.present(res)
@@ -36,7 +36,7 @@ def test_acceptance(validator: BaseDataValidator):
3636
assert res_present[0].uid != res_present[1].uid
3737

3838

39-
def test_acceptance_dict(validator: BaseDataValidator):
39+
def test_acceptance_dict(validator):
4040
val = (dict(type='scatter', mode='lines'),
4141
dict(type='box', fillcolor='yellow'))
4242
res = validator.validate_coerce(val)
@@ -56,7 +56,7 @@ def test_acceptance_dict(validator: BaseDataValidator):
5656
assert res_present[0].uid != res_present[1].uid
5757

5858

59-
def test_default_is_scatter(validator: BaseDataValidator):
59+
def test_default_is_scatter(validator):
6060
val = [dict(mode='lines')]
6161
res = validator.validate_coerce(val)
6262
res_present = validator.present(res)
@@ -68,7 +68,7 @@ def test_default_is_scatter(validator: BaseDataValidator):
6868
assert res_present[0].mode == 'lines'
6969

7070

71-
def test_rejection_type(validator: BaseDataValidator):
71+
def test_rejection_type(validator):
7272
val = 37
7373

7474
with pytest.raises(ValueError) as validation_failure:
@@ -77,7 +77,7 @@ def test_rejection_type(validator: BaseDataValidator):
7777
assert "Invalid value" in str(validation_failure.value)
7878

7979

80-
def test_rejection_element_type(validator: BaseDataValidator):
80+
def test_rejection_element_type(validator):
8181
val = [42]
8282

8383
with pytest.raises(ValueError) as validation_failure:
@@ -86,7 +86,7 @@ def test_rejection_element_type(validator: BaseDataValidator):
8686
assert "Invalid element(s)" in str(validation_failure.value)
8787

8888

89-
def test_rejection_element_attr(validator: BaseDataValidator):
89+
def test_rejection_element_attr(validator):
9090
val = [dict(type='scatter', bogus=99)]
9191

9292
with pytest.raises(ValueError) as validation_failure:
@@ -97,7 +97,7 @@ def test_rejection_element_attr(validator: BaseDataValidator):
9797
str(validation_failure.value))
9898

9999

100-
def test_rejection_element_tracetype(validator: BaseDataValidator):
100+
def test_rejection_element_tracetype(validator):
101101
val = [dict(type='bogus', a=4)]
102102

103103
with pytest.raises(ValueError) as validation_failure:

0 commit comments

Comments
 (0)