Skip to content

feat: handle transfer request notification #768

feat: handle transfer request notification

feat: handle transfer request notification #768

Workflow file for this run

name: E2E Tests
on:
push:
branches: [main, develop]
pull_request:
branches: []
jobs:
e2e-tests:
timeout-minutes: 30
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.57.0-noble
options: --user 1001
services:
mongodb:
image: mongo:6.0.4
ports:
- 27017:27017
redis:
image: redis
ports:
- 6379:6379
steps:
- name: Checkout cdata
uses: actions/checkout@v4
- name: Checkout udata
uses: actions/checkout@v4
with:
repository: opendatateam/udata
path: udata
ref: main
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
python-version: "3.11"
working-directory: udata
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
# - name: Install Node.js dependencies for @datagouv/components
# working-directory: datagouv-components
# run: pnpm install
- name: Install Node.js dependencies for cdata
run: pnpm install
- name: Install Python dependencies for udata
working-directory: udata
run: |
uv sync --frozen
- name: Configure udata
working-directory: udata
run: |
cat << 'EOF' > udata.cfg
from udata.settings import Defaults
DEBUG = True
TESTING = True
SECRET_KEY = 'test-secret-key-for-ci'
SEND_MAIL = False
SERVER_NAME = 'localhost:7000'
CDATA_BASE_URL="http://localhost:3000"
CACHE_TYPE = 'null'
DEFAULT_LANGUAGE = 'fr'
SCHEMA_CATALOG_URL='https://schema.data.gouv.fr/schemas/schemas.json'
URLS_ALLOW_PRIVATE = True
URLS_ALLOW_LOCAL = True
URLS_ALLOWED_TLDS = Defaults.URLS_ALLOWED_TLDS | set(['local'])
PLUGINS = []
FS_ROOT = 'fs'
SESSION_COOKIE_SECURE = False
SECURITY_EMAIL_VALIDATOR_ARGS = {
"check_deliverability": False
}
MONGODB_HOST = 'mongodb://mongodb:27017/udata'
CELERY_BROKER_URL = 'redis://redis:6379'
CELERY_RESULT_BACKEND = 'redis://redis:6379'
EOF
- name: Initialize udata
working-directory: udata
run: |
# Create fs directory
mkdir -p fs
# Initialize udata
uv run udata init
uv run udata licenses
uv run udata spatial load
uv run udata import-fixtures
uv run udata user create --first-name "Admin" --last-name "User" --email "[email protected]" --password "@1337Password42" --admin
uv run inv i18nc
# Start udata server in background
uv run inv serve --port=7000 > udata.log 2>&1 &
# Wait for udata to be ready
timeout 90 bash -c 'until curl -f http://localhost:7000/api/1/site/; do sleep 2; done'
echo "udata server is ready"
- name: Build and start cdata
env:
NUXT_PUBLIC_API_BASE: http://localhost:7000
NUXT_PUBLIC_HOMEPAGE_HERO_IMAGES: "hero_15.png"
run: |
# Build cdata
pnpm run build
# Start cdata server in background
PORT=3000 pnpm run preview > cdata.log 2>&1 &
# Wait for cdata to be ready
timeout 90 bash -c 'until curl -f http://localhost:3000; do sleep 2; done'
echo "cdata server is ready"
- name: Run E2E tests
env:
BASE_URL: http://localhost:3000
CI: true
run: pnpm run test:e2e
- name: Kill udata server
if: always()
working-directory: udata
run: |
# Kill udata server to release the lock so that post setup-uv can prune the cache
pkill -f "uv run inv serve" || true
- name: Show server logs
if: always()
run: |
echo "=== UDATA SERVER LOGS ==="
cat udata/udata.log || echo "No udata logs found"
echo ""
echo "=== CDATA SERVER LOGS ==="
cat cdata.log || echo "No cdata logs found"
- name: Upload screenshots
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-screenshots
path: tests/*-snapshots/
retention-days: 7
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 7