Skip to content

test: ci

test: ci #2

Workflow file for this run

name: E2E Tests

Check failure on line 1 in .github/workflows/e2e.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/e2e.yml

Invalid workflow file

(Line: 19, Col: 26): Unrecognized named-value: 'env'. Located at position 1 within expression: env.USE_CLOUD_BACKEND, (Line: 20, Col: 25): Unrecognized named-value: 'env'. Located at position 1 within expression: env.BACKEND_API_BASE, (Line: 21, Col: 22): Unrecognized named-value: 'env'. Located at position 1 within expression: env.DASHBOARD_URL, (Line: 22, Col: 23): Unrecognized named-value: 'env'. Located at position 1 within expression: env.DASHBOARD_PORT || '5177', (Line: 23, Col: 24): Unrecognized named-value: 'env'. Located at position 1 within expression: env.GREPTIMEDB_PORT || '4000', (Line: 24, Col: 21): Unrecognized named-value: 'env'. Located at position 1 within expression: env.BACKEND_PORT || '8080'
# Local run example:
# docker compose -f docker-compose.e2e.yml up -d
# BACKEND_API_BASE=http://localhost:8080 DASHBOARD_PORT=5177 pnpm exec playwright test tests/e2e/query.real.spec.ts
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
e2e:
name: E2E Tests
runs-on: ubuntu-latest
env:
USE_CLOUD_BACKEND: ${{ env.USE_CLOUD_BACKEND }}
BACKEND_API_BASE: ${{ env.BACKEND_API_BASE }}
DASHBOARD_URL: ${{ env.DASHBOARD_URL }}
DASHBOARD_PORT: ${{ env.DASHBOARD_PORT || '5177' }}
GREPTIMEDB_PORT: ${{ env.GREPTIMEDB_PORT || '4000' }}
BACKEND_PORT: ${{ env.BACKEND_PORT || '8080' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Start docker-compose stack
if: env.USE_CLOUD_BACKEND != 'true'
run: |
docker compose -f docker-compose.e2e.yml up -d
docker compose -f docker-compose.e2e.yml ps
- name: Wait for dashboard
if: env.USE_CLOUD_BACKEND != 'true'
run: |
for i in {1..30}; do
if curl -fsS "http://localhost:${DASHBOARD_PORT:-5177}/dashboard/query" > /dev/null; then
echo "Dashboard is ready"
exit 0
fi
echo "Waiting for dashboard (${i}/30)..."
sleep 5
done
echo "Dashboard did not become ready in time"
exit 1
- name: Run Playwright tests (local docker stack)
if: env.USE_CLOUD_BACKEND != 'true'
env:
BACKEND_API_BASE: "http://localhost:${BACKEND_PORT:-8080}"
DASHBOARD_URL: "http://localhost:${DASHBOARD_PORT:-5177}"
run: pnpm exec playwright test tests/e2e/query.real.spec.ts
- name: Run Playwright tests (cloud backend)
if: env.USE_CLOUD_BACKEND == 'true'
env:
BACKEND_API_BASE: ${{ env.BACKEND_API_BASE }}
DASHBOARD_URL: ${{ env.DASHBOARD_URL }}
run: pnpm exec playwright test tests/e2e/query.real.spec.ts
- name: Upload Playwright artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-artifacts
path: |
playwright-report
test-results
e2e-screenshots
if-no-files-found: ignore
- name: Shutdown docker-compose stack
if: always() && env.USE_CLOUD_BACKEND != 'true'
run: docker compose -f docker-compose.e2e.yml down -v