Skip to content

Commit f4f95f5

Browse files
committed
move timezone setup to test.sh
... so that env variable can be accessed by jasmine tests
1 parent 9c63701 commit f4f95f5

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

.circleci/config.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@ jobs:
5353
- checkout
5454
- attach_workspace:
5555
at: ~/plotly.js
56-
- run:
57-
name: Set timezone to Alaska time (arbitrary timezone to test date logic)
58-
command: |
59-
sudo cp /usr/share/zoneinfo/America/Anchorage /etc/localtime
60-
export TZ='America/Anchorage'
6156
- run:
6257
name: Run jasmine tests (batch 1)
6358
command: ./.circleci/test.sh jasmine
@@ -71,11 +66,6 @@ jobs:
7166
- checkout
7267
- attach_workspace:
7368
at: ~/plotly.js
74-
- run:
75-
name: Set timezone to Alaska time (arbitrary timezone to test date logic)
76-
command: |
77-
sudo cp /usr/share/zoneinfo/America/Anchorage /etc/localtime
78-
export TZ='America/Anchorage'
7969
- run:
8070
name: Run jasmine tests (batch 2)
8171
command: ./.circleci/test.sh jasmine2

.circleci/test.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,27 @@ 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+
3642
case $1 in
3743

3844
jasmine)
45+
set_tz
46+
3947
npm run test-jasmine -- --skip-tags=gl,noCI,flaky || EXIT_STATE=$?
4048
retry npm run test-jasmine -- --tags=flaky --skip-tags=noCI
4149
npm run test-bundle || EXIT_STATE=$?
50+
4251
exit $EXIT_STATE
4352
;;
4453

4554
jasmine2)
55+
set_tz
56+
4657
SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --tag=gl))
4758

4859
for s in ${SHARDS[@]}; do

0 commit comments

Comments
 (0)