Skip to content

Commit bb8ede4

Browse files
authored
Merge pull request #1072 from supertokens/test-cicd/rerun_failed
test: enable/fix rerun failed test on ci-cd
2 parents 20bf94e + d745cb6 commit bb8ede4

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

.circleci/config.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,6 @@ jobs:
2424
- run: echo "listen_addresses='*'" >> /etc/postgresql/9.5/main/postgresql.conf
2525
- run: sed -i 's/^#*\s*max_connections\s*=.*/max_connections = 10000/' /etc/postgresql/9.5/main/postgresql.conf
2626
- run: (cd .circleci/ && ./doTests.sh << parameters.plugin >>)
27-
- run:
28-
command: cp ~/supertokens-root/supertokens-core/build/test-results/test/*.xml ~/junit/
29-
when: always
30-
- when:
31-
condition:
32-
not:
33-
equal: [ << parameters.plugin >>, "sqlite" ]
34-
steps:
35-
- run: cp ~/supertokens-root/supertokens-<< parameters.plugin >>-plugin/build/test-results/test/*.xml ~/junit/
3627
- store_test_results:
3728
path: ~/junit
3829
- slack/status

.circleci/doTests.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ then
6565
exit 1
6666
fi
6767

68+
mkdir -p ~/junit
69+
6870
someTestsRan=false
6971
while read -u 10 line
7072
do
@@ -165,7 +167,21 @@ do
165167

166168
./startTestingEnv --cicd
167169

168-
if [[ $? -ne 0 ]]
170+
TEST_EXIT_CODE=$?
171+
172+
if [ -d ~/junit ]
173+
then
174+
echo "Copying output from core"
175+
cp ~/supertokens-root/supertokens-core/build/test-results/test/*.xml ~/junit/
176+
177+
if [[ $pluginToTest != "sqlite" ]]
178+
then
179+
echo "Copying output from plugin"
180+
cp ~/supertokens-root/supertokens-$pluginToTest-plugin/build/test-results/test/*.xml ~/junit/
181+
fi
182+
fi
183+
184+
if [[ $TEST_EXIT_CODE -ne 0 ]]
169185
then
170186
echo ""
171187
echo ""
@@ -197,7 +213,7 @@ do
197213
echo ""
198214
echo ""
199215

200-
cd ../
216+
cd ..
201217
rm -rf supertokens-root
202218

203219
if [[ $currPinnedDb == "sqlite" ]]

0 commit comments

Comments
 (0)