Skip to content

Commit

Permalink
fix: mark passed (#851)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
sattvikc authored Oct 17, 2023
1 parent b9f2390 commit 70d55a4
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 20 deletions.
25 changes: 22 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ jobs:
- run: echo "listen_addresses='*'" >> /etc/postgresql/9.5/main/postgresql.conf
- run: sed -i 's/^#*\s*max_connections\s*=.*/max_connections = 10000/' /etc/postgresql/9.5/main/postgresql.conf
- run: (cd .circleci/ && ./doTests.sh << parameters.plugin >>)
- slack/status:
success_message: ':tada: A $CIRCLE_JOB job for << parameters.plugin >> plugin has succeeded!'
failure_message: ':red_circle: A $CIRCLE_JOB job for << parameters.plugin >> plugin has failed!'
- slack/status

mark-passed:
docker:
- image: rishabhpoddar/supertokens_core_testing
steps:
- checkout
- run: (cd .circleci && ./markPassed.sh)
- slack/status

workflows:
version: 2
Expand Down Expand Up @@ -69,3 +75,16 @@ workflows:
only: /dev-v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- mark-passed:
context:
- slack-notification
filters:
tags:
only: /dev-v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
requires:
- test-sqlite
- test-mongodb
- test-postgresql
- test-mysql
19 changes: 2 additions & 17 deletions .circleci/doTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -235,23 +235,8 @@ done 10<pluginInterfaceExactVersionsOutput

if [[ $someTestsRan = "true" ]]
then
echo "calling /core PATCH to make testing passed"
responseStatus=$(curl -s -o /dev/null -w "%{http_code}" -X PATCH \
https://api.supertokens.io/0/core \
-H 'Content-Type: application/json' \
-H 'api-version: 0' \
-d "{
\"password\": \"$SUPERTOKENS_API_KEY\",
\"planType\":\"FREE\",
\"version\":\"$coreVersion\",
\"testPassed\": true
}")
if [ "$responseStatus" -ne "200" ]
then
echo "patch api failed"
exit 1
fi
echo "tests ran successfully"
else
echo "no test ran"
exit 1
fi
fi
29 changes: 29 additions & 0 deletions .circleci/markPassed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
coreVersion=$(cat ../build.gradle | grep -e "version =" -e "version=")

while IFS='"' read -ra ADDR; do
counter=0
for i in "${ADDR[@]}"; do
if [ $counter == 1 ]
then
coreVersion=$i
fi
counter=$(($counter+1))
done
done <<< "$coreVersion"

echo "calling /core PATCH to make testing passed"
responseStatus=$(curl -s -o /dev/null -w "%{http_code}" -X PATCH \
https://api.supertokens.io/0/core \
-H 'Content-Type: application/json' \
-H 'api-version: 0' \
-d "{
\"password\": \"$SUPERTOKENS_API_KEY\",
\"planType\":\"FREE\",
\"version\":\"$coreVersion\",
\"testPassed\": true
}")
if [ "$responseStatus" -ne "200" ]
then
echo "patch api failed"
exit 1
fi

0 comments on commit 70d55a4

Please sign in to comment.