From 2b105002de8daee7876f66f2c523c4d212ffb4be Mon Sep 17 00:00:00 2001 From: filip mertens Date: Tue, 3 May 2022 18:35:34 +0200 Subject: [PATCH] count files first --- apps/remix-ide/ci/flaky.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/ci/flaky.sh b/apps/remix-ide/ci/flaky.sh index 21bfa1855b..f0f2ccdfa2 100755 --- a/apps/remix-ide/ci/flaky.sh +++ b/apps/remix-ide/ci/flaky.sh @@ -2,6 +2,17 @@ set -e +TESTFILES=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.flaky" | sort ) + +# count test files +fileCount=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.flaky" | wc -l ) +# if fileCount is 0 +if [ $fileCount -eq 0 ] +then + echo "No flaky tests found" + exit 1 +fi + BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}} echo "$BUILD_ID" TEST_EXITCODE=0 @@ -15,7 +26,6 @@ sleep 5 npm run build:e2e -TESTFILES=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.flaky" | sort ) for TESTFILE in $TESTFILES; do npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=$1 || TEST_EXITCODE=1 done