Testing
Parascope maintains a high level of code quality through comprehensive unit and end-to-end tests.
Backend Tests
Backend tests use pytest and run in an isolated environment with a dedicated database.
Running with Docker (Recommended)
The easiest way to run backend tests is using the dedicated test orchestration file. This handles the transient database and environment cleanup automatically.
docker compose -f docker-compose.test.yml up --build --abort-on-container-exit
Running Locally
If you have a local PostgreSQL instance dedicated to testing:
- Set
DATABASE_URLto your test database inbackend/.env. - Run the tests:
cd backend
uv run pytest
End-to-End (E2E) Tests
E2E tests use Playwright to verify the full stack (Frontend + Backend + DB).
Running in Docker
To run all E2E tests in a completely isolated environment:
docker compose -f docker-compose.e2e.yml up --build --abort-on-container-exit --exit-code-from e2e-runner
Targeted Testing
You can run specific test files using the PLAYWRIGHT_ARGS environment variable:
PLAYWRIGHT_ARGS="tests/folders.spec.ts" docker compose -f docker-compose.e2e.yml up --build --abort-on-container-exit --exit-code-from e2e-runner
Visual Debugging (Videos)
To record videos of the test execution (saved in e2e/test-results/), set VIDEO=on:
docker compose -f docker-compose.e2e.yml run -e VIDEO=on e2e-runner
Continuous Integration
Every pull request triggers a CI pipeline (defined in .github/workflows/ci.yml) that executes:
- Frontend Linting and Build.
- Backend Linting (Ruff) and Unit Tests.
- Full E2E Test Suite.