Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
8a073ba
add tests
felixevers Dec 20, 2025
c0b1464
fix builds
felixevers Dec 20, 2025
b757991
Refactor codebase: improve structure, reduce duplication, add tests
felixevers Dec 21, 2025
9080720
Add job dependencies to GitHub Actions workflow
felixevers Dec 21, 2025
64cefdb
Fix workflow: add pytest-cov installation for coverage reports
felixevers Dec 21, 2025
c6036e3
Fix flake8 errors and add pytest-cov to requirements
felixevers Dec 21, 2025
93bdc4f
Remove coverage.xml from git and add to .gitignore
felixevers Dec 21, 2025
d230c73
Fix E2E tests: start backend and frontend servers
felixevers Dec 21, 2025
8e10aa1
Remove redundant alembic installation (already in requirements.txt)
felixevers Dec 21, 2025
889a7b1
Improve E2E server startup and health checks
felixevers Dec 21, 2025
6001a05
Improve server health checks with better logging and retries
felixevers Dec 21, 2025
591765d
Add health check endpoint for E2E tests
felixevers Dec 21, 2025
1e9033d
Fix unit tests for base resolvers
felixevers Dec 21, 2025
ada74f1
Fix integration test and improve E2E server startup
felixevers Dec 21, 2025
3c23749
Fix E2E tests: improve server startup and Playwright configuration
felixevers Dec 21, 2025
91eaf4d
Fix E2E tests: ensure baseURL is properly set and verify servers befo…
felixevers Dec 21, 2025
e815613
Fix Playwright config: extract baseURL to constant for consistency
felixevers Dec 21, 2025
a6fffdf
Fix E2E tests: use baseURL from context and update health checks
felixevers Dec 21, 2025
10cad67
remove node_modules
felixevers Dec 21, 2025
dbfede4
Fix e2e-tests.yml workflow and clarify workflow usage
felixevers Dec 21, 2025
c6c5cca
Update README to clarify recommended workflow
felixevers Dec 21, 2025
581e578
Fix E2E tests: use full URLs and improve error filtering
felixevers Dec 21, 2025
8a9c388
move to static handling
felixevers Dec 21, 2025
ab3c362
fix linting
felixevers Dec 21, 2025
29abf5c
fix resolver tests
felixevers Dec 21, 2025
aa51b1b
fix simulator keycloak await
felixevers Dec 21, 2025
ba1ceca
update output directory
felixevers Dec 21, 2025
283a8f4
update keycloak test startup
felixevers Dec 21, 2025
8845037
Fix GitHub Actions workflow: update artifact path and Keycloak servic…
felixevers Dec 21, 2025
c1a8a87
Fix Keycloak service entrypoint configuration
felixevers Dec 21, 2025
ad2660d
Simplify Keycloak service configuration - remove entrypoint override
felixevers Dec 21, 2025
422e09b
Fix Keycloak service: add entrypoint to run start-dev command
felixevers Dec 21, 2025
e869726
Use custom Keycloak Docker image for GitHub Actions
felixevers Dec 21, 2025
73dbc41
Fix Keycloak service: use quoted entrypoint instead of custom Dockerfile
felixevers Dec 21, 2025
ef569ec
Fix Keycloak entrypoint: wrap command in additional quotes
felixevers Dec 21, 2025
b92afa4
Fix Keycloak entrypoint: use single quotes for command
felixevers Dec 21, 2025
53b18b8
Update Keycloak entrypoint: use single quotes for command inside doub…
felixevers Dec 21, 2025
cdbda10
Update Keycloak entrypoint: include --entrypoint flag in quotes
felixevers Dec 21, 2025
8181731
Replace Keycloak service with manual Docker run steps
felixevers Dec 21, 2025
d69ccd2
Fix duplicate checkout step in simulator-tests job
felixevers Dec 21, 2025
7d9053c
Remove duplicate Keycloak wait step
felixevers Dec 21, 2025
1249f36
Fix Keycloak startup: add realm import and improve health check
felixevers Dec 21, 2025
d255036
Remove duplicate checkout step in simulator-tests job
felixevers Dec 21, 2025
23fb0de
Remove redundant Keycloak realm setup step
felixevers Dec 21, 2025
afc3d4f
Remove simulator testing from GitHub Actions workflow
felixevers Dec 21, 2025
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
101 changes: 101 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Running GitHub Actions Locally

