From 73cafa09bafe5a455101ab4dec83649ceec2cb1b Mon Sep 17 00:00:00 2001 From: "Richard A. Jones" Date: Wed, 6 Nov 2024 10:32:28 -0700 Subject: [PATCH] cicd: smoke test all API urls (#143) closes #137 Temporarily disabled the if diff check to force backend to run. Do not merge until tests pass and check is reverted --- .github/workflows/backend.yml | 40 +++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 6dbad02..6da2505 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -65,11 +65,39 @@ 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 @@ -77,7 +105,7 @@ jobs: 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 }}