Skip to content

Commit

Permalink
cicd: smoke test all API urls (#143)
Browse files Browse the repository at this point in the history
closes #137 

Temporarily disabled the if diff check to force backend to run. Do not
merge until tests pass and check is reverted
  • Loading branch information
talentedmrjones authored Nov 6, 2024
1 parent e6500f5 commit 73cafa0
Showing 1 changed file with 34 additions and 6 deletions.
40 changes: 34 additions & 6 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,47 @@ jobs:
WORKSPACE: ${{ github.workspace }}


# TODO: convert this placeholder to a series of tests via BATS
- name: Curl
run: |
auth="eyJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6InRlc3QudXNlckBub3doZXJlLnh5eiJ9.zmgPiVjkLNzh4sl9uD_KAR28bd___-OlLhHsXWQNSC4"
curl -s -H "Authorization: ${auth}" http://localhost:8080/api/v1/users/current

- name: Smoke test
uses: aquia-inc/emberfall@main
with:
version: 0.2.0
config: |
---
commonHeaders: &commonHeaders
authorization: "eyJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6InRlc3QudXNlckBub3doZXJlLnh5eiJ9.zmgPiVjkLNzh4sl9uD_KAR28bd___-OlLhHsXWQNSC4"
tests:
- url: http://localhost:8080/api/v1/users/current
method: GET
expect:
status: 401
body: "unauthorized"
- url: http://localhost:8080/api/v1/users/current
method: GET
headers:
<<: *commonHeaders
expect:
status: 200
headers:
content-type: "application/json"
- url: http://localhost:8080/api/v1/fismasystems
method: GET
headers:
<<: *commonHeaders
expect:
status: 200
headers:
content-type: "application/json"
- name: AWS - Get Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.ROLEARN }}
role-duration-seconds: 900
aws-region: us-east-1

- name: Docker - Login
run: aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin ${{ secrets.ECR_REPO_URL }}

Expand Down

0 comments on commit 73cafa0

Please sign in to comment.