Skip to content

Commit 87b2ef8

Browse files
committed
Merge remote-tracking branch 'origin/master' into finalist-cluster-scattermapbox
2 parents 12fd6ce + 03917c6 commit 87b2ef8

File tree

2,779 files changed

+924274
-504302
lines changed

Some content is hidden

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

2,779 files changed

+924274
-504302
lines changed

.circleci/config.yml

Lines changed: 160 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -8,152 +8,211 @@ version: 2.0
88
# https://hub.docker.com/r/circleci/node/tags/
99

1010
jobs:
11-
build:
11+
install-and-cibuild:
1212
docker:
13-
- image: circleci/node:12.13.0
13+
- image: circleci/node:12.22.1
1414
working_directory: ~/plotly.js
1515
steps:
1616
- checkout
1717
- run:
18-
name: Install dependencies
19-
command: |
20-
npm ci
21-
- run:
22-
name: List dependency versions
23-
command: |
24-
echo "npm: $(npm --version)"
25-
echo "node: $(node --version)"
26-
npm ls || true
18+
name: Set up build environment
19+
command: .circleci/env_build.sh
2720
- run:
2821
name: Pretest
29-
command: |
30-
npm run pretest
31-
npm run cibuild
22+
command: npm run pretest
3223
- run:
24+
name: CI-Build
25+
command: npm run cibuild
26+
- run:
27+
name: Delete git
3328
command: rm -rf .git
3429
- persist_to_workspace:
3530
root: /home/circleci
3631
paths:
3732
- plotly.js
3833

39-
test-jasmine:
34+
no-gl-jasmine:
4035
docker:
4136
# need '-browsers' version to test in real (xvfb-wrapped) browsers
42-
- image: circleci/node:12.13.0-browsers
43-
parallelism: 2
37+
- image: circleci/node:12.22.1-browsers
38+
parallelism: 8
4439
working_directory: ~/plotly.js
4540
steps:
4641
- attach_workspace:
4742
at: ~/
4843
- run:
49-
name: Run jasmine tests (batch 1)
50-
command: ./.circleci/test.sh jasmine
44+
name: Run jasmine tests (part A)
45+
command: .circleci/test.sh no-gl-jasmine
5146

52-
test-jasmine2:
47+
webgl-jasmine:
5348
docker:
5449
# need '-browsers' version to test in real (xvfb-wrapped) browsers
55-
- image: circleci/node:12.13.0-browsers
56-
parallelism: 3
50+
- image: circleci/node:12.22.1-browsers
51+
parallelism: 8
5752
working_directory: ~/plotly.js
5853
steps:
5954
- attach_workspace:
6055
at: ~/
6156
- run:
62-
name: Run jasmine tests (batch 2)
63-
command: ./.circleci/test.sh jasmine2
57+
name: Run jasmine tests (part B)
58+
command: .circleci/test.sh webgl-jasmine
6459

65-
test-jasmine3:
60+
flaky-no-gl-jasmine:
6661
docker:
6762
# need '-browsers' version to test in real (xvfb-wrapped) browsers
68-
- image: circleci/node:12.13.0-browsers
63+
- image: circleci/node:12.22.1-browsers
6964
working_directory: ~/plotly.js
7065
steps:
7166
- attach_workspace:
7267
at: ~/
7368
- run:
74-
name: Run jasmine tests (batch 3)
75-
command: ./.circleci/test.sh jasmine3
69+
name: Run jasmine tests (part C)
70+
command: .circleci/test.sh flaky-no-gl-jasmine
7671

