From 87a559002efdb25e23ec8bb1de65a5fb570420ab Mon Sep 17 00:00:00 2001 From: Deepjyoti Barman Date: Tue, 3 Dec 2024 14:42:00 +0530 Subject: [PATCH] Add some improvements for proper partial re-run support in circle CI --- .circleci/setupAndTestBackendSDKWithFreeCore.sh | 5 ++++- .circleci/setupAndTestWithFreeCore.sh | 4 +++- .circleci/setupAndTestWithFrontend.sh | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.circleci/setupAndTestBackendSDKWithFreeCore.sh b/.circleci/setupAndTestBackendSDKWithFreeCore.sh index 73ccae565..d318a6b28 100755 --- a/.circleci/setupAndTestBackendSDKWithFreeCore.sh +++ b/.circleci/setupAndTestBackendSDKWithFreeCore.sh @@ -61,6 +61,8 @@ fi echo "Testing with FREE core: $coreVersion, plugin-interface: $pluginInterfaceVersion" +mkdir -p ~/test_report + cd ../../ git clone git@github.com:supertokens/supertokens-root.git cd supertokens-root @@ -107,7 +109,8 @@ git checkout $frontendDriverVersion npm install npm run build -API_PORT=$API_PORT TEST_MODE=testing SUPERTOKENS_CORE_TAG=$coreTag NODE_PORT=8081 INSTALL_PATH=../supertokens-root multi="spec=- mocha-junit-reporter=./junit-results.xml" circleci tests run --command="xargs npx mocha mocha --node-option no-experimental-fetch -r test/fetch-polyfill.mjs --reporter mocha-multi --require @babel/register --require test/test.mocha.env --timeout 40000 --no-config -f test/**/*.test.js" --verbose --split-by=timings +TEST_FILES=$(circleci tests glob "test/**/*.test.js") +API_PORT=$API_PORT TEST_MODE=testing SUPERTOKENS_CORE_TAG=$coreTag NODE_PORT=8081 INSTALL_PATH=../supertokens-root multi="spec=- mocha-junit-reporter=~/test_report/junit-results.xml" echo "$TEST_FILES" | circleci tests run --command="xargs npx mocha mocha --node-option no-experimental-fetch -r test/fetch-polyfill.mjs --reporter mocha-multi --require @babel/register --require test/test.mocha.env --timeout 40000 --no-config" --verbose --split-by=timings # kill test-server kill $(lsof -t -i:$API_PORT) diff --git a/.circleci/setupAndTestWithFreeCore.sh b/.circleci/setupAndTestWithFreeCore.sh index 7368e393f..fcff86e4e 100755 --- a/.circleci/setupAndTestWithFreeCore.sh +++ b/.circleci/setupAndTestWithFreeCore.sh @@ -60,6 +60,7 @@ then fi echo "Testing with FREE core: $coreVersion, plugin-interface: $pluginInterfaceVersion" +mkdir -p ~/test_report cd ../../ git clone git@github.com:supertokens/supertokens-root.git cd supertokens-root @@ -88,4 +89,5 @@ cd ../project/ # Set the script to exit on error set -e -TEST_MODE=testing SUPERTOKENS_CORE_TAG=$coreTag NODE_PORT=8081 INSTALL_PATH=../supertokens-root multi="spec=- mocha-junit-reporter=./junit-results.xml" circleci tests run --command="xargs npx mocha mocha --node-option no-experimental-fetch -r test/fetch-polyfill.mjs --reporter mocha-multi --require @babel/register --require test/test.mocha.env --timeout 40000 --no-config -f test/**/*.test.js" --verbose --split-by=timings +TEST_FILES=$(circleci tests glob "test/**/*.test.js") +TEST_MODE=testing SUPERTOKENS_CORE_TAG=$coreTag NODE_PORT=8081 INSTALL_PATH=../supertokens-root multi="spec=- mocha-junit-reporter=./junit-results.xml" echo "$TEST_FILES" | circleci tests run --command="xargs npx mocha mocha --node-option no-experimental-fetch -r test/fetch-polyfill.mjs --reporter mocha-multi --require @babel/register --require test/test.mocha.env --timeout 40000 --no-config" --verbose --split-by=timings diff --git a/.circleci/setupAndTestWithFrontend.sh b/.circleci/setupAndTestWithFrontend.sh index f7753046e..0db76fe6e 100755 --- a/.circleci/setupAndTestWithFrontend.sh +++ b/.circleci/setupAndTestWithFrontend.sh @@ -61,6 +61,8 @@ fi echo "Testing with frontend website: $2, FREE core: $coreVersion, plugin-interface: $pluginInterfaceVersion" +mkdir -p ~/test_report + cd ../../ git clone git@github.com:supertokens/supertokens-root.git cd supertokens-root @@ -96,7 +98,8 @@ npm i cd ../../ npm i -d -TEST_MODE=testing SUPERTOKENS_CORE_TAG=$coreTag NODE_PORT=8081 INSTALL_PATH=../supertokens-root multi="spec=- mocha-junit-reporter=./junit-results.xml" circleci tests run --command="xargs npx mocha mocha --node-option no-experimental-fetch -r test/fetch-polyfill.mjs --reporter mocha-multi --require @babel/register --require test/test.mocha.env --timeout 40000 --no-config -f test/**/*.test.js" --verbose --split-by=timings +TEST_FILES=$(circleci tests glob "test/**/*.test.js") +TEST_MODE=testing SUPERTOKENS_CORE_TAG=$coreTag NODE_PORT=8081 INSTALL_PATH=../supertokens-root multi="spec=- mocha-junit-reporter=./junit-results.xml" echo "$TEST_FILES" | circleci tests run --command="xargs npx mocha mocha --node-option no-experimental-fetch -r test/fetch-polyfill.mjs --reporter mocha-multi --require @babel/register --require test/test.mocha.env --timeout 40000 --no-config" --verbose --split-by=timings if [[ $? -ne 0 ]] then