Files
standardnotes-server/.github/workflows/common-e2e.yml
2023-02-07 07:35:10 +01:00

81 lines
2.3 KiB
YAML

name: Reusable Run E2E Test Suite Workflow
on:
workflow_call:
secrets:
DOCKER_USERNAME:
required: true
DOCKER_PASSWORD:
required: true
AWS_ACCESS_KEY_ID:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
jobs:
e2e:
runs-on: ubuntu-latest
services:
snjs:
image: standardnotes/snjs
ports:
- 9001:9001
mock-event-publisher:
image: standardnotes/mock-event-publisher
ports:
- 3124:3000
env:
LOG_LEVEL: debug
NODE_ENV: production
VERSION: snjs-test
SNS_TOPIC_ARN: arn:aws:sns:us-east-1:000000000000:payments-local-topic
SNS_ENDPOINT: http://localstack:4566
SNS_DISABLE_SSL: true
SNS_SECRET_ACCESS_KEY: x
SNS_ACCESS_KEY_ID: x
SNS_AWS_REGION: us-east-1
NEW_RELIC_ENABLED: false
options: >-
--name "mock-event-publisher"
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Create .env file
run: touch .env
- name: Run Server
run: docker compose -f docker-compose.dev.yml up -d
env:
EXPOSED_PORT: 3123
EXPOSED_FILES_SERVER_PORT: 3125
PUBLIC_FILES_SERVER_URL: http://localhost:3125
DB_USERNAME: std_notes_user
DB_PASSWORD: changeme123
DB_DATABASE: standard_notes_db
AUTH_SERVER_ACCESS_TOKEN_AGE: 4
AUTH_SERVER_REFRESH_TOKEN_AGE: 10
AUTH_SERVER_EPHEMERAL_SESSION_AGE: 300
SYNCING_SERVER_REVISIONS_FREQUENCY: 5
AUTH_SERVER_LOG_LEVEL: debug
SYNCING_SERVER_LOG_LEVEL: debug
FILES_SERVER_LOG_LEVEL: debug
REVISIONS_SERVER_LOG_LEVEL: debug
API_GATEWAY_LOG_LEVEL: debug
- 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