Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
34 changes: 17 additions & 17 deletions .github/workflows/ruff.yml → .github/workflows/code-quality.yaml
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
name: 🐍 Code Quality
name: code-quality

on:
push:
branches: [main]
paths:
- "**.py"
- "app/pyproject.toml"
- ".github/workflows/ruff.yml"
- ".github/workflows/ruff.yaml"
pull_request:
branches: [main]
paths:
- "**.py"
- "app/pyproject.toml"
- ".github/workflows/ruff.yml"
- ".github/workflows/ruff.yaml"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ruff-check:
name: 🔍 Lint & Format Check
name: lint & format check
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
python-version: ["3.13"]
python-version: ["3.14"]

steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4
- name: checkout repository
uses: actions/checkout@v6

- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: 💾 Cache pip dependencies
uses: actions/cache@v4
- name: cache pip dependencies
uses: actions/cache@v5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements*.txt', '**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-

- name: 📦 Install Ruff
- name: install ruff
run: |
python -m pip install --upgrade pip
pip install ruff

- name: ✨ Check code formatting
- name: check code formatting
run: |
ruff format --check --diff .

- name: 🔍 Lint code
- name: lint code
run: |
ruff check --output-format=github .

- name: 📊 Generate Ruff report
- name: generate ruff report
if: failure()
run: |
echo "## 🐍 Ruff Issues Found" >> $GITHUB_STEP_SUMMARY
echo "The following issues were found by Ruff:" >> $GITHUB_STEP_SUMMARY
echo "## ruff issues found" >> $GITHUB_STEP_SUMMARY
echo "the following issues were found by ruff:" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
ruff check --output-format=text . >> $GITHUB_STEP_SUMMARY || true
echo '```' >> $GITHUB_STEP_SUMMARY
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
name: 🧪 E2E Tests
name: e2e-tests

on:
workflow_dispatch:
inputs:
test_path:
description: "Specific test to run (e.g., e2e/auth/test_login.py::TestLoginSuccess)"
description: "specific test to run (e.g., e2e/auth/test_login.py::TestLoginSuccess)"
required: false
default: "e2e/"
push:
branches: [main]
paths:
- "app/**"
- "tests/**"
- ".github/workflows/e2e-tests.yml"
- ".github/workflows/e2e-tests.yaml"
pull_request:
branches: [main]
paths:
- "app/**"
- "tests/**"
- ".github/workflows/e2e-tests.yml"
- ".github/workflows/e2e-tests.yaml"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -30,27 +30,27 @@ jobs:
timeout-minutes: 15

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: checkout repository
uses: actions/checkout@v6

- name: Set up Python 3.13
uses: actions/setup-python@v5
- name: set up python 3.14
uses: actions/setup-python@v6
with:
python-version: "3.13"
python-version: "3.14"

- name: Install uv
uses: astral-sh/setup-uv@v4
- name: install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "app/pyproject.toml"

- name: Install dependencies
- name: install dependencies
run: |
cd app
uv sync --extra test
uv run playwright install chromium --with-deps

- name: Run E2E tests
- name: run e2e tests
run: |
cd app
uv run pytest ../tests/${{ github.event.inputs.test_path || 'e2e/' }} -v --tb=short
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.8
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format
9 changes: 8 additions & 1 deletion tests/e2e/auth/test_logout.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
E2E tests for the logout functionality.
"""

import re

import pytest
from playwright.sync_api import expect

from tests.e2e.pages.base_page import BasePage
from tests.e2e.pages.login_page import LoginPage
Expand Down Expand Up @@ -251,7 +254,11 @@ def test_logout_and_login_as_different_user(
# Login as test user
login_page.navigate("/login/redirect=&")
login_page.login(test_user.username, test_user.password)
page.wait_for_url("**/", timeout=5000)
page.wait_for_load_state("networkidle")
# Use regex to match home URL with or without trailing slash
expect(page).to_have_url(
re.compile(rf"^{re.escape(flask_server['base_url'])}/?$"), timeout=10000
)

# Verify logged in as different user
navbar.expect_logged_in()
Expand Down