11version : 2
22jobs :
33 build :
4- working_directory : ~/repo
4+ working_directory : ~/repo/01-Authorization
55 machine : true
66
77 steps :
8- - checkout
8+ - checkout :
9+ path : ~/repo
10+
911 - run :
1012 name : Set .env file
1113 command : |
12- echo "AUTH0_DOMAIN=$domain " >> .env
13- echo "AUTH0_AUDIENCE=$audience " >> .env
14-
14+ echo "AUTH0_DOMAIN=$auth0_domain " >> .env
15+ echo "API_IDENTIFIER=$api_identifier " >> .env
16+
1517 - run :
1618 name : background server
1719 command : sh exec.sh
1820 background : true
19-
20- - run : sleep 20
21-
21+
22+ - run :
23+ name : Wait until server is online
24+ command : |
25+ until $(curl --output /dev/null --silent --head --fail http://localhost:3010/api/public); do
26+ sleep 5
27+ done
28+
2229 - run :
2330 name : Clone script test
24- command : git clone http://github.com/rafanog/test-script.git test
31+ command : git clone https://github.com/auth0-samples/api-quickstarts-tests test
32+ # command: git clone http://github.com/rafanog/test-script.git test
2533
2634 - run :
2735 name : Prepare environment variables for test
2836 command : |
2937 cd test
30- echo "AUTH0_DOMAIN=$domain " >> .env
31- echo "AUTH0_AUDIENCE=$audience " >> .env
32- echo "AUTH0_CLIENT_ID_1=$id1 " >> .env
33- echo "AUTH0_CLIENT_SECRET_1=$secret1 " >> .env
34- echo "AUTH0_CLIENT_ID_2=$id2 " >> .env
35- echo "AUTH0_CLIENT_SECRET_2=$secret2 " >> .env
36- echo "AUTH0_CLIENT_ID_3=$id3 " >> .env
37- echo "AUTH0_CLIENT_SECRET_3=$secret3 " >> .env
38- echo "AUTH0_CLIENT_ID_4=$id4 " >> .env
39- echo "AUTH0_CLIENT_SECRET_4=$secret4 " >> .env
38+ echo "AUTH0_DOMAIN=$auth0_domain " >> .env
39+ echo "API_IDENTIFIER=$api_identifier " >> .env
40+ echo "AUTH0_CLIENT_ID_1=$client_id_scopes_none " >> .env
41+ echo "AUTH0_CLIENT_SECRET_1=$client_secret_scopes_none " >> .env
42+ echo "AUTH0_CLIENT_ID_2=$client_id_scopes_read " >> .env
43+ echo "AUTH0_CLIENT_SECRET_2=$client_secret_scopes_read " >> .env
44+ echo "AUTH0_CLIENT_ID_3=$client_id_scopes_write " >> .env
45+ echo "AUTH0_CLIENT_SECRET_3=$client_secret_scopes_write " >> .env
46+ echo "AUTH0_CLIENT_ID_4=$client_id_scopes_readwrite " >> .env
47+ echo "AUTH0_CLIENT_SECRET_4=$client_secret_scopes_readwrite " >> .env
4048 echo "API_URL=http://localhost:3010" >> .env
41-
49+
4250 - run :
4351 name : Install test script dependency
44- command : cd test && npm install && npm install asyncawait
52+ command : cd test && npm install
53+
4554 - run :
4655 name : Test
47- command : cd test && npm test
56+ command : cd test && npm test
57+ workflows :
58+ version : 2
59+ build :
60+ jobs :
61+ - build :
62+ context : Quickstart API Tests
0 commit comments