fix(test): fix testing ci workflow and clean up docker
All checks were successful
container-scan / Container Scan (pull_request) Successful in 7m11s
docker-build / docker (pull_request) Successful in 8m2s
tests / Tests (pull_request) Successful in 8m32s

This commit is contained in:
Dominik 2025-05-13 11:38:22 +02:00
parent af38d2148c
commit 28b9737bfa
7 changed files with 18 additions and 13 deletions

View file

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

View file

@ -34,5 +34,5 @@ jobs:
- name: Clean up Docker
if: always()
run: |
docker system prune -af --filter "until=24h"
docker system prune -af
docker volume prune -f

View file

@ -67,5 +67,5 @@ jobs:
- name: Clean up Docker
if: always()
run: |
docker system prune -af --filter "until=24h"
docker system prune -af
docker volume prune -f

View file

@ -22,14 +22,13 @@ jobs:
- name: Cypress run (e2e)
uses: https://github.com/cypress-io/github-action@v6
with:
build: yarn run build
build: yarn cypress:build
start: yarn cypress:start_server
e2e: true
wait-on: 'http://localhost:3000'
wait-on: 'http://127.0.0.1:3000'
- name: Cypress run (component)
uses: https://github.com/cypress-io/github-action@v6
with:
build: yarn run build
start: yarn cypress:start_server
component: true
install: false

5
.gitignore vendored
View file

@ -46,3 +46,8 @@ next-env.d.ts
/prisma/*.db*
src/generated/prisma
data
# cypress
cypress/videos
cypress/screenshots
cypress/coverage

View file

@ -1,12 +1,12 @@
describe('login', () => {
it('loads', () => {
cy.visit('http://localhost:3000/');
cy.visit('http://127.0.0.1:3000/');
cy.getBySel('login-header').should('exist');
});
it('shows login form', () => {
cy.visit('http://localhost:3000/');
cy.visit('http://127.0.0.1:3000/');
cy.getBySel('login-form').should('exist');
cy.getBySel('email-input').should('exist');
@ -15,13 +15,13 @@ describe('login', () => {
});
it('shows sso button', () => {
cy.visit('http://localhost:3000/');
cy.visit('http://127.0.0.1:3000/');
cy.getBySel('sso-login-button_authentik').should('exist');
});
it('allows login', () => {
cy.visit('http://localhost:3000/');
cy.visit('http://127.0.0.1:3000/');
cy.getBySel('email-input').type('test@example.com');
cy.getBySel('password-input').type('password');

View file

@ -8,7 +8,8 @@
"start": "node .next/standalone/server.js",
"lint": "next lint",
"format": "prettier --write .",
"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:build": "prettier --check . && NODE_ENV=test next build",
"cypress:start_server": "cp .env.test .next/standalone && cp public .next/standalone/ -r && cp .next/static/ .next/standalone/.next/ -r && NODE_ENV=test HOSTNAME=\"0.0.0.0\" dotenv -e .env.test -- node .next/standalone/server.js",
"cypress:open": "cypress open",
"cypress:run": "cypress run",
"prisma:migrate": "dotenv -e .env.local -- prisma migrate dev",