Skip to content

Commit 97d04cd

Browse files
authored
👷 Improve playwright CI job (#1335)
1 parent b3a49ae commit 97d04cd

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

.github/workflows/playwright.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ jobs:
4141
working-directory: frontend
4242
- run: docker compose build
4343
- run: docker compose down -v --remove-orphans
44-
- run: docker compose up -d
44+
- run: docker compose up -d --wait
4545
- name: Run Playwright tests
46-
run: npx playwright test
46+
run: npx playwright test --fail-on-flaky-tests --trace=retain-on-failure
4747
working-directory: frontend
4848
- run: docker compose down -v --remove-orphans
4949
- uses: actions/upload-artifact@v4

backend/app/api/routes/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ def test_email(email_to: EmailStr) -> Message:
2424
html_content=email_data.html_content,
2525
)
2626
return Message(message="Test email sent")
27+
28+
29+
@router.get("/health-check/")
30+
async def health_check() -> bool:
31+
return True

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ services:
6363
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
6464
- SENTRY_DSN=${SENTRY_DSN}
6565

66+
healthcheck:
67+
test: ["CMD", "curl", "-f", "http://localhost/api/v1/utils/health-check/"]
68+
interval: 10s
69+
timeout: 5s
70+
retries: 5
71+
6672
build:
6773
context: ./backend
6874
args:

frontend/src/client/services.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,18 @@ export class UtilsService {
386386
},
387387
})
388388
}
389+
390+
/**
391+
* Health Check
392+
* @returns boolean Successful Response
393+
* @throws ApiError
394+
*/
395+
public static healthCheck(): CancelablePromise<boolean> {
396+
return __request(OpenAPI, {
397+
method: "GET",
398+
url: "/api/v1/utils/health-check/",
399+
})
400+
}
389401
}
390402

391403
export type TDataReadItems = {

0 commit comments

Comments
 (0)