Skip to content

Commit 9f0f9f0

Browse files
committed
fix: update cicd
1 parent 1e5bb9d commit 9f0f9f0

27 files changed

+366
-1722
lines changed

.circleci/authReactDrf.sh

Lines changed: 0 additions & 119 deletions
This file was deleted.

.circleci/config_continue.yml

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,32 @@ jobs:
6666
- run: make with-django
6767
- run: (cd .circleci/ && ./websiteDjango.sh)
6868
- slack/status
69+
test-website-drf-async:
70+
docker:
71+
- image: rishabhpoddar/supertokens_python_driver_testing
72+
resource_class: large
73+
steps:
74+
- checkout
75+
- run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
76+
- run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
77+
- run: git config --global url."https://github.com/".insteadOf ssh://[email protected]/
78+
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
79+
- run: make with-django
80+
- run: (cd .circleci/ && ./websiteDrfAsync.sh)
81+
- slack/status
82+
test-website-drf-sync:
83+
docker:
84+
- image: rishabhpoddar/supertokens_python_driver_testing
85+
resource_class: large
86+
steps:
87+
- checkout
88+
- run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
89+
- run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
90+
- run: git config --global url."https://github.com/".insteadOf ssh://[email protected]/
91+
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
92+
- run: make with-django
93+
- run: (cd .circleci/ && ./websiteDrfSync.sh)
94+
- slack/status
6995
test-website-django2x:
7096
docker:
7197
- image: rishabhpoddar/supertokens_python_driver_testing
@@ -187,37 +213,6 @@ jobs:
187213
- store_artifacts:
188214
path: ../supertokens-auth-react/test_report/logs
189215
destination: logfiles
190-
test-authreact-drf:
191-
docker:
192-
- image: rishabhpoddar/supertokens_python_driver_testing
193-
resource_class: large
194-
environment:
195-
MOCHA_FILE: ../supertokens-auth-react/test_report/report_node-<< parameters.fdi-version >>.xml
196-
parameters:
197-
fdi-version:
198-
type: string
199-
parallelism: 4
200-
steps:
201-
- checkout
202-
- attach_workspace:
203-
at: /
204-
- run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
205-
- run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
206-
- run: git config --global url."https://github.com/".insteadOf ssh://[email protected]/
207-
- run: n 16
208-
- run: node --version
209-
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
210-
- run: make with-drf
211-
- run: (cd .circleci && ./authReactDrf.sh << parameters.fdi-version >>)
212-
- run: ls -la ../supertokens-auth-react/test_report || true
213-
- store_test_results:
214-
path: ../supertokens-auth-react/test_report/report_node-<< parameters.fdi-version >>.xml
215-
- store_artifacts:
216-
path: ../supertokens-auth-react/test_report/screenshots
217-
destination: failed-test-screenshots
218-
- store_artifacts:
219-
path: ../supertokens-auth-react/test_report/logs
220-
destination: logfiles
221216
test-success:
222217
docker:
223218
- image: rishabhpoddar/supertokens_python_driver_testing
@@ -279,7 +274,17 @@ workflows:
279274
only: /dev-v[0-9]+(\.[0-9]+)*/
280275
branches:
281276
only: /test-cicd\/.*/
282-
- test-website-drf:
277+
- test-website-drf-async:
278+
requires:
279+
- test-dev-tag-as-not-passed
280+
context:
281+
- slack-notification
282+
filters:
283+
tags:
284+
only: /dev-v[0-9]+(\.[0-9]+)*/
285+
branches:
286+
only: /test-cicd\/.*/
287+
- test-website-drf-sync:
283288
requires:
284289
- test-dev-tag-as-not-passed
285290
context:
@@ -344,11 +349,12 @@ workflows:
344349
- test-website-fastapi
345350
- test-website-flask
346351
- test-website-django
352+
- test-website-drf-async
353+
- test-website-drf-sync
347354
- test-website-django2x
348355
- test-authreact-fastapi
349356
- test-authreact-flask
350357
- test-authreact-django
351-
- test-authreact-drf
352358
context:
353359
- slack-notification
354360
filters:

