File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -17,11 +17,18 @@ sleep 5
17
17
node apps/remix-ide/ci/splice_tests.js $2 $3
18
18
TESTFILES=$( node apps/remix-ide/ci/splice_tests.js $2 $3 | grep -v ' metamask' | circleci tests split --split-by=timings)
19
19
for TESTFILE in $TESTFILES ; do
20
- npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch-${1} .js dist/apps/remix-ide-e2e/src/tests/${TESTFILE} .js --env=$1 || npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch-${1} .js dist/apps/remix-ide-e2e/src/tests/${TESTFILE} .js --env=$1 || TEST_EXITCODE=1
20
+ if ! npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch-${1} .js dist/apps/remix-ide-e2e/src/tests/${TESTFILE} .js --env=$1 ; then
21
+ TEST_EXITCODE=1
22
+ break
23
+ fi
21
24
done
22
25
23
26
echo " $TEST_EXITCODE "
24
- if [ " $TEST_EXITCODE " -eq 1 ]
25
- then
27
+ # Fail the test early and cancel the workflow
28
+ if [ " $TEST_EXITCODE " -eq 1 ]; then
29
+ echo " ❌ Test failed. Attempting to cancel the workflow..."
30
+ curl -s -X POST " https://circleci.com/api/v2/workflow/${CIRCLE_WORKFLOW_ID} /cancel" \
31
+ -H " Circle-Token: $FAIL_FAST_TOKEN " \
32
+ -H " Content-Type: application/json"
26
33
exit 1
27
34
fi
You can’t perform that action at this time.
0 commit comments