Prerequisites
Build assets before testing:Unit Tests
Run all unit tests:SKIP_INTEGRATION=1 flag skips integration tests that require Docker/Podman.
Run Tests Manually
Run tests withgo test directly:
Test Coverage
Generate coverage report:Integration Tests
Integration tests use Playwright to test Anubis in realistic browser scenarios.Run All Integration Tests
Run with Specific Container Runtime
Use Podman:Integration tests require Docker or Podman to be installed and running.
Smoke Tests
Smoke tests validate Anubis against production-adjacent infrastructure configurations.What Are Smoke Tests?
Thetest/ directory contains smoke tests - each is a folder with a test.sh script that:
- Sets up infrastructure (Caddy, nginx, Docker registry, etc.)
- Runs Anubis in that configuration
- Validates expected behavior
- Tears down infrastructure
Available Smoke Tests
Run Smoke Tests
Smoke tests run automatically in GitHub Actions using.github/workflows/smoke-tests.yaml.
Run a specific smoke test manually:
Pale Moon Tests
Pale Moon browser has historically exposed bugs in Anubis’s JavaScript challenge code. The Pale Moon smoke tests ensure compatibility:Test Conventions
FromCONTRIBUTING.md, tests should follow these patterns:
Table-Driven Tests
Use table-driven test patterns:Helper Functions
Uset.Helper() in test helpers:
Cleanup
Uset.Cleanup() for teardown:
Error Assertions
Useerrors.Is for sentinel error validation:
Linting
Run static analysis tools:Continuous Integration
All tests run automatically in GitHub Actions on:- Every push
- Every pull request
- Scheduled nightly builds
.github/workflows/smoke-tests.yaml.