Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: parallel jobs #849

Merged
merged 12 commits into from
Oct 16, 2023
39 changes: 36 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,58 @@ jobs:
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
- 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
- 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!'

workflows:
version: 2
tagged-build:
jobs:
- test:
plugin: sqlite
context:
- slack-notification
filters:
tags:
only: /dev-v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
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: /.*/
4 changes: 3 additions & 1 deletion .circleci/doTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -86,7 +88,7 @@ do

i=$((i+1))

if (( i % CIRCLE_NODE_TOTAL == CIRCLE_NODE_INDEX ))
if [[ $currPinnedDb == $pluginToTest ]]
then

echo ""
Expand Down
Loading