Skip to content

testing

github-actions[bot] edited this page Nov 29, 2026 · 2 revisions

🧪 How it is tested

← All documentation

🦀 Backend

cd backend
cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo test

The API tests run on the database that TEST_DATABASE_URL names (or DATABASE_URL if it isn't set). Each test gets its own fresh database with the migrations applied, so tests never see each other's data:

Database TEST_DATABASE_URL Each test gets
PostgreSQL postgres://rollcall:rollcall@localhost:5432/rollcall (docker compose up -d db) A new database rc_test_<random>
SQLite sqlite: A new file in the temp folder
MySQL/MariaDB mysql://root:password@localhost:3306/ A new database rc_test_<random>

The user needs permission to create databases. The test databases are left behind, so use a throwaway server.

  • API tests (backend/tests/api.rs) call the real router: a spool's whole life (adding it, weight changes and undo, the dashboard numbers), search and filters, and validation errors.
  • Parser tests run the link parser on saved product pages in backend/tests/fixtures/. They never use the network, so a store changing its page can't break the build.
  • Unit tests next to the code cover the color and brand tables, the title and text patterns, and the safety check for private addresses.

Queries aren't checked when the code compiles, since one query runs on three databases. The API tests are what catch a broken query, so a change to a query or the schema should be tested on all of them; CI does that on every push. A schema change needs a migration for each database: a new file in backend/migrations/postgres/, sqlite/ and mysql/.

🖥️ Frontend

cd frontend
npm run lint && npm run check && npm test && npm run build

Prettier, svelte-check (TypeScript), Vitest unit tests for the formatting helpers, and a production build.

⚙️ On GitHub

.github/workflows/tests.yml runs on every push and pull request:

Job What it checks
Lint actionlint (with shellcheck) on the workflows, shellcheck on the shell scripts, hadolint on the Dockerfile, and markdownlint on the documentation
Backend rustfmt, clippy, and the API tests on PostgreSQL 18, SQLite, MariaDB 11.4 and MySQL 8.4
Frontend The checks above
Docker image Builds the image on amd64 and arm64, starts it next to PostgreSQL 18 and on its own with SQLite, checks the API, the web interface, and saving a spool, and scans it with Trivy
Native build Builds the static Linux server for x86_64 and aarch64 and packs the downloads. It installs each one as a systemd service with install.sh, then checks the API, the rollcall command, an upgrade, and uninstalling. The x86_64 download is also installed in Debian 13, Ubuntu 24.04, Rocky Linux 9 and Oracle Linux 9 containers
Native build (FreeBSD) In a FreeBSD 14 virtual machine: builds the server, runs the API tests on SQLite, and installs and starts the rc.d service
Publish On develop and main only: tags the tested images (see Docker)
Publish the native downloads On develop and main only: puts the tested downloads on the develop-build or latest release (see Installing without Docker)

It also runs each Monday, so a new base image or dependency that breaks the build shows up without a push.

Clone this wiki locally