Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit aeed80f

Browse files
authored
⚗️ first try (#602)
this closes #592
1 parent 9f1a439 commit aeed80f

File tree

5 files changed

+1147
-814
lines changed

5 files changed

+1147
-814
lines changed

.circleci/config.yml

Lines changed: 219 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,239 @@
11
version: 2
22
jobs:
33
"percy-finalize":
4-
docker:
4+
docker:
55
- image: percyio/agent
6-
steps:
6+
steps:
77
- run: percy finalize --all
88

9-
'python-2.7': &test-template
10-
docker:
11-
- image: circleci/python:2.7-stretch-node-browsers
12-
environment:
13-
PYTHON_VERSION: py27
14-
PERCY_PARALLEL_TOTAL: '-1'
15-
- image: percyio/agent
9+
'lint-unit-37': &lint-unit
10+
working_directory: ~/project
11+
docker:
12+
- image: circleci/python:3.7-stretch-node-browsers
13+
environment:
14+
PYTHON_VERSION: py37
15+
steps:
16+
- checkout
17+
- run: echo $PYTHON_VERSION > ver.txt
18+
- restore_cache:
19+
key: dep-{{ checksum "ver.txt" }}-{{ checksum "dev-requirements.txt" }}
20+
- run:
21+
name: 🐍 pip dev requirements
22+
command: |
23+
sudo pip install virtualenv --upgrade
24+
python -m venv || virtualenv venv && . venv/bin/activate
25+
pip install -r dev-requirements.txt
26+
- save_cache:
27+
key: dep-{{ checksum "ver.txt" }}-{{ checksum "dev-requirements.txt" }}
28+
paths:
29+
- "venv"
30+
- run:
31+
name: 🌸 Lint
32+
command: |
33+
. venv/bin/activate
34+
npm i --ignore-scripts && npm i --ignore-scripts --only=dev
35+
npm run format:test && npm run lint
36+
flake8 --ignore=E501,F401,F841,F811,W503 tests
37+
- run:
38+
name: 🔎 Unit Tests
39+
command: |
40+
npm run test-unit
1641
17-
steps:
18-
- checkout
42+
'lint-unit-36':
43+
<<: *lint-unit
44+
docker:
45+
- image: circleci/python:3.6-stretch-node-browsers
46+
environment:
47+
PYTHON_VERSION: py36
1948

20-
- run:
21-
name: Write job name
22-
command: echo $CIRCLE_JOB > circlejob.txt
49+
'lint-unit-27':
50+
<<: *lint-unit
51+
docker:
52+
- image: circleci/python:2.7-stretch-node-browsers
53+
environment:
54+
PYTHON_VERSION: py27
2355

24-
- run:
25-
name: Install dependencies
26-
command: |
27-
sudo pip install virtualenv --upgrade
28-
python -m venv || virtualenv venv
29-
. venv/bin/activate
30-
pip install -r dev-requirements.txt
31-
npm install --ignore-scripts
56+
'build-dash-37': &build-dash
57+
working_directory: ~/project
58+
docker:
59+
- image: circleci/python:3.7-stretch-node-browsers
60+
environment:
61+
PYTHON_VERSION: py37
62+
steps:
63+
- checkout
64+
- run: echo $PYTHON_VERSION > ver.txt
65+
- restore_cache:
66+
key: dep-{{ checksum "ver.txt" }}-{{ checksum "dev-requirements.txt" }}
67+
- run:
68+
name: 🐍 pip dev requirements
69+
command: |
70+
sudo pip install virtualenv --upgrade
71+
python -m venv || virtualenv venv && . venv/bin/activate
72+
pip install -r dev-requirements.txt
73+
- save_cache:
74+
key: dep-{{ checksum "ver.txt" }}-{{ checksum "dev-requirements.txt" }}
75+
paths:
76+
- "venv"
77+
- run:
78+
name: 🏗️ build dash
79+
command: |
80+
. venv/bin/activate && pip install --upgrade -e . --quiet && mkdir packages
81+
# build main dash
82+
git clone --depth 1 https://github.com/plotly/dash.git dash-main
83+
cd dash-main && pip install -e . && python setup.py sdist && mv dist/* ../packages/
84+
cd dash-renderer && npm i --ignore-scripts && npm run build:dev && npm run build
85+
python setup.py sdist && mv dist/* ../../packages/ && cd ../..
86+
# build dcc
87+
npm i --ignore-scripts && npm run build && python setup.py sdist && mv dist/* ./packages
88+
# build html
89+
git clone --depth 1 https://github.com/plotly/dash-html-components.git
90+
cd dash-html-components && npm i --ignore-scripts && npm run build
91+
python setup.py sdist && mv dist/* ../packages
92+
- persist_to_workspace:
93+
root: ~/project
94+
paths:
95+
- packages
3296

33-
- run:
34-
name: Install dependencies (dash)
35-
command: |
36-
git clone --depth 1 https://github.com/plotly/dash.git dash-main
37-
git clone --depth 1 https://github.com/plotly/dash-html-components.git
38-
. venv/bin/activate
39-
pip install -e ./dash-main[testing] --quiet
40-
cd dash-html-components && npm install --ignore-scripts && npm run build && pip install -e . && cd ..
41-
cd dash-main/dash-renderer && npm install --ignore-scripts && npm run build && pip install -e . && cd ../..
42-
- run:
43-
name: Build
44-
command: |
45-
. venv/bin/activate
46-
npm run build
47-
pip install -e . --quiet
48-
pip list | grep dash
97+
"build-dash-36":
98+
<<: *build-dash
99+
docker:
100+
- image: circleci/python:3.6-stretch-node-browsers
101+
environment:
102+
PYTHON_VERSION: py36
49103

50-
- run:
51-
name: Run tests
52-
command: |
53-
. venv/bin/activate
54-
python --version
55-
npm run test
104+
'build-dash-27':
105+
<<: *build-dash
106+
docker:
107+
- image: circleci/python:2.7-stretch-node-browsers
108+
environment:
109+
PYTHON_VERSION: py27
56110

57-
- run:
58-
name: Percy TearDown
59-
command: percy --finalize -all
60-
when: on_fail
111+
"test-37": &test
112+
working_directory: ~/project
113+
docker:
114+
- image: circleci/python:3.7-stretch-node-browsers
115+
environment:
116+
PYTHON_VERSION: py37
117+
PERCY_PARALLEL_TOTAL: '-1'
118+
parallelism: 3
119+
steps:
120+
- checkout
121+
- run: echo $PYTHON_VERSION > ver.txt
122+
- restore_cache:
123+
key: dep-{{ checksum "ver.txt" }}-{{ checksum "dev-requirements.txt" }}
124+
- attach_workspace:
125+
at: ~/project
126+
- run:
127+
name: 🧪 Run Integration Tests
128+
command: |
129+
. venv/bin/activate && cd packages && ls -la && mv dash-*.tar.gz main.tar.gz
130+
pip install main.tar.gz[testing] --quiet && pip list | grep dash | xargs pip uninstall -y
131+
find . -name "dash*.gz" | xargs pip install && pip install main.tar.gz && pip list | grep dash && cd ..
132+
TESTFILES=$(circleci tests glob "tests/integration/**/test_*.py" | circleci tests split --split-by=timings)
133+
pytest --headless --nopercyfinalize --junitxml=test-reports/junit_intg.xml ${TESTFILES}
134+
- store_artifacts:
135+
path: test-reports
136+
- store_test_results:
137+
path: test-reports
138+
- store_artifacts:
139+
path: /tmp/dash_artifacts
61140

62-
'python-3.6':
63-
<<: *test-template
64-
docker:
65-
- image: circleci/python:3.6-stretch-node-browsers
66-
environment:
67-
PYTHON_VERSION: py36
68-
PERCY_ENABLE: 0
141+
"test-36":
142+
<<: *test
143+
docker:
144+
- image: circleci/python:3.6-stretch-node-browsers
145+
environment:
146+
PYTHON_VERSION: py36
147+
PERCY_ENABLE: '0'
69148

70-
'python-3.7':
71-
<<: *test-template
72-
docker:
73-
- image: circleci/python:3.7-stretch-node-browsers
74-
environment:
75-
PYTHON_VERSION: py37
76-
PERCY_ENABLE: 0
149+
'test-27':
150+
<<: *test
151+
docker:
152+
- image: circleci/python:2.7-stretch-node-browsers
153+
environment:
154+
PYTHON_VERSION: py27
155+
PERCY_ENABLE: '0'
156+
157+
"test-legacy-37": &test-legacy
158+
working_directory: ~/project
159+
docker:
160+
- image: circleci/python:3.7-stretch-node-browsers
161+
environment:
162+
PYTHON_VERSION: py37
163+
PERCY_PARALLEL_TOTAL: '-1'
164+
parallelism: 2
165+
steps:
166+
- checkout
167+
- run: echo $PYTHON_VERSION > ver.txt
168+
- restore_cache:
169+
key: dep-{{ checksum "ver.txt" }}-{{ checksum "dev-requirements.txt" }}
170+
- attach_workspace:
171+
at: ~/project
172+
- run:
173+
name: 🧪 Run Legacy Integration Tests
174+
command: |
175+
. venv/bin/activate && cd packages && ls -la && mv dash-*.tar.gz main.tar.gz
176+
pip install main.tar.gz[testing] --quiet && pip list | grep dash | xargs pip uninstall -y
177+
find . -name "dash*.gz" | xargs pip install && pip install main.tar.gz && pip list | grep dash && cd ..
178+
TESTFILES=$(circleci tests glob "tests/test_integration_*.py" | circleci tests split --split-by=timings)
179+
pytest --durations=10 --junitxml=test-reports/junit_legacy.xml ${TESTFILES}
180+
- store_artifacts:
181+
path: test-reports
182+
- store_test_results:
183+
path: test-reports
184+
- store_artifacts:
185+
path: /tmp/dash_artifacts
186+
187+
"test-legacy-36":
188+
<<: *test-legacy
189+
docker:
190+
- image: circleci/python:3.6-stretch-node-browsers
191+
environment:
192+
PYTHON_VERSION: py36
193+
PERCY_ENABLE: '0'
194+
'test-legacy-27':
195+
<<: *test-legacy
196+
docker:
197+
- image: circleci/python:2.7-stretch-node-browsers
198+
environment:
199+
PYTHON_VERSION: py27
200+
PERCY_ENABLE: '0'
77201

78202
workflows:
79203
version: 2
80-
build:
204+
python3.7:
81205
jobs:
82-
- python-2.7
206+
- 'lint-unit-37'
207+
- 'build-dash-37'
208+
- "test-37":
209+
requires:
210+
- build-dash-37
211+
- "test-legacy-37":
212+
requires:
213+
- build-dash-37
83214
- "percy-finalize":
84215
requires:
85-
- 'python-2.7'
86-
- 'python-3.6'
87-
- 'python-3.7'
216+
- "test-37"
217+
- "test-legacy-37"
218+
219+
python3.6:
220+
jobs:
221+
- 'lint-unit-36'
222+
- 'build-dash-36'
223+
- "test-36":
224+
requires:
225+
- build-dash-36
226+
- "test-legacy-36":
227+
requires:
228+
- build-dash-36
229+
230+
python2.7:
231+
jobs:
232+
- 'lint-unit-27'
233+
- 'build-dash-27'
234+
- "test-27":
235+
requires:
236+
- build-dash-27
237+
- "test-legacy-27":
238+
requires:
239+
- build-dash-27

dev-requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
pandas
22
xlrd
33
flake8
4-
mimesis;python_version>="3.6"
4+
mimesis;python_version>="3.6"
5+
virtualenv;python_version=="2.7"

tests/IntegrationTests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def setUpClass(cls):
4040
def tearDownClass(cls):
4141
super(IntegrationTests, cls).tearDownClass()
4242
cls.driver.quit()
43-
cls.percy_runner.finalize_build()
4443

4544
def setUp(self):
4645
pass

0 commit comments

Comments
 (0)