Skip to content

Commit

Permalink
Merge pull request #5863 from plotly/set-timezone-circleci
Browse files Browse the repository at this point in the history
use CircleCI environment TZ to set timezone
  • Loading branch information
archmoj authored Jul 28, 2021
2 parents 5c00c81 + 93e0e59 commit 51eded4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
12 changes: 12 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
docker:
# need '-browsers' version to test in real (xvfb-wrapped) browsers
- image: circleci/node:12.22.1-browsers
environment:
# Alaska time (arbitrary timezone to test date logic)
TZ: "America/Anchorage"
parallelism: 8
working_directory: ~/plotly.js
steps:
Expand All @@ -48,6 +51,9 @@ jobs:
docker:
# need '-browsers' version to test in real (xvfb-wrapped) browsers
- image: circleci/node:12.22.1-browsers
environment:
# Alaska time (arbitrary timezone to test date logic)
TZ: "America/Anchorage"
parallelism: 8
working_directory: ~/plotly.js
steps:
Expand All @@ -61,6 +67,9 @@ jobs:
docker:
# need '-browsers' version to test in real (xvfb-wrapped) browsers
- image: circleci/node:12.22.1-browsers
environment:
# Alaska time (arbitrary timezone to test date logic)
TZ: "America/Anchorage"
working_directory: ~/plotly.js
steps:
- attach_workspace:
Expand All @@ -73,6 +82,9 @@ jobs:
docker:
# need '-browsers' version to test in real (xvfb-wrapped) browsers
- image: circleci/node:12.22.1-browsers
environment:
# Alaska time (arbitrary timezone to test date logic)
TZ: "America/Anchorage"
working_directory: ~/plotly.js
steps:
- attach_workspace:
Expand Down
21 changes: 0 additions & 21 deletions .circleci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,9 @@ retry () {
fi
}

set_timezone () {
# Alaska time (arbitrary timezone to test date logic)
TZ="America/Anchorage"

echo "set timezone to $TZ"
sudo cp /usr/share/zoneinfo/$TZ /etc/localtime

echo "display date in timezone"
date

export TZ
}

case $1 in

no-gl-jasmine)
set_timezone

SUITE=$(circleci tests glob "$ROOT/test/jasmine/tests/*" | circleci tests split)
MAX_AUTO_RETRY=2
retry npm run test-jasmine -- $SUITE --skip-tags=gl,noCI,flaky || EXIT_STATE=$?
Expand All @@ -59,8 +44,6 @@ case $1 in
;;

webgl-jasmine)
set_timezone

SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --limit=5 --tag=gl | circleci tests split))
for s in ${SHARDS[@]}; do
MAX_AUTO_RETRY=2
Expand All @@ -71,8 +54,6 @@ case $1 in
;;

flaky-no-gl-jasmine)
set_timezone

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

for s in ${SHARDS[@]}; do
Expand All @@ -84,8 +65,6 @@ case $1 in
;;

bundle-jasmine)
set_timezone

npm run test-bundle || EXIT_STATE=$?
exit $EXIT_STATE
;;
Expand Down

0 comments on commit 51eded4

Please sign in to comment.