Skip to content

use CircleCI environment TZ to set timezone #5863

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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