Skip to content

fix: typo in fr translation #9539

fix: typo in fr translation

fix: typo in fr translation #9539

Workflow file for this run

name: Startup Tests
permissions:
contents: read
on:
pull_request:
workflow_dispatch:
# Cancel older in-progress runs for the same PR or the same ref (branch)
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
GITHUB_WORKFLOW: github_actions
backend-directory: ./backend
frontend-directory: ./frontend
enterprise-backend-directory: ./enterprise/backend
enterprise-frontend-directory: ./enterprise/frontend
enterprise-frontend-build-directory: ./enterprise/frontend/.build/frontend
enterprise-backend-settings-module: enterprise_core.settings
POSTGRES_VERSION: "16"
UBUNTU_VERSION: "ubuntu-24.04"
PYTHON_VERSION: "3.12"
jobs:
startup-functional-test:
runs-on: ubuntu-24.04
env:
LOG_LEVEL: DEBUG
LOG_OUTFILE: ciso-assistant.log
DJANGO_DEBUG: "True"
DJANGO_SUPERUSER_EMAIL: [email protected]
DJANGO_SUPERUSER_PASSWORD: 1234
POSTGRES_NAME: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DB_HOST: localhost
CISO_ASSISTANT_SUPERUSER_EMAIL: ""
CISO_ASSISTANT_URL: http://localhost:4173
PUBLIC_BACKEND_API_URL: http://localhost:8000/api
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
max-parallel: 4
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install Poetry via pipx
shell: bash
run: |
set -euo pipefail
python -m pip install --upgrade pip
python -m pip install --upgrade pipx
python -m pipx ensurepath
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
python -m pipx install poetry
- name: Check Poetry version
shell: bash
run: poetry --version
- name: Install backend requirements
working-directory: ${{ env.backend-directory }}
run: poetry install
- name: Install frontend dependencies
working-directory: ${{ env.frontend-directory }}
run: |
npm install -g pnpm
pnpm i --frozen-lockfile
- name: Install Playwright Browsers
working-directory: ${{ env.frontend-directory }}
run: pnpm exec playwright install
- name: Run migrations
working-directory: ${{ env.backend-directory }}
run: poetry run python manage.py migrate
- name: Start test server
working-directory: ${{ env.backend-directory }}
run: |
poetry run python manage.py createsuperuser --noinput
nohup poetry run python manage.py runserver &
- name: Build frontend
env:
NODE_OPTIONS: "--max-old-space-size=6144"
working-directory: ${{ env.frontend-directory }}
run: pnpm run build
- name: Run tests
working-directory: ${{ env.frontend-directory }}
run: pnpm exec playwright test tests/functional/startup.test.ts
- name: Set current date as env variable
if: ${{ !cancelled() }}
run: echo "NOW=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_ENV
- name: Sanitize branch name
if: ${{ !cancelled() }}
run: |
SAFE_NAME=$(echo "$BRANCH_NAME" | sed -E 's/[^a-zA-Z0-9_-]/_/g')
echo "BRANCH_SANITIZED=$SAFE_NAME" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: ${{ env.BRANCH_SANITIZED }}-${{ env.NOW }}-${{ github.job }}-report-${{ matrix.playwright-browser }}
path: |
${{ env.backend-directory }}/*.log
${{ env.frontend-directory }}/tests/reports/
retention-days: 5
startup-docker-compose-test:
runs-on: ubuntu-24.04
timeout-minutes: 22
env:
COMPOSE_TEST: True
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install frontend dependencies
working-directory: ${{ env.frontend-directory }}
run: |
npm install -g pnpm
pnpm i --frozen-lockfile
- name: Install Playwright Browsers
working-directory: ${{ env.frontend-directory }}
run: pnpm exec playwright install
- name: Build the Docker app
run: |
rm -rf db
mkdir db
docker compose -f docker-compose-build.yml up -d
- name: Config the Docker app
run: |
sleep 200 # give the migrations time to finish (included in the up on the previous step)
docker compose -f docker-compose-build.yml exec backend /bin/bash -c "[email protected] DJANGO_SUPERUSER_PASSWORD=1234 poetry run python manage.py createsuperuser --noinput && exit 0"
- name: Run tests
working-directory: ${{ env.frontend-directory }}
run: |
response=$(curl -d "[email protected]&password=1234" -H "Origin: https://localhost:8443" https://localhost:8443/login\?/login -k)
server_reponse='{"type":"redirect","status":302,"location":"/"}'
echo "[SERVER_RESPONSE] $response"
echo "[EXPECTED_RESPONSE] $server_reponse"
if [[ "$response" == "$server_reponse" ]]; then
echo "Success"
exit 0
else
echo "Failure"
echo "Check if migrations are not too long"
exit 1
fi
enterprise-startup-functional-test:
runs-on: ubuntu-24.04
timeout-minutes: 19
env:
LOG_LEVEL: DEBUG
LOG_OUTFILE: ciso-assistant.log
DJANGO_DEBUG: "True"
DJANGO_SUPERUSER_EMAIL: [email protected]
DJANGO_SUPERUSER_PASSWORD: 1234
POSTGRES_NAME: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DB_HOST: localhost
CISO_ASSISTANT_SUPERUSER_EMAIL: ""
CISO_ASSISTANT_URL: http://localhost:4173
DJANGO_SETTINGS_MODULE: enterprise_core.settings
PUBLIC_BACKEND_API_URL: http://localhost:8000/api
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
max-parallel: 4
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install Poetry via pipx
shell: bash
run: |
set -euo pipefail
python -m pip install --upgrade pip
python -m pip install --upgrade pipx
python -m pipx ensurepath
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
python -m pipx install poetry
- name: Configure Poetry to not use virtualenvs
run: poetry config virtualenvs.create false
- name: Check Poetry version
shell: bash
run: poetry --version
- name: Install backend requirements
working-directory: ${{ env.backend-directory }}
run: poetry install
- name: Install enterprise backend
working-directory: ${{ env.enterprise-backend-directory }}
run: poetry install
- name: Build enterprise frontend
working-directory: ${{ env.enterprise-frontend-directory }}
env:
NODE_OPTIONS: "--max-old-space-size=6144"
run: make
- name: Install Playwright Browsers
working-directory: ${{ env.enterprise-frontend-build-directory }}
run: pnpm exec playwright install
- name: Run migrations
working-directory: ${{ env.backend-directory }}
env:
SETTINGS_MODULE: ${{ env.enterprise-backend-settings-module }}
run: poetry run python manage.py migrate --settings="$SETTINGS_MODULE"
- name: Start test server
working-directory: ${{ env.backend-directory }}
env:
SETTINGS_MODULE: ${{ env.enterprise-backend-settings-module }}
run: |
poetry run python manage.py createsuperuser --noinput --settings="$SETTINGS_MODULE"
nohup poetry run python manage.py runserver --settings="$SETTINGS_MODULE" &
- name: Run tests
working-directory: ${{ env.enterprise-frontend-build-directory }}
run: pnpm exec playwright test tests/functional/startup.test.ts
- name: Set current date as env variable
run: echo "NOW=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_ENV
- name: Sanitize branch name
run: |
SAFE_NAME=$(echo "$BRANCH_NAME" | sed -E 's/[^a-zA-Z0-9_-]/_/g')
echo "BRANCH_SANITIZED=$SAFE_NAME" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: ${{ env.BRANCH_SANITIZED }}-${{ env.NOW }}-${{ github.job }}-report-${{ matrix.playwright-browser }}
path: |
${{ env.backend-directory }}/*.log
${{ env.enterprise-frontend-build-directory }}/tests/reports/
retention-days: 5
enterprise-startup-docker-compose-test:
runs-on: ubuntu-24.04
env:
COMPOSE_TEST: True
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install frontend dependencies
working-directory: ${{ env.enterprise-frontend-directory }}
run: make pre-build
- name: Install Playwright Browsers
working-directory: ${{ env.enterprise-frontend-build-directory }}
run: pnpm exec playwright install
- name: Build the Docker app
run: docker compose -f enterprise/docker-compose-build.yml up -d
- name: Config the Docker app
env:
SETTINGS_MODULE: ${{ env.enterprise-backend-settings-module }}
run: |
sleep 200 # give the migrations time to finish (included in the up on the previous step)
docker compose -f enterprise/docker-compose-build.yml exec backend /bin/bash -c "[email protected] DJANGO_SUPERUSER_PASSWORD=1234 poetry run python manage.py createsuperuser --noinput --settings="$SETTINGS_MODULE" && exit 0"
- name: Run tests
working-directory: ${{ env.frontend-directory }}
run: |
response=$(curl -d "[email protected]&password=1234" -H "Origin: https://localhost:8443" https://localhost:8443/login\?/login -k)
server_reponse='{"type":"redirect","status":302,"location":"/"}'
echo "[SERVER_RESPONSE] $response"
echo "[EXPECTED_RESPONSE] $server_reponse"
if [[ "$response" == "$server_reponse" ]]; then
echo "Success"
exit 0
else
echo "Failure"
echo "Check if migrations are not too long"
exit 1
fi