Skip to content

Revisit setting timezone on CircleCI #5860

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 3 commits 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
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ jobs:
name: Run syntax tests on source files
command: .circleci/test.sh source-syntax

jasmine-bundle:
bundle-jasmine:
docker:
# need '-browsers' version to test in real (xvfb-wrapped) browsers
- image: circleci/node:12.22.1-browsers
Expand All @@ -172,7 +172,7 @@ jobs:
at: ~/
- run:
name: Run jasmine tests (part D)
command: .circleci/test.sh jasmine-bundle
command: .circleci/test.sh bundle-jasmine

publish-dist:
docker:
Expand Down Expand Up @@ -246,7 +246,7 @@ workflows:
build-and-test:
jobs:
- install-and-cibuild
- jasmine-bundle:
- bundle-jasmine:
requires:
- install-and-cibuild
- no-gl-jasmine:
Expand Down
34 changes: 21 additions & 13 deletions .circleci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,23 @@ retry () {
fi
}

# set timezone to Alaska time (arbitrary timezone to test date logic)
set_tz () {
sudo cp /usr/share/zoneinfo/America/Anchorage /etc/localtime
export TZ='America/Anchorage'
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_tz
set_timezone

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

webgl-jasmine)
set_tz
set_timezone

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

flaky-no-gl-jasmine)
set_tz
set_timezone

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

Expand All @@ -76,6 +83,13 @@ case $1 in
exit $EXIT_STATE
;;

bundle-jasmine)
set_timezone

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

make-baselines)
SUITE=$(find $ROOT/test/image/mocks/ -type f -printf "%f\n" | sed 's/\.json$//1' | circleci tests split)
python3 test/image/make_baseline.py $SUITE || EXIT_STATE=$?
Expand All @@ -87,12 +101,6 @@ case $1 in
exit $EXIT_STATE
;;

jasmine-bundle)
set_tz
npm run test-bundle || EXIT_STATE=$?
exit $EXIT_STATE
;;

source-syntax)
npm run lint || EXIT_STATE=$?
npm run test-syntax || EXIT_STATE=$?
Expand Down