chore: switch to docker compose setup on e2e workflow

This commit is contained in:
Karol Sójko
2023-02-07 07:35:10 +01:00
parent 5ed9bd243f
commit 4db0aef0ff
4 changed files with 23 additions and 41 deletions
+7 -34
View File
@@ -21,23 +21,6 @@ jobs:
image: standardnotes/snjs
ports:
- 9001:9001
db:
image: mysql:8
env:
MYSQL_DATABASE: standard_notes_db
MYSQL_USER: std_notes_user
MYSQL_PASSWORD: changeme123
MYSQL_ROOT_PASSWORD: changeme123
ports:
- 3306:3306
options: >-
--name "db"
cache:
image: redis:6.0-alpine
ports:
- 6379:6379
options: >-
--name "cache"
mock-event-publisher:
image: standardnotes/mock-event-publisher
ports:
@@ -65,31 +48,18 @@ jobs:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build Docker image for E2E testing
run: docker build . -t standardnotes/server:${{ github.sha }}
- name: Create Docker Network
run: docker network create -d bridge e2e-network
- name: Connect external containers to e2e network
run: |
docker network connect --alias mock-event-publisher e2e-network mock-event-publisher
docker network connect --alias db e2e-network db
docker network connect --alias cache e2e-network cache
- name: Create .env file
run: touch .env
- name: Run Server
run: docker run -v $(pwd)/logs:/var/lib/server/logs --network e2e-network -d -p 3123:3000 standardnotes/server:${{ github.sha }}
run: docker compose -f docker-compose.dev.yml up -d
env:
EXPOSED_PORT: 3123
EXPOSED_FILES_SERVER_PORT: 3125
PUBLIC_FILES_SERVER_URL: http://db:3125
DB_HOST: db
DB_PORT: 3306
PUBLIC_FILES_SERVER_URL: http://localhost:3125
DB_USERNAME: std_notes_user
DB_PASSWORD: changeme123
DB_DATABASE: standard_notes_db
REDIS_PORT: 6379
REDIS_HOST: cache
AUTH_SERVER_ACCESS_TOKEN_AGE: 4
AUTH_SERVER_REFRESH_TOKEN_AGE: 10
AUTH_SERVER_EPHEMERAL_SESSION_AGE: 300
@@ -103,5 +73,8 @@ jobs:
- name: Wait for server to start
run: docker/is-available.sh http://localhost:3123 $(pwd)/logs
- name: Connect external containers to self-hosted network
run: docker network connect --alias mock-event-publisher standardnotes_self_hosted mock-event-publisher
- name: Run E2E Test Suite
run: yarn dlx mocha-headless-chrome --timeout 1200000 -f http://localhost:9001/mocha/test.html