Skip to content

Testing

Go

make test
  • internal/domain: pure unit tests (ranking, club competition, special prizes, age categories, amounts in words …).
  • internal/store and internal/web: integration tests. internal/testdb creates a throwaway, migrated database per test from TEST_DATABASE_URL; make test starts the compose PostgreSQL on port 5433 and sets the variable. Without it these tests are skipped.
  • internal/docs: checks the text of rendered PDFs with pdftotext when installed. DOCS_OUT=dir go test ./internal/docs/ writes the PDFs for a visual check.
  • internal/i18n: fails on untranslated messages or mismatched format verbs.

End to end

make e2e

Builds the real image, starts it with an empty database on :3002 (compose profile e2e) and runs the Cypress specs in e2e/cypress/e2e in the cypress/included image with Chrome at 1280×800. The Makefile's CYPRESS_IMAGE and the CI job must use the same tag.

Specs create their own club through the admin panel and their data through the API, so they can run in any order against the same instance. Toasts are [data-sonner-toast], confirmations [role=alertdialog].

Documentation screenshots

make docs-screenshots runs e2e/cypress/docs/screenshots.cy.js with its own config (1440×900) and writes the PNGs to docs/content/images/screenshots. It is not part of make e2e. Use invented names only: the screenshots are public.