Development and tests
Setup
Frontend
-
Start the dev services:
docker compose -f compose.dev.yml up -d --build -
Run
pnpm devinphotoly_frontend_vue.
See the frontend README in the repository.
Server
The server uses Go 1.24 in photoly_server.
go test ./... needs:
TEST_DATABASE_URLfor database-backed tests- The ONNX Runtime library for the AI worker test
Database access
Photoly uses sqlc.
- Edit
photoly_server/internal/db/queries/*.sql. - Run
devbox run -- sqlc generateinphotoly_server.
CI fails if internal/db/gen is stale.
Server checks
Run these in photoly_server:
sqlc generate
go vet ./...
go test -skip TestWorker ./...
| Variable | Use |
|---|---|
TEST_DATABASE_URL | A fresh migrated database. Runs source, scan, quota and API integration tests. |
PHOTOLY_TEST_DATABASE_URL | Legacy user and catalog suites. |
The legacy suites reset the public schema of PHOTOLY_TEST_DATABASE_URL. Use a separate disposable database.
TestWorker also needs ONNX Runtime.
Storage tests
S3 contract and lifecycle tests use a disposable bucket on an S3-compatible server:
PHOTOLY_TEST_S3_ENDPOINTPHOTOLY_TEST_S3_BUCKETPHOTOLY_TEST_S3_ACCESS_KEYPHOTOLY_TEST_S3_SECRET_KEY
WebDAV tests run a real Nextcloud write probe:
PHOTOLY_TEST_WEBDAV_URLPHOTOLY_TEST_WEBDAV_USERNAMEPHOTOLY_TEST_WEBDAV_PASSWORD
Use a dedicated test account and directory. If the server is private, use an allowed origin. The protocol fixture also tests conditional conflicts, unsafe hrefs, partial listings and transaction compensation.
SMB tests:
- Set
SMB_FIXTURE_ROOTto use a disposable Samba share. - For a real NAS, set
SMB_TEST_ENV_FILEto a protected local file withuser=andpassword=. Then runTestSMBIntegrationandTestNASMediaIndex. - The tests create unique child directories, leave existing files alone and remove their fixtures.
Never commit the credential file.
Frontend checks
pnpm typecheck
pnpm exec vitest run
pnpm exec playwright test e2e/storage-sources.spec.ts e2e/folder-tiles.spec.ts