77-
test-image:
78-
docker:
79-
- image: plotly/testbed:latest
72+
make-baselines:
8073
parallelism: 4
81-
working_directory: /var/www/streambed/image_server/plotly.js/
74+
docker:
75+
- image: circleci/python:3.8.9
76+
working_directory: ~/plotly.js
8277
steps:
8378
- attach_workspace:
84-
at: /var/www/streambed/image_server/
79+
at: ~/
8580
- run:
86-
name: Run and setup container
87-
command: |
88-
supervisord &
89-
npm run docker -- setup
81+
name: Install kaleido, plotly.io and required fonts
82+
command: .circleci/env_image.sh
83+
- run:
84+
name: Create all png files
85+
command: .circleci/test.sh make-baselines
86+
- persist_to_workspace:
87+
root: ~/
88+
paths:
89+
- plotly.js
90+
91+
test-baselines:
92+
docker:
93+
- image: circleci/node:12.22.1
94+
working_directory: ~/plotly.js
95+
steps:
96+
- attach_workspace:
97+
at: ~/
9098
- run:
91-
name: Run image tests
92-
command: ./.circleci/test.sh image
99+
name: Compare pixels
100+
command: .circleci/test.sh test-image ; find build -maxdepth 1 -type f -delete
93101
- store_artifacts:
94102
path: build
95103
destination: /
96104

97-
test-image2:
105+
make-exports:
98106
docker:
99-
- image: plotly/testbed:latest
100-
working_directory: /var/www/streambed/image_server/plotly.js/
107+
- image: circleci/python:3.8.9
108+
working_directory: ~/plotly.js
101109
steps:
102110
- attach_workspace:
103-
at: /var/www/streambed/image_server/
111+
at: ~/
104112
- run:
105-
name: Run and setup container
106-
command: |
107-
supervisord &
108-
npm run docker -- setup
113+
name: Install kaleido, plotly.io and required fonts
114+
command: .circleci/env_image.sh
109115
- run:
110-
name: Run image tests
111-
command: ./.circleci/test.sh image2
116+
name: Install poppler-utils to have pdftops for exporting eps
117+
command: sudo apt-get install poppler-utils
118+
- run:
119+
name: Create svg, jpg, jpeg, webp, pdf and eps files
120+
command: python3 test/image/make_exports.py
121+
- persist_to_workspace:
122+
root: ~/
123+
paths:
124+
- plotly.js
125+
126+
test-exports:
127+
docker:
128+
- image: circleci/node:12.22.1
129+
working_directory: ~/plotly.js
130+
steps:
131+
- attach_workspace:
132+
at: ~/
133+
- run:
134+
name: Test export sizes
135+
command: node test/image/export_test.js ; find build -maxdepth 1 -type f -delete
112136
- store_artifacts:
113137
path: build
114138
destination: /
115139

116-
test-syntax:
140+
mock-validation:
117141
docker:
118-
- image: circleci/node:12.13.0
142+
- image: circleci/node:12.22.1
119143
working_directory: ~/plotly.js
120144
steps:
121145
- attach_workspace:
122146
at: ~/
123147
- run:
124-
name: Run syntax tests
125-
command: ./.circleci/test.sh syntax
148+
name: Test validation using node.js and jsdom
149+
command: npm run test-plain-obj
150+
- run:
151+
name: Validate mocks
152+
command: npm run test-mock
126153

127-
test-bundle:
154+
source-syntax:
128155
docker:
129-
# need '-browsers' version to test in real (xvfb-wrapped) browsers
130-
- image: circleci/node:12.13.0-browsers
156+
- image: circleci/node:12.22.1
131157
working_directory: ~/plotly.js
132158
steps:
133159
- attach_workspace:
134160
at: ~/
135161
- run:
136-
name: Run test-bundle
137-
command: ./.circleci/test.sh bundle
162+
name: Run syntax tests on source files
163+
command: .circleci/test.sh source-syntax
138164

