Skip to content

Commit 3ce862b

Browse files
authored
ci: fix parallel run CI job (#201)
* ci: added parallelism to tests + job level retries in CI * ci: fix parallel run CI job
1 parent 843e537 commit 3ce862b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.circleci/setupAndTestWithFreeCore.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,15 @@ cd ../project/test/server/
4848
npm i -d --force
4949
npm i git+https://github.com:supertokens/supertokens-node.git#$2
5050
cd ../../test/server/
51+
echo "Kill servers using port 8082."
52+
lsof -i tcp:8082 | grep -m 1 node | awk '{printf $2}' | cut -c 1- | xargs -I {} kill -9 {} > /dev/null 2>&1
53+
echo "Start new test server."
5154
TEST_MODE=testing INSTALL_PATH=../../../supertokens-root NODE_PORT=8082 node . &
5255
pid=$!
5356
cd ../../
5457

5558
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')
59+
SUPERTOKENS_CORE_TAG=$coreTag INSTALL_PATH=../supertokens-root multi="spec=- mocha-junit-reporter=/dev/null" npx 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')
5760
else
5861
SUPERTOKENS_CORE_TAG=$coreTag INSTALL_PATH=../supertokens-root npm test
5962
fi

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"scripts": {
3838
"check-circular-dependencies": "npx madge --circular --extensions js ./lib/build/",
3939
"test": "TEST_MODE=testing npx mocha --timeout 500000",
40-
"test-ci": "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 4 -g 0 -f 'test/*.test.js')",
4140
"build-check": "cd lib && npx tsc -p tsconfig.json --noEmit && cd ../test/ && npx tsc -p tsconfig.json --noEmit",
4241
"build": "cd lib && rm -rf build && npx tsc -p tsconfig.json && cd ../ && npm run pack && cd test && npx tsc -p tsconfig.json",
4342
"pretty": "cd lib && npx prettier --write --config .prettierrc \"ts/**/*.ts\" \"build/**/*.js\" \"../test/**/*.js\"",

0 commit comments

Comments
 (0)