This project uses GitHub Actions for CI/CD. You can run these workflows locally using [act](https://github.com/nektos/act), which simulates GitHub Actions in a Docker environment.

## Workflow Overview

### Main Workflow: `tests.yml` ⭐ **RECOMMENDED**
**Primary workflow for all tests and linting**
- Runs on: `push` and `pull_request` to `main` and `develop`
- Jobs:
- `backend-lint` - Lints Python backend code
- `simulator-lint` - Lints Python simulator code
- `frontend-lint` - Lints TypeScript/JavaScript frontend code
- `backend-tests` - Runs backend unit and integration tests (Python 3.11, 3.12, 3.13)
- `frontend-tests` - Runs frontend type checking
- `e2e-tests` - Runs end-to-end tests with Playwright (includes proper dependency installation)
- `build` - Builds the frontend application

**Use this workflow for:**
- ✅ Full CI/CD pipeline
- ✅ Comprehensive testing
- ✅ Pull request validation
- ✅ **E2E tests (properly configured with dependencies)**

### Secondary Workflow: `e2e-tests.yml`
**Standalone E2E test workflow (legacy/alternative)**
- Runs on: `push`, `pull_request` to `main` and `develop`, and `workflow_dispatch`
- Single job: `e2e` - Runs only E2E tests

**Use this workflow for:**
- Quick E2E test runs
- Manual E2E testing via workflow_dispatch
- Focused E2E test debugging

**Note:** The main `tests.yml` workflow is **recommended** for most use cases as it includes all tests, linting, and properly configured E2E tests with dependency installation.

## Prerequisites

1. **Docker**: Ensure Docker is installed and running
```bash
docker --version
```

2. **Install act**:
- **macOS**: `brew install act`
- **Linux**: Download from [act releases](https://github.com/nektos/act/releases)
- **Windows**: Use WSL or download from releases

## Usage

### List all workflows
```bash
act -l
```

### Run all workflows
```bash
act
```

### Run a specific workflow
```bash
act -W .github/workflows/tests.yml
act -W .github/workflows/e2e-tests.yml
```

### Run a specific job
```bash
act -j backend-tests
act -j frontend-tests
act -j e2e-tests
```

### Run on specific event
```bash
act push
act pull_request
```

### Use secrets (if needed)
Create a `.secrets` file in the repository root:
```
SECRET_NAME=secret_value
```

Then run:
```bash
act --secret-file .secrets
```

## Limitations

- Services (PostgreSQL, Redis) are automatically set up by act
- Some actions may behave differently locally vs. on GitHub
- Large workflows may take longer locally

## Troubleshooting

- If Docker images fail to pull, use `act --pull=false`
- For verbose output: `act -v`
- To use a specific platform: `act --container-architecture linux/amd64`
67 changes: 67 additions & 0 deletions .github/workflows/backend-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Backend Tests

on:
push:
branches: [main, develop]
paths:
- 'backend/**'
- '.github/workflows/backend-tests.yml'
pull_request:
branches: [main, develop]
paths:
- 'backend/**'
- '.github/workflows/backend-tests.yml'

jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:8
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install dependencies
working-directory: backend
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run unit tests
working-directory: backend
run: |
pytest tests/unit -v --cov=api --cov-report=xml
env:
DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5432/postgres
REDIS_URL: redis://localhost:6379
- name: Run integration tests
working-directory: backend
run: |
pytest tests/integration -v
env:
DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5432/postgres
REDIS_URL: redis://localhost:6379


114 changes: 114 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: E2E Tests

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch:

jobs:
e2e:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:8
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379

steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install backend dependencies
working-directory: backend
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install frontend dependencies
working-directory: web
run: npm ci
- name: Install E2E test dependencies
working-directory: tests
run: npm ci
- name: Install Playwright browsers
working-directory: tests
run: npx playwright install --with-deps chromium
continue-on-error: true
- name: Run database migrations
working-directory: backend
run: |
alembic upgrade head
env:
DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5432/postgres
- name: Start backend
working-directory: backend
run: |
uvicorn main:app --host 0.0.0.0 --port 8000 &
env:
DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5432/postgres
REDIS_URL: redis://localhost:6379
ISSUER_URI: http://localhost:8080/realms/tasks
PUBLIC_ISSUER_URI: http://localhost:8080/realms/tasks
CLIENT_ID: tasks-backend
CLIENT_SECRET: tasks-secret
ENV: test
- name: Build frontend
working-directory: web
run: npm run build
- name: Start frontend
working-directory: web
run: |
npm start &
env:
NEXT_PUBLIC_API_URL: http://localhost:8000/graphql
- name: Wait for backend
run: |
echo "Waiting for backend to start..."
timeout 120 bash -c 'until curl -f -s http://localhost:8000/health > /dev/null 2>&1; do sleep 2; done'
echo "Backend is ready!"

- name: Wait for frontend
run: |
echo "Waiting for frontend to start..."
timeout 120 bash -c 'until curl -f -s http://localhost:3000 > /dev/null 2>&1; do sleep 2; done'
echo "Frontend is ready!"
- name: Run E2E tests
working-directory: tests
run: |
npx playwright test
env:
E2E_BASE_URL: http://localhost:3000
CI: true
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 30


31 changes: 31 additions & 0 deletions .github/workflows/frontend-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Frontend Tests

on:
push:
branches: [main, develop]
paths:
- 'web/**'
- '.github/workflows/frontend-tests.yml'
pull_request:
branches: [main, develop]
paths:
- 'web/**'
- '.github/workflows/frontend-tests.yml'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
working-directory: web
run: npm ci
- name: Run linter
working-directory: web
run: npm run lint


Loading
Loading