Skip to content

Commit

Permalink
tests not working
Browse files Browse the repository at this point in the history
Signed-off-by: aryan <aryangodara03@gmail.com>
  • Loading branch information
AryanGodara committed Jan 17, 2023
1 parent de0b227 commit d26e4dc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
35 changes: 22 additions & 13 deletions .github/workflows/st.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,18 @@ jobs:
- name: checkout repo
uses: actions/checkout@v2

- name: start containers
- name: run containers
run: make endtoend

# - name: create images
# run: make dockers
# - name: run containers
# run: make rundetached
# # - name: provision user
# # run: curl -s -S --insecure -X POST -H "Content-Type: application/json" http://localhost/users -d '{"email":"and@anr.com", "password":"12341234"}'

# # - name: get MF_TOKEN
# # run: "MF_TOKEN=$(curl -s -S -i -X POST -H "Content-Type: application/json" http://localhost/tokens -d '{"email":"and@anr.com", "password":"12341234"}' | grep -Po "token\":\"\K(.*)(?=\")")" >> $GITHUB_ENV

# Auth.yml
- name: Run st for auth.yml
if: always()
Expand All @@ -23,7 +32,7 @@ jobs:
# API schema location
schema: './api/openapi/auth.yml'
base-url: 'http://localhost'
args: '-H Authorization: $MF_TOKEN'
args: "-H Authorization: ${{ env.MF_TOKEN }}"
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

Expand All @@ -35,7 +44,7 @@ jobs:
# API schema location
schema: './api/openapi/bootstrap.yml'
base-url: 'http://localhost'
args: '-H Authorization: $MF_TOKEN'
args: "-H Authorization: ${{ env.MF_TOKEN }}"
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

Expand All @@ -47,7 +56,7 @@ jobs:
# API schema location
schema: './api/openapi/certs.yml'
base-url: 'http://localhost'
args: '-H Authorization: $MF_TOKEN'
args: "-H Authorization: ${{ env.MF_TOKEN }}"
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

Expand All @@ -59,7 +68,7 @@ jobs:
# API schema location
schema: './api/openapi/consumers-notifiers.yml'
base-url: 'http://localhost'
args: '-H Authorization: $MF_TOKEN'
args: "-H Authorization: ${{ env.MF_TOKEN }}"
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

Expand All @@ -71,7 +80,7 @@ jobs:
# API schema location
schema: './api/openapi/http.yml'
base-url: 'http://localhost'
args: '-H Authorization: $MF_TOKEN'
args: "-H Authorization: ${{ env.MF_TOKEN }}"
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

Expand All @@ -83,7 +92,7 @@ jobs:
# API schema location
schema: './api/openapi/provision.yml'
base-url: 'http://localhost'
args: '-H Authorization: $MF_TOKEN'
args: "-H Authorization: ${{ env.MF_TOKEN }}"
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

Expand All @@ -95,7 +104,7 @@ jobs:
# API schema location
schema: './api/openapi/readers.yml'
base-url: 'http://localhost'
args: '-H Authorization: $MF_TOKEN'
args: "-H Authorization: ${{ env.MF_TOKEN }}"
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

Expand All @@ -107,7 +116,7 @@ jobs:
# API schema location
schema: './api/openapi/things.yml'
base-url: 'http://localhost'
args: '-H Authorization: $MF_TOKEN'
args: "-H Authorization: ${{ env.MF_TOKEN }}"
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

Expand All @@ -119,7 +128,7 @@ jobs:
# API schema location
schema: './api/openapi/twins.yml'
base-url: 'http://localhost'
args: '-H Authorization: $MF_TOKEN'
args: "-H Authorization: ${{ env.MF_TOKEN }}"
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

Expand All @@ -131,7 +140,7 @@ jobs:
# API schema location
schema: './api/openapi/users.yml'
base-url: 'http://localhost'
args: '-H Authorization: $MF_TOKEN'
args: "-H Authorization: ${{ env.MF_TOKEN }}"
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

Expand All @@ -143,7 +152,7 @@ jobs:
# API schema location
schema: './api/openapi/websocket.yml'
base-url: 'http://localhost'
args: '-H Authorization: $MF_TOKEN'
args: "-H Authorization: ${{ env.MF_TOKEN }}"
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

Expand Down
12 changes: 6 additions & 6 deletions scripts/end-to-end.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@

cd ..

make dockers
# make dockers
make rundetached

EMAIL=example@eg.com
PASSWORD=12345678
DEVICE=mf-device
MF_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NzM4ODg4NjIsImlhdCI6MTY3Mzg1Mjg2MiwiaXNzIjoibWFpbmZsdXguYXV0aCIsInN1YiI6ImV4YW1wbGVAZWcuY29tIiwiaXNzdWVyX2lkIjoiNzE0NTk5MmYtMzZkZi00NjE5LWE1YzQtOGJkMzg2YjI3YmE5IiwidHlwZSI6MH0.B1CSAPQawWH2UWt3qiD0KfufWuqgNjTaunr0fq4jAVA

#provision user:
printf "Provisioning user with email $EMAIL and password $PASSWORD \n"
curl -s -S --insecure -X POST -H "Content-Type: application/json" http://localhost/users -d '{"email":"'"$EMAIL"'", "password":"'"$PASSWORD"'"}'
curl -s -S --insecure -X POST -H "Content-Type: application/json" http://localhost:8180/users -d '{"email":"'"$EMAIL"'", "password":"'"$PASSWORD"'"}'

#get jwt token
JWTTOKEN=$(curl -s -S -i -X POST -H "Content-Type: application/json" http://localhost/tokens -d '{"email":"'"$EMAIL"'", "password":"'"$PASSWORD"'"}' | grep -Po "token\":\"\K(.*)(?=\")")
JWTTOKEN=$(curl -s -S -i -X POST -H "Content-Type: application/json" http://localhost:8180/tokens -d '{"email":"'"$EMAIL"'", "password":"'"$PASSWORD"'"}' | grep -Po "token\":\"\K(.*)(?=\")")
printf "JWT TOKEN for user is $JWTTOKEN \n"

echo setting mf base path $(pwd)
export MF_BASE_PATH=$(pwd)

# MF_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NzM4ODg4NjIsImlhdCI6MTY3Mzg1Mjg2MiwiaXNzIjoibWFpbmZsdXguYXV0aCIsInN1YiI6ImV4YW1wbGVAZWcuY29tIiwiaXNzdWVyX2lkIjoiNzE0NTk5MmYtMzZkZi00NjE5LWE1YzQtOGJkMzg2YjI3YmE5IiwidHlwZSI6MH0.B1CSAPQawWH2UWt3qiD0KfufWuqgNjTaunr0fq4jAVA

echo setting mf auth bearer token $JWTTOKEN
export MF_TOKEN=$JWTTOKEN
echo setting mf auth bearer token $(JWTTOKEN)
export MF_TOKEN=$(JWTTOKEN)

0 comments on commit d26e4dc

Please sign in to comment.