Skip to content

Commit b08416b

Browse files
author
Domino987
committedAug 4, 2021
Merge remote-tracking branch 'upstream/master' into patch-2
2 parents 8f5f3d5 + e27ca3c commit b08416b

Some content is hidden

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

47 files changed

+1594
-17158
lines changed
 

‎.circleci/config.yml

+60-13
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,42 @@ jobs:
3131
paths:
3232
- plotly.js
3333

34+
timezone-jasmine:
35+
docker:
36+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
37+
- image: circleci/node:12.22.1-browsers
38+
working_directory: ~/plotly.js
39+
steps:
40+
- attach_workspace:
41+
at: ~/
42+
- run:
43+
name: Run hover_label test in UTC timezone
44+
environment:
45+
TZ: "UTC"
46+
command: date && npm run test-jasmine hover_label
47+
- run:
48+
name: Run hover_label test in Europe/Berlin timezone
49+
environment:
50+
TZ: "Europe/Berlin"
51+
command: date && npm run test-jasmine hover_label
52+
- run:
53+
name: Run hover_label test in Asia/Tokyo timezone
54+
environment:
55+
TZ: "Asia/Tokyo"
56+
command: date && npm run test-jasmine hover_label
57+
- run:
58+
name: Run hover_label test in America/Toronto timezone
59+
environment:
60+
TZ: "America/Toronto"
61+
command: date && npm run test-jasmine hover_label
62+
3463
no-gl-jasmine:
3564
docker:
3665
# need '-browsers' version to test in real (xvfb-wrapped) browsers
3766
- image: circleci/node:12.22.1-browsers
67+
environment:
68+
# Alaska time (arbitrary timezone to test date logic)
69+
TZ: "America/Anchorage"
3870
parallelism: 8
3971
working_directory: ~/plotly.js
4072
steps:
@@ -48,6 +80,9 @@ jobs:
4880
docker:
4981
# need '-browsers' version to test in real (xvfb-wrapped) browsers
5082
- image: circleci/node:12.22.1-browsers
83+
environment:
84+
# Alaska time (arbitrary timezone to test date logic)
85+
TZ: "America/Anchorage"
5186
parallelism: 8
5287
working_directory: ~/plotly.js
5388
steps:
@@ -61,6 +96,9 @@ jobs:
6196
docker:
6297
# need '-browsers' version to test in real (xvfb-wrapped) browsers
6398
- image: circleci/node:12.22.1-browsers
99+
environment:
100+
# Alaska time (arbitrary timezone to test date logic)
101+
TZ: "America/Anchorage"
64102
working_directory: ~/plotly.js
65103
steps:
66104
- attach_workspace:
@@ -69,6 +107,21 @@ jobs:
69107
name: Run jasmine tests (part C)
70108
command: .circleci/test.sh flaky-no-gl-jasmine
71109

110+
bundle-jasmine:
111+
docker:
112+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
113+
- image: circleci/node:12.22.1-browsers
114+
environment:
115+
# Alaska time (arbitrary timezone to test date logic)
116+
TZ: "America/Anchorage"
117+
working_directory: ~/plotly.js
118+
steps:
119+
- attach_workspace:
120+
at: ~/
121+
- run:
122+
name: Run jasmine tests (part D)
123+
command: .circleci/test.sh bundle-jasmine
124+
72125
make-baselines:
73126
parallelism: 4
74127
docker:
@@ -162,18 +215,6 @@ jobs:
162215
name: Run syntax tests on source files
163216
command: .circleci/test.sh source-syntax
164217

165-
jasmine-bundle:
166-
docker:
167-
# need '-browsers' version to test in real (xvfb-wrapped) browsers
168-
- image: circleci/node:12.22.1-browsers
169-
working_directory: ~/plotly.js
170-
steps:
171-
- attach_workspace:
172-
at: ~/
173-
- run:
174-
name: Run jasmine tests (part D)
175-
command: .circleci/test.sh jasmine-bundle
176-
177218
publish-dist:
178219
docker:
179220
- image: circleci/node:12.22.1
@@ -234,6 +275,9 @@ jobs:
234275
- run:
235276
name: Test plotly bundles againt unexpected characters
236277
command: npm run no-bad-char
278+
- run:
279+
name: Display function constructors in plotly.js bundle
280+
command: npm run log-new-func
237281
- run:
238282
name: Test certain bundles against function constructors
239283
command: npm run no-new-func
@@ -246,7 +290,10 @@ workflows:
246290
build-and-test:
247291
jobs:
248292
- install-and-cibuild
249-
- jasmine-bundle:
293+
- timezone-jasmine:
294+
requires:
295+
- install-and-cibuild
296+
- bundle-jasmine:
250297
requires:
251298
- install-and-cibuild
252299
- no-gl-jasmine:

‎.circleci/test.sh

+5-18
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,9 @@ retry () {
3333
fi
3434
}
3535

36-
# set timezone to Alaska time (arbitrary timezone to test date logic)
37-
set_tz () {
38-
sudo cp /usr/share/zoneinfo/America/Anchorage /etc/localtime
39-
export TZ='America/Anchorage'
40-
}
41-
4236
case $1 in
4337

4438
no-gl-jasmine)
45-
set_tz
46-
4739
SUITE=$(circleci tests glob "$ROOT/test/jasmine/tests/*" | circleci tests split)
4840
MAX_AUTO_RETRY=2
4941
retry npm run test-jasmine -- $SUITE --skip-tags=gl,noCI,flaky || EXIT_STATE=$?
@@ -52,8 +44,6 @@ case $1 in
5244
;;
5345

5446
webgl-jasmine)
55-
set_tz
56-
5747
SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --limit=5 --tag=gl | circleci tests split))
5848
for s in ${SHARDS[@]}; do
5949
MAX_AUTO_RETRY=2
@@ -64,8 +54,6 @@ case $1 in
6454
;;
6555

6656
flaky-no-gl-jasmine)
67-
set_tz
68-
6957
SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --limit=1 --tag=flaky | circleci tests split))
7058

7159
for s in ${SHARDS[@]}; do
@@ -76,6 +64,11 @@ case $1 in
7664
exit $EXIT_STATE
7765
;;
7866

67+
bundle-jasmine)
68+
npm run test-bundle || EXIT_STATE=$?
69+
exit $EXIT_STATE
70+
;;
71+
7972
make-baselines)
8073
SUITE=$(find $ROOT/test/image/mocks/ -type f -printf "%f\n" | sed 's/\.json$//1' | circleci tests split)
8174
python3 test/image/make_baseline.py $SUITE || EXIT_STATE=$?
@@ -87,12 +80,6 @@ case $1 in
8780
exit $EXIT_STATE
8881
;;
8982

90-
jasmine-bundle)
91-
set_tz
92-
npm run test-bundle || EXIT_STATE=$?
93-
exit $EXIT_STATE
94-
;;
95-
9683
source-syntax)
9784
npm run lint || EXIT_STATE=$?
9885
npm run test-syntax || EXIT_STATE=$?

0 commit comments

Comments
 (0)