139-
publish:
165+
jasmine-bundle:
140166
docker:
141-
- image: circleci/node:12.13.0
167+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
168+
- image: circleci/node:12.22.1-browsers
142169
working_directory: ~/plotly.js
143170
steps:
144171
- attach_workspace:
145172
at: ~/
173+
- run:
174+
name: Run jasmine tests (part D)
175+
command: .circleci/test.sh jasmine-bundle
176+
177+
publish-dist:
178+
docker:
179+
- image: circleci/node:12.22.1
180+
working_directory: ~/plotly.js
181+
steps:
182+
- checkout
183+
- run:
184+
name: Set up build environment
185+
command: .circleci/env_build.sh
186+
- run:
187+
name: Preview CHANGELOG for next release (only on master)
188+
command: |
189+
if [ $CIRCLE_BRANCH == "master" ]
190+
then npm run use-draftlogs && git --no-pager diff --color-words CHANGELOG.md || true
191+
fi
192+
- run:
193+
name: Set draft version in package.json
194+
command: |
195+
node --eval "var fs = require('fs'); var inOut = './package.json'; var data = JSON.parse(fs.readFileSync(inOut)); var a = process.argv; data.version = a[a.length - 1].replace('v', ''); fs.writeFileSync(inOut, JSON.stringify(data, null, 2) + '\n');" `git describe`
196+
- run:
197+
name: View package.json diff between previous and next releases (including above draft version change)
198+
command: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) package.json || true
146199
- run:
147200
name: Build dist/
148201
command: npm run build
149202
- store_artifacts:
150203
path: dist
151204
destination: dist
205+
- run:
206+
name: Preview plot-schema diff between previous and next releases (only on master)
207+
command: |
208+
if [ $CIRCLE_BRANCH == "master" ]
209+
then git --no-pager diff tags/$(git describe --tags --abbrev=0) dist/plot-schema.json || true
210+
fi
152211
- run:
153212
name: Pack tarball
154213
command: |
155214
npm pack
156-
version=$(node -e "console.log(require('./package.json').version)")
215+
version=$(node --eval "console.log(require('./package.json').version)")
157216
mv plotly.js-$version.tgz plotly.js.tgz
158217
- store_artifacts:
159218
path: plotly.js.tgz
@@ -166,33 +225,56 @@ jobs:
166225
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.js
167226
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.min.js
168227
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plot-schema.json
228+
- run:
229+
name: Test plot-schema.json diff - If failed, after (npm start) you could run (npm run schema && git add test/plot-schema.json && git commit -m "update plot-schema diff")
230+
command: diff --unified --color dist/plot-schema.json test/plot-schema.json
231+
- run:
232+
name: Test plotly.min.js import using requirejs
233+
command: npm run test-requirejs
234+
- run:
235+
name: Test plotly bundles againt unexpected characters
236+
command: npm run no-bad-char
237+
- run:
238+
name: Test certain bundles against function constructors
239+
command: npm run no-new-func
240+
- run:
241+
name: Test plotly bundles against es6
242+
command: npm run no-es6-dist
169243

170244
workflows:
171245
version: 2
172246
build-and-test:
173247
jobs:
174-
- build
175-
- test-bundle:
248+
- install-and-cibuild
249+
- jasmine-bundle:
176250
requires:
177-
- build
178-
- test-jasmine:
251+
- install-and-cibuild
252+
- no-gl-jasmine:
179253
requires:
180-
- build
181-
- test-jasmine2:
254+
- install-and-cibuild
255+
- webgl-jasmine:
182256
requires:
183-
- build
184-
- test-jasmine3:
257+
- install-and-cibuild
258+
- flaky-no-gl-jasmine:
185259
requires:
186-
- build
187-
- test-image:
260+
- install-and-cibuild
261+
- make-baselines:
188262
requires:
189-
- build
190-
- test-image2:
263+
- install-and-cibuild
264+
- test-baselines:
191265
requires:
192-
- build
193-
- test-syntax:
266+
- make-baselines
267+
- make-exports:
194268
requires:
195-
- build
196-
- publish:
269+
- install-and-cibuild
270+
- test-exports:
197271
requires:
198-
- build
272+
- make-exports
273+
- mock-validation:
274+
requires:
275+
- install-and-cibuild
276+
- source-syntax:
277+
requires:
278+
- install-and-cibuild
279+
280+
- publish-dist

0 commit comments

Comments
 (0)