Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cicd: smoke test all API urls #143

Merged
merged 3 commits into from
Nov 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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