From 0c7ddc7ea7670d826adc2429bcb3921dcc5a78e0 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Sat, 23 Nov 2024 00:07:08 +0530 Subject: [PATCH] fix: mocha artifacts --- .circleci/setupAndTestWithAuthReact.sh | 7 ++----- .circleci/setupAndTestWithAuthReactWithDjango.sh | 7 ++----- .circleci/setupAndTestWithAuthReactWithFlask.sh | 7 ++----- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/.circleci/setupAndTestWithAuthReact.sh b/.circleci/setupAndTestWithAuthReact.sh index 9433229b..66a69f59 100755 --- a/.circleci/setupAndTestWithAuthReact.sh +++ b/.circleci/setupAndTestWithAuthReact.sh @@ -117,12 +117,9 @@ sleep 2 # Because the server is responding does not mean the app is ready. Let's echo "Start mocha testing" -if ! [[ -z "${CI}" ]]; then - export SPEC_FILES=$(circleci tests glob 'test/end-to-end/**/*.test.js' 'test/unit/**/*.test.js') - echo "Selected spec files: $SPEC_FILES, $CIRCLE_NODE_TOTAL/$CIRCLE_NODE_INDEX" -fi +export SPEC_FILES=$(circleci tests glob 'test/end-to-end/**/*.test.js' 'test/unit/**/*.test.js') +echo $SPEC_FILES | SCREENSHOT_ROOT=~/test_report/screenshots APP_SERVER=$apiPort TEST_MODE=testing multi="spec=- mocha-junit-reporter=/dev/null" circleci tests run --command="xargs npx mocha mocha --reporter mocha-multi --require @babel/register --require test/test.mocha.env --timeout 40000 --no-config" --verbose --split-by=timings -SCREENSHOT_ROOT=~/test_report/screenshots APP_SERVER=$apiPort TEST_MODE=testing npx mocha --bail=$BAIL --require @babel/register --require test/test.mocha.env --timeout 40000 --no-config $SPEC_FILES testPassed=$?; echo "testPassed exit code: $testPassed" diff --git a/.circleci/setupAndTestWithAuthReactWithDjango.sh b/.circleci/setupAndTestWithAuthReactWithDjango.sh index 8a10f505..8a4b5f8e 100755 --- a/.circleci/setupAndTestWithAuthReactWithDjango.sh +++ b/.circleci/setupAndTestWithAuthReactWithDjango.sh @@ -119,12 +119,9 @@ sleep 2 # Because the server is responding does not mean the app is ready. Let's echo "Start mocha testing" -if ! [[ -z "${CI}" ]]; then - export SPEC_FILES=$(circleci tests glob 'test/end-to-end/**/*.test.js' 'test/unit/**/*.test.js') - echo "Selected spec files: $SPEC_FILES, $CIRCLE_NODE_TOTAL/$CIRCLE_NODE_INDEX" -fi +export SPEC_FILES=$(circleci tests glob 'test/end-to-end/**/*.test.js' 'test/unit/**/*.test.js') +echo $SPEC_FILES | SCREENSHOT_ROOT=~/test_report/screenshots APP_SERVER=$apiPort TEST_MODE=testing multi="spec=- mocha-junit-reporter=/dev/null" circleci tests run --command="xargs npx mocha mocha --reporter mocha-multi --require @babel/register --require test/test.mocha.env --timeout 40000 --no-config" --verbose --split-by=timings -SCREENSHOT_ROOT=~/test_report/screenshots APP_SERVER=$apiPort TEST_MODE=testing npx mocha --bail=$BAIL --require @babel/register --require test/test.mocha.env --timeout 40000 --no-config $SPEC_FILES testPassed=$?; echo "testPassed exit code: $testPassed" diff --git a/.circleci/setupAndTestWithAuthReactWithFlask.sh b/.circleci/setupAndTestWithAuthReactWithFlask.sh index 5e34877c..363650d9 100755 --- a/.circleci/setupAndTestWithAuthReactWithFlask.sh +++ b/.circleci/setupAndTestWithAuthReactWithFlask.sh @@ -119,12 +119,9 @@ sleep 2 # Because the server is responding does not mean the app is ready. Let's echo "Start mocha testing" -if ! [[ -z "${CI}" ]]; then - export SPEC_FILES=$(circleci tests glob 'test/end-to-end/**/*.test.js' 'test/unit/**/*.test.js') - echo "Selected spec files: $SPEC_FILES, $CIRCLE_NODE_TOTAL/$CIRCLE_NODE_INDEX" -fi +export SPEC_FILES=$(circleci tests glob 'test/end-to-end/**/*.test.js' 'test/unit/**/*.test.js') +echo $SPEC_FILES | SCREENSHOT_ROOT=~/test_report/screenshots APP_SERVER=$apiPort TEST_MODE=testing multi="spec=- mocha-junit-reporter=/dev/null" circleci tests run --command="xargs npx mocha mocha --reporter mocha-multi --require @babel/register --require test/test.mocha.env --timeout 40000 --no-config" --verbose --split-by=timings -SCREENSHOT_ROOT=~/test_report/screenshots APP_SERVER=$apiPort TEST_MODE=testing npx mocha --bail=$BAIL --require @babel/register --require test/test.mocha.env --timeout 40000 --no-config $SPEC_FILES testPassed=$?; echo "testPassed exit code: $testPassed"