From c1364d20001e7a10a9824fd3d9eacf77506ac629 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Fri, 13 Oct 2023 16:09:23 +0530 Subject: [PATCH 01/18] fix: cicd update --- .circleci/config.yml | 5 ++-- .circleci/startDb.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++ .circleci/stopDb.sh | 3 +++ 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9038c10de..52071c81f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,6 +13,9 @@ jobs: steps: - checkout - run: echo $'\n[mysqld]\ncharacter_set_server=utf8mb4\nmax_connections=10000' >> /etc/mysql/mysql.cnf + - run: apt-get -y -q install postgresql-9.5 postgresql-client-9.5 postgresql-contrib-9.5 sudo + - run: echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.5/main/pg_hba.conf + - run: echo "listen_addresses='*'" >> /etc/postgresql/9.5/main/postgresql.conf - run: (cd .circleci/ && ./doTests.sh) - slack/status @@ -24,7 +27,5 @@ workflows: context: - slack-notification filters: - tags: - only: /dev-v[0-9]+(\.[0-9]+)*/ branches: ignore: /.*/ \ No newline at end of file diff --git a/.circleci/startDb.sh b/.circleci/startDb.sh index b846fb9fc..1c145455a 100755 --- a/.circleci/startDb.sh +++ b/.circleci/startDb.sh @@ -54,4 +54,60 @@ case $1 in mysql -u root --password=root -e "CREATE DATABASE st49;" mysql -u root --password=root -e "CREATE DATABASE st50;" ;; + postgresql) + /etc/init.d/postgresql start + sudo -u postgres psql --command "CREATE USER root WITH SUPERUSER PASSWORD 'root';" + createdb + psql -c "create database supertokens;" + psql -c "create database st0;" + psql -c "create database st1;" + psql -c "create database st2;" + psql -c "create database st3;" + psql -c "create database st4;" + psql -c "create database st5;" + psql -c "create database st6;" + psql -c "create database st7;" + psql -c "create database st8;" + psql -c "create database st9;" + psql -c "create database st10;" + psql -c "create database st11;" + psql -c "create database st12;" + psql -c "create database st13;" + psql -c "create database st14;" + psql -c "create database st15;" + psql -c "create database st16;" + psql -c "create database st17;" + psql -c "create database st18;" + psql -c "create database st19;" + psql -c "create database st20;" + psql -c "create database st21;" + psql -c "create database st22;" + psql -c "create database st23;" + psql -c "create database st24;" + psql -c "create database st25;" + psql -c "create database st26;" + psql -c "create database st27;" + psql -c "create database st28;" + psql -c "create database st29;" + psql -c "create database st30;" + psql -c "create database st31;" + psql -c "create database st32;" + psql -c "create database st33;" + psql -c "create database st34;" + psql -c "create database st35;" + psql -c "create database st36;" + psql -c "create database st37;" + psql -c "create database st38;" + psql -c "create database st39;" + psql -c "create database st40;" + psql -c "create database st41;" + psql -c "create database st42;" + psql -c "create database st43;" + psql -c "create database st44;" + psql -c "create database st45;" + psql -c "create database st46;" + psql -c "create database st47;" + psql -c "create database st48;" + psql -c "create database st49;" + psql -c "create database st50;" esac \ No newline at end of file diff --git a/.circleci/stopDb.sh b/.circleci/stopDb.sh index e30b372e7..9091bd1f5 100755 --- a/.circleci/stopDb.sh +++ b/.circleci/stopDb.sh @@ -2,4 +2,7 @@ case $1 in mysql) service mysql stop ;; + postgresql) + service postgresql stop + ;; esac \ No newline at end of file From 2d651d7355ccac2b3acb58b570612f40f90af6c7 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Fri, 13 Oct 2023 16:10:07 +0530 Subject: [PATCH 02/18] fix: cicd update --- .circleci/config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 52071c81f..7a2e68898 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,6 +26,3 @@ workflows: - test: context: - slack-notification - filters: - branches: - ignore: /.*/ \ No newline at end of file From 1c422c7c5008214be205fedad6a30dafbedd575b Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Fri, 13 Oct 2023 16:19:35 +0530 Subject: [PATCH 03/18] fix: version bump --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 95c6d4ef4..b1a265136 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ compileTestJava { options.encoding = "UTF-8" } // } //} -version = "7.0.4" +version = "7.0.5" repositories { From e4af37f478b39aaeda022183d00c645dedac955a Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Fri, 13 Oct 2023 18:13:16 +0530 Subject: [PATCH 04/18] fix: cicd script --- .circleci/config.yml | 5 +++++ .circleci/doTests.sh | 37 +++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 4 ++++ 3 files changed, 46 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7a2e68898..a7ded2847 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,3 +26,8 @@ workflows: - test: context: - slack-notification + filters: + tags: + only: /dev-v[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ \ No newline at end of file diff --git a/.circleci/doTests.sh b/.circleci/doTests.sh index 075c625ea..535495458 100755 --- a/.circleci/doTests.sh +++ b/.circleci/doTests.sh @@ -84,6 +84,18 @@ do currPinnedDb=$(echo "$pinnedDBArray" | jq ".[$i]") currPinnedDb=$(echo "$currPinnedDb" | tr -d '"') + echo "" + echo "" + echo "" + echo "" + echo "" + echo "===== testing $currPinnedDb with plugin-interface $currVersion =====" + echo "" + echo "" + echo "" + echo "" + echo "" + i=$((i+1)) if [[ $currPinnedDb == "sqlite" ]] @@ -148,11 +160,36 @@ do if [[ $? -ne 0 ]] then + echo "" + echo "" + echo "" + echo "" + echo "" + echo "===== testing $currPinnedDb with plugin-interface $currVersion FAILED =====" + echo "" + echo "" + echo "" + echo "" + echo "" + cat logs/* cd ../project/ echo "test failed... exiting!" exit 1 fi + + echo "" + echo "" + echo "" + echo "" + echo "" + echo "===== testing $currPinnedDb with plugin-interface $currVersion SUCCEEDED =====" + echo "" + echo "" + echo "" + echo "" + echo "" + cd ../ rm -rf supertokens-root diff --git a/CHANGELOG.md b/CHANGELOG.md index e61e98b1a..81fed96d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [7.0.5] - 2023-10-13 + +- Adds postgres testing to the CICD + ## [7.0.4] - 2023-10-12 - Fixes user info from primary user id query From b3a10710404dacb7eec449805bb76152705393e6 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Sat, 14 Oct 2023 11:27:44 +0530 Subject: [PATCH 05/18] fix: max connections --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index a7ded2847..dd6e92ea6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,6 +16,7 @@ jobs: - run: apt-get -y -q install postgresql-9.5 postgresql-client-9.5 postgresql-contrib-9.5 sudo - run: echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.5/main/pg_hba.conf - 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) - slack/status From af3002aca06b839d98a22fb7a5f4dcdc2b39b225 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Mon, 16 Oct 2023 12:03:36 +0530 Subject: [PATCH 06/18] fix: tests parallelism --- .circleci/config.yml | 6 +- .circleci/doTests.sh | 248 ++++++++++++++++++++++--------------------- 2 files changed, 128 insertions(+), 126 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dd6e92ea6..a64917621 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,6 +9,7 @@ jobs: environment: MONGO_INITDB_ROOT_USERNAME: root MONGO_INITDB_ROOT_PASSWORD: root + parallelism: 4 resource_class: large steps: - checkout @@ -27,8 +28,3 @@ workflows: - test: context: - slack-notification - filters: - tags: - only: /dev-v[0-9]+(\.[0-9]+)*/ - branches: - ignore: /.*/ \ No newline at end of file diff --git a/.circleci/doTests.sh b/.circleci/doTests.sh index 535495458..80976c249 100755 --- a/.circleci/doTests.sh +++ b/.circleci/doTests.sh @@ -84,144 +84,150 @@ do currPinnedDb=$(echo "$pinnedDBArray" | jq ".[$i]") currPinnedDb=$(echo "$currPinnedDb" | tr -d '"') - echo "" - echo "" - echo "" - echo "" - echo "" - echo "===== testing $currPinnedDb with plugin-interface $currVersion =====" - echo "" - echo "" - echo "" - echo "" - echo "" - i=$((i+1)) - if [[ $currPinnedDb == "sqlite" ]] + if (( i % CIRCLE_NODE_TOTAL == CIRCLE_NODE_INDEX )) then - # shellcheck disable=SC2034 - continue=1 - else - response=$(curl -s -X GET \ - "https://api.supertokens.io/0/plugin-interface/dependency/plugin/latest?password=$SUPERTOKENS_API_KEY&planType=FREE&mode=DEV&version=$piVersion&pluginName=$currPinnedDb" \ - -H 'api-version: 0') - if [[ $(echo "$response" | jq .plugin) == "null" ]] - then - echo "fetching latest X.Y version for $currPinnedDb given plugin-interface X.Y version: $piVersion gave response: $response" - exit 1 - fi - pinnedDbVersionX2=$(echo $response | jq .plugin | tr -d '"') - response=$(curl -s -X GET \ - "https://api.supertokens.io/0/plugin/latest?password=$SUPERTOKENS_API_KEY&planType=FREE&mode=DEV&version=$pinnedDbVersionX2&name=$currPinnedDb" \ - -H 'api-version: 0') - if [[ $(echo "$response" | jq .tag) == "null" ]] + echo "" + echo "" + echo "" + echo "" + echo "" + echo "===== testing $currPinnedDb with plugin-interface $currVersion =====" + echo "" + echo "" + echo "" + echo "" + echo "" + + if [[ $currPinnedDb == "sqlite" ]] then - echo "fetching latest X.Y.Z version for $currPinnedDb, X.Y version: $pinnedDbVersionX2 gave response: $response" - exit 1 + # shellcheck disable=SC2034 + continue=1 + else + response=$(curl -s -X GET \ + "https://api.supertokens.io/0/plugin-interface/dependency/plugin/latest?password=$SUPERTOKENS_API_KEY&planType=FREE&mode=DEV&version=$piVersion&pluginName=$currPinnedDb" \ + -H 'api-version: 0') + if [[ $(echo "$response" | jq .plugin) == "null" ]] + then + echo "fetching latest X.Y version for $currPinnedDb given plugin-interface X.Y version: $piVersion gave response: $response" + exit 1 + fi + pinnedDbVersionX2=$(echo $response | jq .plugin | tr -d '"') + + response=$(curl -s -X GET \ + "https://api.supertokens.io/0/plugin/latest?password=$SUPERTOKENS_API_KEY&planType=FREE&mode=DEV&version=$pinnedDbVersionX2&name=$currPinnedDb" \ + -H 'api-version: 0') + if [[ $(echo "$response" | jq .tag) == "null" ]] + then + echo "fetching latest X.Y.Z version for $currPinnedDb, X.Y version: $pinnedDbVersionX2 gave response: $response" + exit 1 + fi + pinnedDbVersionTag=$(echo "$response" | jq .tag | tr -d '"') + pinnedDbVersion=$(echo "$response" | jq .version | tr -d '"') + ./startDb.sh "$currPinnedDb" fi - pinnedDbVersionTag=$(echo "$response" | jq .tag | tr -d '"') - pinnedDbVersion=$(echo "$response" | jq .version | tr -d '"') - ./startDb.sh "$currPinnedDb" - fi - cd ../../ - git clone git@github.com:supertokens/supertokens-root.git - cd supertokens-root + cd ../../ + git clone git@github.com:supertokens/supertokens-root.git + cd supertokens-root - update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2 - update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2 + update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2 + update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2 - coreX=$(cut -d'.' -f1 <<<"$coreVersion") - coreY=$(cut -d'.' -f2 <<<"$coreVersion") - if [[ $currPinnedDb == "sqlite" ]] - then - echo -e "core,$coreX.$coreY\nplugin-interface,$piVersion" > modules.txt - else - echo -e "core,$coreX.$coreY\nplugin-interface,$piVersion\n$currPinnedDb-plugin,$pinnedDbVersionX2" > modules.txt - fi - ./loadModules - cd supertokens-core - git checkout dev-v$coreVersion - cd ../supertokens-plugin-interface - git checkout $currTag - if [[ $currPinnedDb == "sqlite" ]] - then - # shellcheck disable=SC2034 - continue=1 - else - cd ../supertokens-$currPinnedDb-plugin - git checkout $pinnedDbVersionTag - fi - cd ../ - echo $SUPERTOKENS_API_KEY > apiPassword - ./startTestingEnv --cicd - - if [[ $? -ne 0 ]] - then - echo "" - echo "" - echo "" - echo "" - echo "" - echo "===== testing $currPinnedDb with plugin-interface $currVersion FAILED =====" - echo "" - echo "" - echo "" - echo "" - echo "" - - cat logs/* - cd ../project/ - echo "test failed... exiting!" - exit 1 - fi + coreX=$(cut -d'.' -f1 <<<"$coreVersion") + coreY=$(cut -d'.' -f2 <<<"$coreVersion") + if [[ $currPinnedDb == "sqlite" ]] + then + echo -e "core,$coreX.$coreY\nplugin-interface,$piVersion" > modules.txt + else + echo -e "core,$coreX.$coreY\nplugin-interface,$piVersion\n$currPinnedDb-plugin,$pinnedDbVersionX2" > modules.txt + fi + ./loadModules + cd supertokens-core + git checkout dev-v$coreVersion + cd ../supertokens-plugin-interface + git checkout $currTag + if [[ $currPinnedDb == "sqlite" ]] + then + # shellcheck disable=SC2034 + continue=1 + else + cd ../supertokens-$currPinnedDb-plugin + git checkout $pinnedDbVersionTag + fi + cd ../ + echo $SUPERTOKENS_API_KEY > apiPassword + ./startTestingEnv --cicd - echo "" - echo "" - echo "" - echo "" - echo "" - echo "===== testing $currPinnedDb with plugin-interface $currVersion SUCCEEDED =====" - echo "" - echo "" - echo "" - echo "" - echo "" - - cd ../ - rm -rf supertokens-root - - if [[ $currPinnedDb == "sqlite" ]] - then - # shellcheck disable=SC2034 - continue=1 - else - curl -o supertokens.zip -s -X GET \ - "https://api.supertokens.io/0/app/download?pluginName=$currPinnedDb&os=linux&mode=DEV&binary=FREE&targetCore=$coreVersion&targetPlugin=$pinnedDbVersion" \ - -H 'api-version: 0' - unzip supertokens.zip -d . - rm supertokens.zip - cd supertokens - ../project/.circleci/testCli.sh if [[ $? -ne 0 ]] then - echo "cli testing failed... exiting!" + echo "" + echo "" + echo "" + echo "" + echo "" + echo "===== testing $currPinnedDb with plugin-interface $currVersion FAILED =====" + echo "" + echo "" + echo "" + echo "" + echo "" + + cat logs/* + cd ../project/ + echo "test failed... exiting!" exit 1 fi + + echo "" + echo "" + echo "" + echo "" + echo "" + echo "===== testing $currPinnedDb with plugin-interface $currVersion SUCCEEDED =====" + echo "" + echo "" + echo "" + echo "" + echo "" + cd ../ - fi + rm -rf supertokens-root + + if [[ $currPinnedDb == "sqlite" ]] + then + # shellcheck disable=SC2034 + continue=1 + else + curl -o supertokens.zip -s -X GET \ + "https://api.supertokens.io/0/app/download?pluginName=$currPinnedDb&os=linux&mode=DEV&binary=FREE&targetCore=$coreVersion&targetPlugin=$pinnedDbVersion" \ + -H 'api-version: 0' + unzip supertokens.zip -d . + rm supertokens.zip + cd supertokens + ../project/.circleci/testCli.sh + if [[ $? -ne 0 ]] + then + echo "cli testing failed... exiting!" + exit 1 + fi + cd ../ + fi + + rm -rf supertokens + cd project/.circleci + if [[ $currPinnedDb == "sqlite" ]] + then + # shellcheck disable=SC2034 + continue=1 + else + ./stopDb.sh $currPinnedDb + fi - rm -rf supertokens - cd project/.circleci - if [[ $currPinnedDb == "sqlite" ]] - then - # shellcheck disable=SC2034 - continue=1 - else - ./stopDb.sh $currPinnedDb fi + done done 10 Date: Mon, 16 Oct 2023 12:13:39 +0530 Subject: [PATCH 07/18] fix: cicd filters --- .circleci/config.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index a64917621..bb99ef04c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,3 +28,8 @@ workflows: - test: context: - slack-notification + filters: + tags: + only: /dev-v[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ \ No newline at end of file From 883cbc07d7c71b9418a716aa3508b349341ee0a1 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Mon, 16 Oct 2023 17:46:27 +0530 Subject: [PATCH 08/18] fix: parallel jobs --- .circleci/config.yml | 28 ++++++++++++++++++++-------- .circleci/doTests.sh | 4 +++- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bb99ef04c..3c44df911 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,8 +9,10 @@ jobs: environment: MONGO_INITDB_ROOT_USERNAME: root MONGO_INITDB_ROOT_PASSWORD: root - parallelism: 4 resource_class: large + parameters: + plugin: + type: string steps: - checkout - run: echo $'\n[mysqld]\ncharacter_set_server=utf8mb4\nmax_connections=10000' >> /etc/mysql/mysql.cnf @@ -18,18 +20,28 @@ jobs: - run: echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.5/main/pg_hba.conf - 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) - - slack/status + - run: (cd .circleci/ && ./doTests.sh << pipeline.parameters.plugin >>) + - slack/status: + success_message: ':tada: A $CIRCLE_JOB job for << pipeline.parameters.plugin >> plugin has succeeded!' + failure_message: ':red_circle: A $CIRCLE_JOB job for << pipeline.parameters.plugin >> plugin has failed!' workflows: version: 2 tagged-build: jobs: - test: + plugin: sqlite + context: + - slack-notification + - test: + plugin: mongodb + context: + - slack-notification + - test: + plugin: postgresql + context: + - slack-notification + - test: + plugin: mysql context: - slack-notification - filters: - tags: - only: /dev-v[0-9]+(\.[0-9]+)*/ - branches: - ignore: /.*/ \ No newline at end of file diff --git a/.circleci/doTests.sh b/.circleci/doTests.sh index 80976c249..75165dad1 100755 --- a/.circleci/doTests.sh +++ b/.circleci/doTests.sh @@ -7,6 +7,8 @@ function cleanup { trap cleanup EXIT cleanup +pluginToTest=$1 + pinnedDBJson=$(curl -s -X GET \ 'https://api.supertokens.io/0/plugin/pinned?planType=FREE' \ -H 'api-version: 0') @@ -86,7 +88,7 @@ do i=$((i+1)) - if (( i % CIRCLE_NODE_TOTAL == CIRCLE_NODE_INDEX )) + if [[ $currPinnedDb == $pluginToTest ]] then echo "" From c2b365e28a7b186c440def875a9edf85ee15573f Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Mon, 16 Oct 2023 17:50:54 +0530 Subject: [PATCH 09/18] fix: parameters --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3c44df911..a46e9f640 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,10 +20,10 @@ jobs: - run: echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.5/main/pg_hba.conf - 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 << pipeline.parameters.plugin >>) + - run: (cd .circleci/ && ./doTests.sh << parameters.plugin >>) - slack/status: - success_message: ':tada: A $CIRCLE_JOB job for << pipeline.parameters.plugin >> plugin has succeeded!' - failure_message: ':red_circle: A $CIRCLE_JOB job for << pipeline.parameters.plugin >> plugin has failed!' + 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!' workflows: version: 2 From a23b881b7030402f54a2ec50987ab105fea53dfb Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Mon, 16 Oct 2023 17:56:56 +0530 Subject: [PATCH 10/18] fix: adding filters back --- .circleci/config.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index a46e9f640..d7dcbf9f7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,15 +33,35 @@ workflows: plugin: sqlite context: - slack-notification + filters: + tags: + only: /dev-v[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ - test: plugin: mongodb context: - slack-notification + filters: + tags: + only: /dev-v[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ - test: plugin: postgresql context: - slack-notification + filters: + tags: + only: /dev-v[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ - test: plugin: mysql context: - slack-notification + filters: + tags: + only: /dev-v[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ From 7e6e780272962c0586e05fcfb03c8a88978c84a1 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Mon, 16 Oct 2023 18:18:52 +0530 Subject: [PATCH 11/18] fix: job names --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c4a0eb434..7e51cbac9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,6 @@ jobs: environment: MONGO_INITDB_ROOT_USERNAME: root MONGO_INITDB_ROOT_PASSWORD: root - parallelism: 4 resource_class: large parameters: plugin: @@ -32,6 +31,7 @@ workflows: jobs: - test: plugin: sqlite + name: test-sqlite context: - slack-notification filters: @@ -41,6 +41,7 @@ workflows: ignore: /.*/ - test: plugin: mongodb + name: test-mongodb context: - slack-notification filters: @@ -50,6 +51,7 @@ workflows: ignore: /.*/ - test: plugin: postgresql + name: test-postgresql context: - slack-notification filters: @@ -59,6 +61,7 @@ workflows: ignore: /.*/ - test: plugin: mysql + name: test-mysql context: - slack-notification filters: From f85162b7d7c9c841f3abd1af650d414b813da9cb Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Mon, 16 Oct 2023 18:22:05 +0530 Subject: [PATCH 12/18] fix: remove filter for test --- .circleci/config.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7e51cbac9..3133d92fb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,38 +34,18 @@ workflows: name: test-sqlite context: - slack-notification - filters: - tags: - only: /dev-v[0-9]+(\.[0-9]+)*/ - branches: - ignore: /.*/ - test: plugin: mongodb name: test-mongodb context: - slack-notification - filters: - tags: - only: /dev-v[0-9]+(\.[0-9]+)*/ - branches: - ignore: /.*/ - test: plugin: postgresql name: test-postgresql context: - slack-notification - filters: - tags: - only: /dev-v[0-9]+(\.[0-9]+)*/ - branches: - ignore: /.*/ - test: plugin: mysql name: test-mysql context: - slack-notification - filters: - tags: - only: /dev-v[0-9]+(\.[0-9]+)*/ - branches: - ignore: /.*/ From 84bc81f5448e46a53ff726f0fc94259e9cbccb23 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Mon, 16 Oct 2023 18:24:29 +0530 Subject: [PATCH 13/18] fix: adding filters back --- .circleci/config.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3133d92fb..7e51cbac9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,18 +34,38 @@ workflows: name: test-sqlite context: - slack-notification + filters: + tags: + only: /dev-v[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ - test: plugin: mongodb name: test-mongodb context: - slack-notification + filters: + tags: + only: /dev-v[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ - test: plugin: postgresql name: test-postgresql context: - slack-notification + filters: + tags: + only: /dev-v[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ - test: plugin: mysql name: test-mysql context: - slack-notification + filters: + tags: + only: /dev-v[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ From 82d7f4132dddf7cec4bca5645bea013ac93cdc75 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Tue, 17 Oct 2023 13:27:42 +0530 Subject: [PATCH 14/18] fix: mark passed --- .circleci/config.yml | 25 ++++++++++++++++++++++--- .circleci/doTests.sh | 19 ++----------------- .circleci/markPassed.sh | 18 ++++++++++++++++++ 3 files changed, 42 insertions(+), 20 deletions(-) create mode 100755 .circleci/markPassed.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 7e51cbac9..ea186b375 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 @@ -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 diff --git a/.circleci/doTests.sh b/.circleci/doTests.sh index 75165dad1..85bc80662 100755 --- a/.circleci/doTests.sh +++ b/.circleci/doTests.sh @@ -235,23 +235,8 @@ done 10 Date: Tue, 17 Oct 2023 13:29:39 +0530 Subject: [PATCH 15/18] fix: typo --- .circleci/config.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ea186b375..0b5542fd8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,13 +23,13 @@ jobs: - run: (cd .circleci/ && ./doTests.sh << parameters.plugin >>) - slack/status - mark-passed: - docker: - - image: rishabhpoddar/supertokens_core_testing - steps: - - checkout - - run: (cd .circleci && ./markPassed.sh) - - slack/status + mark-passed: + docker: + - image: rishabhpoddar/supertokens_core_testing + steps: + - checkout + - run: (cd .circleci && ./markPassed.sh) + - slack/status workflows: version: 2 From da9aa3f54b2be9ec8f16ae0c541bd2228dacc2f7 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Tue, 17 Oct 2023 13:31:22 +0530 Subject: [PATCH 16/18] fix: for mark passed test --- .circleci/config.yml | 25 ------------------------- .circleci/doTests.sh | 2 ++ 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0b5542fd8..aaeec8909 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,49 +40,24 @@ workflows: name: test-sqlite context: - slack-notification - filters: - tags: - only: /dev-v[0-9]+(\.[0-9]+)*/ - branches: - ignore: /.*/ - test: plugin: mongodb name: test-mongodb context: - slack-notification - filters: - tags: - only: /dev-v[0-9]+(\.[0-9]+)*/ - branches: - ignore: /.*/ - test: plugin: postgresql name: test-postgresql context: - slack-notification - filters: - tags: - only: /dev-v[0-9]+(\.[0-9]+)*/ - branches: - ignore: /.*/ - test: plugin: mysql name: test-mysql context: - slack-notification - filters: - tags: - 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 diff --git a/.circleci/doTests.sh b/.circleci/doTests.sh index 85bc80662..a4e8537b6 100755 --- a/.circleci/doTests.sh +++ b/.circleci/doTests.sh @@ -7,6 +7,8 @@ function cleanup { trap cleanup EXIT cleanup +exit 0 + pluginToTest=$1 pinnedDBJson=$(curl -s -X GET \ From f3814c82c6f9330c82eb1b1c6a90bbc1ad37bcb2 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Tue, 17 Oct 2023 13:37:08 +0530 Subject: [PATCH 17/18] fix: mark passed --- .circleci/markPassed.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.circleci/markPassed.sh b/.circleci/markPassed.sh index 2b77cde9e..297531c13 100755 --- a/.circleci/markPassed.sh +++ b/.circleci/markPassed.sh @@ -1,5 +1,16 @@ 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 \ From f453cdfbab2aead91fc8100c88b005f873cc2c64 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Tue, 17 Oct 2023 13:39:28 +0530 Subject: [PATCH 18/18] fix: revert test changes --- .circleci/config.yml | 25 +++++++++++++++++++++++++ .circleci/doTests.sh | 2 -- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index aaeec8909..0b5542fd8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,24 +40,49 @@ workflows: name: test-sqlite context: - slack-notification + filters: + tags: + only: /dev-v[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ - test: plugin: mongodb name: test-mongodb context: - slack-notification + filters: + tags: + only: /dev-v[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ - test: plugin: postgresql name: test-postgresql context: - slack-notification + filters: + tags: + only: /dev-v[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ - test: plugin: mysql name: test-mysql context: - slack-notification + filters: + tags: + 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 diff --git a/.circleci/doTests.sh b/.circleci/doTests.sh index a4e8537b6..85bc80662 100755 --- a/.circleci/doTests.sh +++ b/.circleci/doTests.sh @@ -7,8 +7,6 @@ function cleanup { trap cleanup EXIT cleanup -exit 0 - pluginToTest=$1 pinnedDBJson=$(curl -s -X GET \