generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Annual health check?! Nah, I get mine every 5s π©ββοΈ
- Loading branch information
1 parent
f273ff7
commit a32f18c
Showing
5 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ jobs: | |
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Run Tests With 3rd Party Service Mocking | ||
run: docker run ghcr.io/hackforla/homeuniteus/api:latest pytest | ||
run: docker run --no-healthcheck ghcr.io/hackforla/homeuniteus/api:latest pytest | ||
test-api-nomock: | ||
runs-on: ubuntu-latest | ||
needs: [build-api] | ||
|
@@ -89,7 +89,7 @@ jobs: | |
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Run Tests Without Mocking | ||
run: docker run --env COGNITO_REGION --env COGNITO_ACCESS_ID --env COGNITO_ACCESS_KEY ghcr.io/hackforla/homeuniteus/api:latest "pytest --mode=release" | ||
run: docker run --no-healthcheck --env COGNITO_REGION --env COGNITO_ACCESS_ID --env COGNITO_ACCESS_KEY ghcr.io/hackforla/homeuniteus/api:latest "pytest --mode=release" | ||
test-app-mock: | ||
runs-on: ubuntu-latest | ||
needs: [build-app, build-api] | ||
|
@@ -110,7 +110,7 @@ jobs: | |
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Run Tests With Backend Mocking | ||
run: docker run --env CYPRESS_BASE_URL --env CYPRESS_USE_MOCK app:latest-test "npx cypress run" | ||
run: docker run --env CYPRESS_BASE_URL --env CYPRESS_USE_MOCK ghcr.io/hackforla/homeuniteus/app:latest-test "npx cypress run" | ||
env: | ||
CYPRESS_BASE_URL: http://frontend:4040 | ||
CYPRESS_USE_MOCK: true | ||
|
@@ -142,7 +142,7 @@ jobs: | |
run: | | ||
curl http://backend:8080/api/auth/signup/host -H "accept: application/json" -H "Content-Type: application/json" -d "{\"email\": \"[email protected]\", \"password\": \"alskdf454#Adfa\"}" | ||
- name: Test without mocking | ||
run: docker run --env CYPRESS_BASE_URL --env CYPRESS_USE_MOCK --env CYPRESS_REAL_EMAIL --env CYPRESS_REAL_PASSWORD app:latest-test "npx cypress run" | ||
run: docker run --env CYPRESS_BASE_URL --env CYPRESS_USE_MOCK --env CYPRESS_REAL_EMAIL --env CYPRESS_REAL_PASSWORD ghcr.io/hackforla/homeuniteus/app:latest-test "npx cypress run" | ||
env: | ||
CYPRESS_BASE_URL: http://frontend:4040 | ||
CYPRESS_USE_MOCK: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
def test_get_nonexistent_provider(client): | ||
''' | ||
Test that the healthcheck endpoint works. | ||
The endpoint should always return a success code. | ||
''' | ||
response = client.get(f"/api/health") | ||
assert response.status_code == 200, f'Response body is : {response.json}' | ||
assert len(response.json) > 0 |