Skip to content

Commit

Permalink
e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinejaussoin committed Nov 7, 2024
1 parent e31b544 commit 11603ba
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Alpha Build"

on:
push:
branches: [v552/fix-docker-build]
branches: [v552/integration]

jobs:
frontend:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Integration only (test)"

on:
push:
branches: [v552/integration]
branches: [v552/integrationx]

jobs:
integration:
Expand Down
3 changes: 3 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ WORKDIR /usr/src/backend

ENV NODE_ENV=production

RUN apk update
RUN apk add curl

COPY ./yarn.lock ./
COPY ./package.json ./

Expand Down
5 changes: 5 additions & 0 deletions integration/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ local:
yarn test
docker-compose down

local-compose:
docker build -f ../backend/Dockerfile -t retro-backend:local ../backend
docker build -f ../frontend/Dockerfile -t retro-frontend:local ../frontend
docker-compose -f ./docker-compose.local.local.yml up --exit-code-from cypress

alpha:
docker-compose rm -s -f -v
docker-compose -f ./docker-compose.ci.alpha.yml pull
Expand Down
10 changes: 7 additions & 3 deletions integration/docker-compose.ci.alpha.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:
cypress:
image: "cypress/included:12.6.0"
Expand Down Expand Up @@ -29,11 +28,15 @@ services:
image: retrospected/backend:alpha
depends_on:
- redis
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3201/healthz"]
interval: 2s
timeout: 5s
retries: 30
environment:
SELF_HOSTED_ADMIN: '[email protected]'
DB_PASSWORD: some-password
SESSION_SECRET: im-a-secret

restart: unless-stopped
logging:
driver: 'json-file'
Expand All @@ -43,7 +46,8 @@ services:
frontend:
image: retrospected/frontend:alpha
depends_on:
- backend
backend:
condition: service_healthy
environment:
BACKEND_HOST: backend
BACKEND_PORT: 3201
Expand Down
70 changes: 70 additions & 0 deletions integration/docker-compose.local.local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
services:
cypress:
image: "cypress/included:12.6.0"
ipc: host
depends_on:
- frontend
environment:
- CYPRESS_baseUrl=http://frontend
- CYPRESS_backend_delay=60000
working_dir: /e2e
volumes:
- ./:/e2e

postgres:
image: postgres:16
hostname: postgres
environment:
POSTGRES_PASSWORD: some-password
POSTGRES_USER: postgres
POSTGRES_DB: retroboard
restart: unless-stopped
logging:
driver: 'json-file'
options:
max-size: '50m'

backend:
image: retro-backend:local
depends_on:
- redis
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3201/healthz"]
interval: 2s
timeout: 5s
retries: 30
environment:
SELF_HOSTED_ADMIN: '[email protected]'
DB_PASSWORD: some-password
SESSION_SECRET: im-a-secret

restart: unless-stopped
logging:
driver: 'json-file'
options:
max-size: '50m'

frontend:
image: retro-frontend:local
depends_on:
backend:
condition: service_healthy
environment:
BACKEND_HOST: backend
BACKEND_PORT: 3201
restart: unless-stopped
logging:
driver: 'json-file'
options:
max-size: '50m'

redis:
image: redis:latest
depends_on:
- postgres
restart: unless-stopped
logging:
driver: 'json-file'
options:
max-size: '50m'

0 comments on commit 11603ba

Please sign in to comment.