MSaving

Run the tests

How each repo is checked locally and in CI.

Every pull request runs the same checks in CI. Run them locally first.

Backend: 75 tests against a real Postgres 17

The tests build throwaway databases with the server’s own migration runner, so a passing run also proves the migrations work. They need a superuser on a local Postgres 17:

cd msaving/backend
source .venv/bin/activate

# once: a disposable Postgres 17 on port 5499
docker run -d --name pgtest -e POSTGRES_HOST_AUTH_METHOD=trust -p 127.0.0.1:5499:5432 postgres:17
# later sessions: docker start pgtest

export TEST_ADMIN_URL="postgresql+psycopg://postgres@localhost:5499/postgres"
PATH=/usr/lib/postgresql/17/bin:$PATH python -m pytest -q -p no:cacheprovider tests/

Expect 75 passed.

Never point the tests at a database you care about They create and drop databases and logins (api_login, t_api, …) on whatever server TEST_ADMIN_URL names.

File Covers
tests/test_schema.py The database: ledger rules, RLS, roles, sharing, purge, the lock-down, temp-table tricks
tests/test_api.py The API routes, the own-web-app rule, the web app’s files, timezones
tests/test_sign_in.py Setup, invites, sign-in, two-factor and recovery codes, resets, the admin, rate limits, the migration runner, updates
tests/test_backup.py The backup job and the documented restore (needs pg_dump, pg_restore, psql 17)

Requirements and tests maps every requirement to the test that proves it. A new requirement gets a row there (docs PR) and a test (code PR).

Web

cd msaving/web
npm run lint && npm test && npm run build

npm test includes src/i18n/strings.test.ts, which fails if vi.json and en.json don’t have the same keys.

The image and the stack

cd msaving
docker compose down -v && docker compose up -d --build && docker compose logs -f msaving

A fresh stack must come up healthy, print a setup code, and run the three daily jobs. Do this before a release (Releases).

Docs (this site)

cd msaving-landing
npm run check && npm run build     # the docs are part of the website

What CI runs

Repo On Steps
msaving every PR, push to dev and main; before every release backend pytest with a Postgres 17 service; web lint, test, build; docker build and the compose file’s validity
landing every PR, push to dev and main translation keys, build

Required status checks on protected branches: backend, web, image (msaving); check (landing).

Edit this page · Report a problem