👷 Improve playwright CI job (#1335)

This commit is contained in:
Patrick Arminio
2024-09-12 15:21:24 +02:00
committed by GitHub
parent b3a49ae32e
commit 97d04cd7ff
4 changed files with 25 additions and 2 deletions

View File

@@ -41,9 +41,9 @@ jobs:
working-directory: frontend working-directory: frontend
- run: docker compose build - run: docker compose build
- run: docker compose down -v --remove-orphans - run: docker compose down -v --remove-orphans
- run: docker compose up -d - run: docker compose up -d --wait
- name: Run Playwright tests - name: Run Playwright tests
run: npx playwright test run: npx playwright test --fail-on-flaky-tests --trace=retain-on-failure
working-directory: frontend working-directory: frontend
- run: docker compose down -v --remove-orphans - run: docker compose down -v --remove-orphans
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4

View File

@@ -24,3 +24,8 @@ def test_email(email_to: EmailStr) -> Message:
html_content=email_data.html_content, html_content=email_data.html_content,
) )
return Message(message="Test email sent") return Message(message="Test email sent")
@router.get("/health-check/")
async def health_check() -> bool:
return True

View File

@@ -63,6 +63,12 @@ services:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- SENTRY_DSN=${SENTRY_DSN} - SENTRY_DSN=${SENTRY_DSN}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/api/v1/utils/health-check/"]
interval: 10s
timeout: 5s
retries: 5
build: build:
context: ./backend context: ./backend
args: args:

View File

@@ -386,6 +386,18 @@ export class UtilsService {
}, },
}) })
} }
/**
* Health Check
* @returns boolean Successful Response
* @throws ApiError
*/
public static healthCheck(): CancelablePromise<boolean> {
return __request(OpenAPI, {
method: "GET",
url: "/api/v1/utils/health-check/",
})
}
} }
export type TDataReadItems = { export type TDataReadItems = {