Skip to content

Commit ab5c8a7

Browse files
authored
ci: added parallelism to tests + job level retries in CI (#200)
1 parent 36d93ff commit ab5c8a7

File tree

4 files changed

+533
-19
lines changed

4 files changed

+533
-19
lines changed

.circleci/config_continue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- checkout
2424
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
2525
- run: npm i -d
26-
- run: (cd .circleci/ && ./doTests.sh << parameters.fdi-version >>)
26+
- run: for i in $(seq 1 5); do (cd .circleci/ && ./doTests.sh << parameters.fdi-version >>) && s=0 && break || s=$? && sleep 10; done; (exit $s) # https://support.circleci.com/hc/en-us/articles/5728720104347-How-To-Retry-an-Intermittently-Failing-Step
2727
- run: npm run size
2828
- run: npm run check-circular-dependencies
2929
test-success:

.circleci/setupAndTestWithFreeCore.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,13 @@ cd ../../test/server/
5151
TEST_MODE=testing INSTALL_PATH=../../../supertokens-root NODE_PORT=8082 node . &
5252
pid=$!
5353
cd ../../
54-
SUPERTOKENS_CORE_TAG=$coreTag INSTALL_PATH=../supertokens-root npm test
54+
55+
if ! [[ -z "${CIRCLE_NODE_TOTAL}" ]]; then
56+
SUPERTOKENS_CORE_TAG=$coreTag INSTALL_PATH=../supertokens-root multi="spec=- mocha-junit-reporter=/dev/null" mocha --reporter mocha-multi --no-config --require isomorphic-fetch --timeout 500000 $(npx mocha-split-tests -r ./runtime.log -t $CIRCLE_NODE_TOTAL -g $CIRCLE_NODE_INDEX -f 'test/*.test.js')
57+
else
58+
SUPERTOKENS_CORE_TAG=$coreTag INSTALL_PATH=../supertokens-root npm test
59+
fi
60+
5561
if [[ $? -ne 0 ]]
5662
then
5763
echo "test failed... exiting!"

0 commit comments

Comments
 (0)