fix(tests): start server for e2e tests

This commit is contained in:
Dominik 2025-05-13 10:23:58 +02:00
parent f90fb74f44
commit 15c4f2fbde
5 changed files with 9 additions and 6 deletions

View file

@ -1,5 +1,6 @@
AUTH_SECRET="auth_secret"
AUTH_URL="http://localhost:3000"
HOSTNAME=0.0.0.0
DATABASE_URL="file:./dev.db"
AUTH_AUTHENTIK_ID="id"
AUTH_AUTHENTIK_ISSUER="issuer"

View file

@ -32,6 +32,7 @@ jobs:
path: trivy-report.json
- name: Clean up Docker
if: always()
run: |
docker system prune -af --filter "until=24h"
docker volume prune -f

View file

@ -65,6 +65,7 @@ jobs:
cache-to: type=registry,ref=git.dominikstahl.dev/${{ env.REPO }}:buildcache,mode=max
- name: Clean up Docker
if: always()
run: |
docker system prune -af --filter "until=24h"
docker volume prune -f

View file

@ -21,6 +21,11 @@ jobs:
- name: Cypress run (e2e)
uses: https://github.com/cypress-io/github-action@v6
with:
build: yarn run build
start: yarn cypress:start_server
e2e: true
wait-on: 'http://localhost:3000'
- name: Cypress run (component)
uses: https://github.com/cypress-io/github-action@v6
@ -28,8 +33,3 @@ jobs:
build: yarn run build
start: yarn cypress:start_server
component: true
- name: Clean up Docker
run: |
docker system prune -af --filter "until=24h"
docker volume prune -f

View file

@ -8,7 +8,7 @@
"start": "node .next/standalone/server.js",
"lint": "next lint",
"format": "prettier --write .",
"cypress:start_server": "cp .next/static/ .next/standalone/.next/ -r && dotenv -e .env.test -- node .next/standalone/server.js",
"cypress:start_server": "cp public .next/standalone/ -r && cp .next/static/ .next/standalone/.next/ -r && dotenv -e .env.test -- node .next/standalone/server.js",
"cypress:open": "cypress open",
"cypress:run": "cypress run"
},