Skip to content

Commit 6369bf7

Browse files
committed
Added CircleCI tests
1 parent 60eac8c commit 6369bf7

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

.circleci/config.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
version: 2
2+
jobs:
3+
build:
4+
working_directory: ~/repo/00-Starter-Seed
5+
machine: true
6+
7+
steps:
8+
- checkout:
9+
path: ~/repo
10+
11+
- run:
12+
name: Set .env file
13+
command: |
14+
echo "AUTH0_DOMAIN=$auth0_domain" >> .env
15+
echo "API_IDENTIFIER=$api_identifier" >> .env
16+
17+
- run:
18+
name: background server
19+
command: sh exec.sh
20+
background: true
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+
29+
- run:
30+
name: Clone script test
31+
command: git clone https://github.com/auth0-samples/api-quickstarts-tests test
32+
33+
- run:
34+
name: Prepare environment variables for test
35+
command: |
36+
cd test
37+
echo "AUTH0_DOMAIN=$auth0_domain" >> .env
38+
echo "API_IDENTIFIER=$api_identifier" >> .env
39+
echo "AUTH0_CLIENT_ID_1=$client_id_scopes_none" >> .env
40+
echo "AUTH0_CLIENT_SECRET_1=$client_secret_scopes_none" >> .env
41+
echo "AUTH0_CLIENT_ID_2=$client_id_scopes_read" >> .env
42+
echo "AUTH0_CLIENT_SECRET_2=$client_secret_scopes_read" >> .env
43+
echo "AUTH0_CLIENT_ID_3=$client_id_scopes_write" >> .env
44+
echo "AUTH0_CLIENT_SECRET_3=$client_secret_scopes_write" >> .env
45+
echo "AUTH0_CLIENT_ID_4=$client_id_scopes_readwrite" >> .env
46+
echo "AUTH0_CLIENT_SECRET_4=$client_secret_scopes_readwrite" >> .env
47+
echo "API_URL=http://localhost:3010" >> .env
48+
49+
- run:
50+
name: Install test script dependency
51+
command: cd test && npm install
52+
53+
- run:
54+
name: Test
55+
command: cd test && npm test
56+
workflows:
57+
version: 2
58+
build:
59+
jobs:
60+
- build:
61+
context: Quickstart API Tests

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Auth0 + Python Api
22

3+
[![CircleCI](https://img.shields.io/circleci/project/github/auth0-samples/auth0-python-api-samples.svg?style=flat-square)](https://circleci.com/gh/auth0-samples/auth0-python-api-samples/tree/master)
4+
35
This repository contains the source code for the [Python API Quickstart](https://auth0.com/docs/quickstart/backend/python)
46

57
Please see the quickstart itself, or the Readme's in the individual folder for more information.

0 commit comments

Comments
 (0)