Skip to content

Script to test migration when developing AB#30854 #1838

Script to test migration when developing AB#30854

Script to test migration when developing AB#30854 #1838

# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: 'Test: E2E (Portalicious)'
on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/test_e2e_portalicious.yml'
- 'e2e/**'
- 'services/.env.example'
- 'services/**'
- '!services/**.test.ts'
- '!services/**.spec.ts'
- 'interfaces/Portalicious/**'
- '!interfaces/Portalicious/**.test.ts'
- '!interfaces/Portalicious/**.spec.ts'
- '!**.md'
env:
e2eTestsPath: './e2e'
jobs:
test:
runs-on: ubuntu-latest
environment: test
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Node.js version
uses: actions/setup-node@v4
with:
node-version-file: '${{ env.e2eTestsPath }}/.node-version'
cache: 'npm'
cache-dependency-path: '${{ env.e2eTestsPath }}/package-lock.json'
- name: Install E2E-Tests code-dependencies
working-directory: ${{ env.e2eTestsPath }}
run: |
npm ci --no-fund --no-audit
- name: Lint E2E-Tests code
working-directory: ${{ env.e2eTestsPath }}
run: 'npm run lint'
- name: Set ENV-variables for test-environment
run: |
cp services/.env.example services/.env
- name: Run Services with Docker
working-directory: ./services
run: |
docker --log-level 'warn' compose -f docker-compose.yml up -d --quiet-pull --wait --wait-timeout 300
- name: Start Portalicious
working-directory: ./interfaces/Portalicious
env:
NG_URL_121_SERVICE_API: http://localhost:3000/api
run: |
npm install
npm run start:debug-production > portalicious-server-logs.txt 2>&1 &
- name: Install 121-Service dependencies
# This step is necessary because the tests run functions in this folder
working-directory: ./services/121-service
run: |
npm install
- name: Install E2E-Tests runtime-dependencies
working-directory: ${{ env.e2eTestsPath }}
run: |
npx playwright install chromium --with-deps
- name: Wait for Portalicious
run: |
timeout 90s sh -c 'until curl http://localhost:8088 -I; do echo "Waiting for Portalicious to be running..."; sleep 1; done'
- name: Run E2E-Tests with Playwright
working-directory: ${{ env.e2eTestsPath }}
env:
BASE_URL_PORTALICIOUS: http://localhost:8088
run: |
npm run test:portalicious
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-result-artifacts
path: |
${{ env.e2eTestsPath }}/test-results/
./interfaces/Portalicious/portalicious-server-logs.txt
retention-days: 30
- name: Docker logs
if: always()
uses: jwalton/gh-docker-logs@v2