Skip to content

Commit e7bc16b

Browse files
authored
Merge pull request #5860 from plotly/revisit-setting-timezone
Revisit setting timezone on CircleCI
2 parents 256623e + 22890a0 commit e7bc16b

File tree

2 files changed

+24
-16
lines changed

2 files changed

+24
-16
lines changed

.circleci/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162
name: Run syntax tests on source files
163163
command: .circleci/test.sh source-syntax
164164

165-
jasmine-bundle:
165+
bundle-jasmine:
166166
docker:
167167
# need '-browsers' version to test in real (xvfb-wrapped) browsers
168168
- image: circleci/node:12.22.1-browsers
@@ -172,7 +172,7 @@ jobs:
172172
at: ~/
173173
- run:
174174
name: Run jasmine tests (part D)
175-
command: .circleci/test.sh jasmine-bundle
175+
command: .circleci/test.sh bundle-jasmine
176176

177177
publish-dist:
178178
docker:
@@ -246,7 +246,7 @@ workflows:
246246
build-and-test:
247247
jobs:
248248
- install-and-cibuild
249-
- jasmine-bundle:
249+
- bundle-jasmine:
250250
requires:
251251
- install-and-cibuild
252252
- no-gl-jasmine:

.circleci/test.sh

+21-13
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,23 @@ 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'
36+
set_timezone () {
37+
# Alaska time (arbitrary timezone to test date logic)
38+
TZ="America/Anchorage"
39+
40+
echo "set timezone to $TZ"
41+
sudo cp /usr/share/zoneinfo/$TZ /etc/localtime
42+
43+
echo "display date in timezone"
44+
date
45+
46+
export TZ
4047
}
4148

4249
case $1 in
4350

4451
no-gl-jasmine)
45-
set_tz
52+
set_timezone
4653

4754
SUITE=$(circleci tests glob "$ROOT/test/jasmine/tests/*" | circleci tests split)
4855
MAX_AUTO_RETRY=2
@@ -52,7 +59,7 @@ case $1 in
5259
;;
5360

5461
webgl-jasmine)
55-
set_tz
62+
set_timezone
5663

5764
SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --limit=5 --tag=gl | circleci tests split))
5865
for s in ${SHARDS[@]}; do
@@ -64,7 +71,7 @@ case $1 in
6471
;;
6572

6673
flaky-no-gl-jasmine)
67-
set_tz
74+
set_timezone
6875

6976
SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --limit=1 --tag=flaky | circleci tests split))
7077

@@ -76,6 +83,13 @@ case $1 in
7683
exit $EXIT_STATE
7784
;;
7885

86+
bundle-jasmine)
87+
set_timezone
88+
89+
npm run test-bundle || EXIT_STATE=$?
90+
exit $EXIT_STATE
91+
;;
92+
7993
make-baselines)
8094
SUITE=$(find $ROOT/test/image/mocks/ -type f -printf "%f\n" | sed 's/\.json$//1' | circleci tests split)
8195
python3 test/image/make_baseline.py $SUITE || EXIT_STATE=$?
@@ -87,12 +101,6 @@ case $1 in
87101
exit $EXIT_STATE
88102
;;
89103

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

0 commit comments

Comments
 (0)