Skip to content

Commit 70d55a4

Browse files
authored
fix: mark passed (#851)
* fix: cicd update * fix: cicd update * fix: version bump * fix: cicd script * fix: max connections * fix: tests parallelism * fix: cicd filters * fix: parallel jobs * fix: parameters * fix: adding filters back * fix: job names * fix: remove filter for test * fix: adding filters back * fix: mark passed * fix: typo * fix: for mark passed test * fix: mark passed * fix: revert test changes
1 parent b9f2390 commit 70d55a4

File tree

3 files changed

+53
-20
lines changed

3 files changed

+53
-20
lines changed

.circleci/config.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ jobs:
2121
- run: echo "listen_addresses='*'" >> /etc/postgresql/9.5/main/postgresql.conf
2222
- run: sed -i 's/^#*\s*max_connections\s*=.*/max_connections = 10000/' /etc/postgresql/9.5/main/postgresql.conf
2323
- run: (cd .circleci/ && ./doTests.sh << parameters.plugin >>)
24-
- slack/status:
25-
success_message: ':tada: A $CIRCLE_JOB job for << parameters.plugin >> plugin has succeeded!'
26-
failure_message: ':red_circle: A $CIRCLE_JOB job for << parameters.plugin >> plugin has failed!'
24+
- slack/status
25+
26+
mark-passed:
27+
docker:
28+
- image: rishabhpoddar/supertokens_core_testing
29+
steps:
30+
- checkout
31+
- run: (cd .circleci && ./markPassed.sh)
32+
- slack/status
2733

2834
workflows:
2935
version: 2
@@ -69,3 +75,16 @@ workflows:
6975
only: /dev-v[0-9]+(\.[0-9]+)*/
7076
branches:
7177
ignore: /.*/
78+
- mark-passed:
79+
context:
80+
- slack-notification
81+
filters:
82+
tags:
83+
only: /dev-v[0-9]+(\.[0-9]+)*/
84+
branches:
85+
ignore: /.*/
86+
requires:
87+
- test-sqlite
88+
- test-mongodb
89+
- test-postgresql
90+
- test-mysql

.circleci/doTests.sh

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -235,23 +235,8 @@ done 10<pluginInterfaceExactVersionsOutput
235235

236236
if [[ $someTestsRan = "true" ]]
237237
then
238-
echo "calling /core PATCH to make testing passed"
239-
responseStatus=$(curl -s -o /dev/null -w "%{http_code}" -X PATCH \
240-
https://api.supertokens.io/0/core \
241-
-H 'Content-Type: application/json' \
242-
-H 'api-version: 0' \
243-
-d "{
244-
\"password\": \"$SUPERTOKENS_API_KEY\",
245-
\"planType\":\"FREE\",
246-
\"version\":\"$coreVersion\",
247-
\"testPassed\": true
248-
}")
249-
if [ "$responseStatus" -ne "200" ]
250-
then
251-
echo "patch api failed"
252-
exit 1
253-
fi
238+
echo "tests ran successfully"
254239
else
255240
echo "no test ran"
256241
exit 1
257-
fi
242+
fi

.circleci/markPassed.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
coreVersion=$(cat ../build.gradle | grep -e "version =" -e "version=")
2+
3+
while IFS='"' read -ra ADDR; do
4+
counter=0
5+
for i in "${ADDR[@]}"; do
6+
if [ $counter == 1 ]
7+
then
8+
coreVersion=$i
9+
fi
10+
counter=$(($counter+1))
11+
done
12+
done <<< "$coreVersion"
13+
14+
echo "calling /core PATCH to make testing passed"
15+
responseStatus=$(curl -s -o /dev/null -w "%{http_code}" -X PATCH \
16+
https://api.supertokens.io/0/core \
17+
-H 'Content-Type: application/json' \
18+
-H 'api-version: 0' \
19+
-d "{
20+
\"password\": \"$SUPERTOKENS_API_KEY\",
21+
\"planType\":\"FREE\",
22+
\"version\":\"$coreVersion\",
23+
\"testPassed\": true
24+
}")
25+
if [ "$responseStatus" -ne "200" ]
26+
then
27+
echo "patch api failed"
28+
exit 1
29+
fi

0 commit comments

Comments
 (0)