Skip to content

Commit 94ad518

Browse files
devversionjelbourn
authored andcommitted
build: fix cronjob tests not running against snapshots (#14327)
* Due to the fact that the `CIRCLE_WORKFLOW_ID` does not actually return the name of the workflow, but a unique id that is generated dynamically, the cronjob does not run against the Angular github builds.
1 parent bb19dfc commit 94ad518

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

.circleci/config.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,21 @@ jobs:
265265

266266
- run: ./scripts/circleci/publish-snapshots.sh
267267

268+
269+
# ----------------------------------------------------------------------------
270+
# Job that runs the local browser tests against the Angular Github snapshots
271+
# ----------------------------------------------------------------------------
272+
snapshot_tests_local_browsers:
273+
docker: *docker-firefox-image
274+
resource_class: xlarge
275+
steps:
276+
- *checkout_code
277+
- *restore_cache
278+
- *yarn_install
279+
280+
- run: ./scripts/install-angular-snapshots.sh
281+
- run: ./scripts/circleci/run-local-browser-tests.sh
282+
268283
# ----------------------------------------------------------------------------------------
269284
# Workflow definitions. A workflow usually groups multiple jobs together. This is useful if
270285
# one job depends on another.
@@ -311,7 +326,10 @@ workflows:
311326
# This workflow runs various jobs against the Angular snapshot builds from Github.
312327
snapshot_tests:
313328
jobs:
314-
- tests_local_browsers
329+
# Note that we need additional jobs for the nightly snapshot tests because there is no
330+
# easy way to detect whether a job runs inside of a cronjob or specific workflow.
331+
# See: https://circleci.com/ideas/?idea=CCI-I-295
332+
- snapshot_tests_local_browsers
315333
triggers:
316334
- schedule:
317335
cron: "0 0 * * *"

scripts/circleci/run-local-browser-tests.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ set -e
77
# Go to project directory.
88
cd $(dirname ${0})/../..
99

10-
# In case the "snapshot_tests" workflow is currently running this script, we
11-
# want to run the local browser tests against the Angular snapshot builds.
12-
if [[ "${CIRCLE_WORKFLOW_ID}" == "snapshot_tests" ]]; then
13-
./scripts/install-angular-snapshots.sh
14-
fi
15-
1610
# Setup the test platform environment variable that will be read
1711
# by the Karma configuration script.
1812
export TEST_PLATFORM="local"

0 commit comments

Comments
 (0)