@@ -15,16 +15,22 @@ sleep 5
15
15
# grep -IRiL "@disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | xargs -I {} basename {} .test.js | grep -E "\b[${2}]"
16
16
# TESTFILES=$(grep -IRiL "@disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | xargs -I {} basename {} .test.js | grep -E "\b[$2]" | circleci tests split --split-by=timings )
17
17
node apps/remix-ide/ci/splice_tests.js $2 $3
18
+ # Get initial test files (without 'metamask' tests)
19
+ TESTFILES=$( node apps/remix-ide/ci/splice_tests.js $2 $3 | grep -v ' metamask' )
20
+
21
+ # If $4 is provided, filter by it
18
22
if [ -n " $4 " ]; then
19
- # If $4 is NOT empty, use it for filtering
20
- TESTFILES=$( node apps/remix-ide/ci/splice_tests.js $2 $3 | grep -v ' metamask' | grep " $4 " | circleci tests split --split-by=timings)
21
- else
22
- # If $4 is empty, run without additional filtering
23
- TESTFILES=$( node apps/remix-ide/ci/splice_tests.js $2 $3 | grep -v ' metamask' | circleci tests split --split-by=timings)
23
+ TESTFILES=$( echo " $TESTFILES " | grep " $4 " )
24
+ fi
25
+
26
+ # Check if TESTFILES has content
27
+ if [ -z " $TESTFILES " ]; then
28
+ echo " No test files found after filtering. Exiting."
29
+ exit 0 # ✅ Exit gracefully (change to exit 1 if failure is preferred)
24
30
fi
25
- for TESTFILE in $TESTFILES ; do
26
- 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
27
- done
31
+
32
+ # Split tests only if there are valid test files
33
+ TESTFILES= $( echo " $TESTFILES " | circleci tests split --split-by=timings )
28
34
29
35
echo " $TEST_EXITCODE "
30
36
if [ " $TEST_EXITCODE " -eq 1 ]
0 commit comments