.circleci/setupAndTestWithAuthReactWithDrf.sh renamed to .circleci/setupAndTestWithFrontendWithDrfAsync.sh

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fi
3030
pluginInterfaceTag=$(echo $pluginInterfaceInfo | jq .tag | tr -d '"')
3131
pluginInterfaceVersion=$(echo $pluginInterfaceInfo | jq .version | tr -d '"')
3232

33-
echo "Testing with frontend auth-react: $2, node tag: $3, FREE core: $coreVersion, plugin-interface: $pluginInterfaceVersion"
33+
echo "Testing with frontend website: $2, FREE core: $coreVersion, plugin-interface: $pluginInterfaceVersion"
3434

3535
cd ../../
3636
git clone [email protected]:supertokens/supertokens-root.git
@@ -45,34 +45,32 @@ cd ../
4545
echo $SUPERTOKENS_API_KEY > apiPassword
4646
./utils/setupTestEnvLocal
4747
cd ../
48-
git clone [email protected]:supertokens/supertokens-auth-react.git
49-
cd supertokens-auth-react
48+
git clone [email protected]:supertokens/supertokens-website.git
49+
cd supertokens-website
5050
git checkout $2
51-
npm run init > /dev/null
52-
(cd ./examples/for-tests && npm run link) # this is there because in linux machine, postinstall in npm doesn't work..
53-
cd ./test/server/
54-
npm i git+https://github.com:supertokens/supertokens-node.git#$3
55-
npm i
56-
cd ../../../project/tests/auth-react/drf
51+
cd ../project/tests/frontendIntegration/drf_async
5752
export PYTHONPATH="${PYTHONPATH}:/root/project"
58-
uvicorn mysite.asgi:application --port 8083 &
53+
uvicorn mysite.asgi:application --port 8080 &
5954
pid=$!
60-
cd ../../../../supertokens-auth-react/
61-
62-
# When testing with supertokens-auth-react for version >= 0.18 the SKIP_OAUTH
63-
# flag will not be checked because Auth0 is used as a provider so that the Thirdparty tests can run reliably.
64-
# In versions lower than 0.18 Github is used as the provider.
65-
66-
SKIP_OAUTH=true npm run test-with-non-node
55+
uvicorn mysite.asgi:application --port 8082 &
56+
pid2=$!
57+
cd ../../../../supertokens-website/test/server
58+
npm i git+https://github.com:supertokens/supertokens-node.git#$3
59+
npm i
60+
cd ../../
61+
npm i
62+
SUPERTOKENS_CORE_TAG=$coreTag NODE_PORT=8081 INSTALL_PATH=../supertokens-root npm test
6763
if [[ $? -ne 0 ]]
6864
then
69-
echo "test failed... killing $pid and exiting!"
65+
echo "test failed... killing $pid, $pid2 and exiting!"
7066
kill -9 $pid
67+
kill -9 $pid2
7168
rm -rf ./test/server/node_modules/supertokens-node
7269
git checkout HEAD -- ./test/server/package.json
7370
exit 1
7471
fi
75-
echo "all tests passed, killing processes: $pid"
72+
echo "all tests passed, killing processes: $pid and $pid2"
7673
kill -9 $pid
74+
kill -9 $pid2
7775
rm -rf ./test/server/node_modules/supertokens-node
7876
git checkout HEAD -- ./test/server/package.json
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
coreInfo=`curl -s -X GET \
2+
"https://api.supertokens.io/0/core/latest?password=$SUPERTOKENS_API_KEY&planType=FREE&mode=DEV&version=$1" \
3+
-H 'api-version: 0'`
4+
if [[ `echo $coreInfo | jq .tag` == "null" ]]
5+
then
6+
echo "fetching latest X.Y.Z version for core, X.Y version: $1, planType: FREE gave response: $coreInfo"
7+
exit 1
8+
fi
9+
coreTag=$(echo $coreInfo | jq .tag | tr -d '"')
10+
coreVersion=$(echo $coreInfo | jq .version | tr -d '"')
11+
12+
pluginInterfaceVersionXY=`curl -s -X GET \
13+
"https://api.supertokens.io/0/core/dependency/plugin-interface/latest?password=$SUPERTOKENS_API_KEY&planType=FREE&mode=DEV&version=$1" \
14+
-H 'api-version: 0'`
15+
if [[ `echo $pluginInterfaceVersionXY | jq .pluginInterface` == "null" ]]
16+
then
17+
echo "fetching latest X.Y version for plugin-interface, given core X.Y version: $1, planType: FREE gave response: $pluginInterfaceVersionXY"
18+
exit 1
19+
fi
20+
pluginInterfaceVersionXY=$(echo $pluginInterfaceVersionXY | jq .pluginInterface | tr -d '"')
21+
22+
pluginInterfaceInfo=`curl -s -X GET \
23+
"https://api.supertokens.io/0/plugin-interface/latest?password=$SUPERTOKENS_API_KEY&planType=FREE&mode=DEV&version=$pluginInterfaceVersionXY" \
24+
-H 'api-version: 0'`
25+
if [[ `echo $pluginInterfaceInfo | jq .tag` == "null" ]]
26+
then
27+
echo "fetching latest X.Y.Z version for plugin-interface, X.Y version: $pluginInterfaceVersionXY, planType: FREE gave response: $pluginInterfaceInfo"
28+
exit 1
29+
fi
30+
pluginInterfaceTag=$(echo $pluginInterfaceInfo | jq .tag | tr -d '"')
31+
pluginInterfaceVersion=$(echo $pluginInterfaceInfo | jq .version | tr -d '"')
32+
33+
echo "Testing with frontend website: $2, FREE core: $coreVersion, plugin-interface: $pluginInterfaceVersion"
34+
35+
cd ../../
36+
git clone [email protected]:supertokens/supertokens-root.git
37+
cd supertokens-root
38+
echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
39+
./loadModules --ssh
40+
cd supertokens-core
41+
git checkout $coreTag
42+
cd ../supertokens-plugin-interface
43+
git checkout $pluginInterfaceTag
44+
cd ../
45+
echo $SUPERTOKENS_API_KEY > apiPassword
46+
./utils/setupTestEnvLocal
47+
cd ../
48+
git clone [email protected]:supertokens/supertokens-website.git
49+
cd supertokens-website
50+
git checkout $2
51+
cd ../project/tests/frontendIntegration/drf_sync
52+
export PYTHONPATH="${PYTHONPATH}:/root/project"
53+
python manage.py runserver 8080 &
54+
pid=$!
55+
python manage.py runserver 8082 &
56+
pid2=$!
57+
cd ../../../../supertokens-website/test/server
58+
npm i git+https://github.com:supertokens/supertokens-node.git#$3
59+
npm i
60+
cd ../../
61+
npm i
62+
SUPERTOKENS_CORE_TAG=$coreTag NODE_PORT=8081 INSTALL_PATH=../supertokens-root npm test
63+
if [[ $? -ne 0 ]]
64+
then
65+
echo "test failed... killing $pid, $pid2 and exiting!"
66+
kill -9 $pid
67+
kill -9 $pid2
68+
rm -rf ./test/server/node_modules/supertokens-node
69+
git checkout HEAD -- ./test/server/package.json
70+
exit 1
71+
fi
72+
echo "all tests passed, killing processes: $pid and $pid2"
73+
kill -9 $pid
74+
kill -9 $pid2
75+
rm -rf ./test/server/node_modules/supertokens-node
76+
git checkout HEAD -- ./test/server/package.json

0 commit comments

Comments
 (0)