Skip to content

Testing

Run checks that match the area you changed.

Docs

bash
cd docs
npm ci
npm run build

Frontend

bash
cd frontend
npm install
npm run typecheck
npm run lint
npm run format:check
npm test
npm run build

Storybook Visual Regression

Storybook visual snapshots are handled by the GitHub Pages Visual Regression workflow. Same-repository pull request runs happen automatically for frontend changes. The workflow also runs on main pushes that touch frontend source, stories, Storybook config, frontend scripts, or frontend package metadata.

The workflow builds Storybook, captures screenshots with Playwright, compares them against the baseline stored on the visual-regression-state branch, and publishes a static report under /visual/reports/pr-<number>/ on GitHub Pages. For PR reports, tiny pixel drift below 0.1% is treated as unchanged unless the workflow can map that screenshot to a Storybook file touched by the PR; touched stories still appear even when their visual diff is small. The PR description is updated with the report link plus changed, added, and removed screenshot lists. Merging to main refreshes the baseline under /visual/baseline/ for future PRs. When a pull request is closed or merged, its /visual/reports/pr-<number>/ report directory is removed from GitHub Pages.

For local proof runs:

bash
cd frontend
npm run snapshots

Do not commit generated PNGs from frontend/visual-screenshots/ or frontend/storybook-snapshots/.

Backend

bash
ruff check app tests
ruff format --check app tests
pytest

Smoke Tests

Smoke tests need a running Borg UI instance.

bash
docker compose up -d --build
python3 tests/smoke/run_core_smoke.py --url http://localhost:8081

Run broader suites when touching backup, restore, repository, archive, SSH, or scheduling behavior.

Some smoke tests require host capabilities or external setup:

  • FUSE archive mounting tests require FUSE support.
  • Remote SSH tests require SSH test configuration.
  • OIDC tests require an OIDC test setup.

What To Run

ChangeMinimum check
Docs onlycd docs && npm run build
Frontend UIfrontend typecheck, lint, tests
Backend APIbackend lint and relevant pytest
Backup/restore corerelevant unit tests plus smoke tests
Docker/runtimebuild image and run smoke tests

Distributed under the AGPL-3.0 License.