Skip to content

Commit c32ab77

Browse files
committed
script
1 parent bd825a7 commit c32ab77

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

apps/remix-ide/ci/browser_test.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,22 @@ sleep 5
1515
# grep -IRiL "@disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | xargs -I {} basename {} .test.js | grep -E "\b[${2}]"
1616
# 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 )
1717
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
1822
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)
2430
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)
2834

2935
echo "$TEST_EXITCODE"
3036
if [ "$TEST_EXITCODE" -eq 1 ]

0 commit comments

Comments
 (0)