انتقل إلى المحتوى

Testing

Unit tests (Rust)

Tests live next to the code, in #[cfg(test)] modules: 76 of them. They cover:

Area Examples
Auth and crypto password hashing, sealing and opening AI keys
Permissions role ordering and access rules
Storage Range parsing (filesystem), the SigV4 signer, downloads signed for the bucket but sent through the download proxy
Media silence detection parsing, loudness parsing; with ffmpeg installed, real recordings are made, measured, cut and checked for silence (ai/audio.rs, and seekable.rs measuring a file that has no length in its header)
Configuration the storage size taken for a Backblaze bucket
AI catalogue rules (each model does both jobs), timing anchoring, JSON extraction, chapter cleaning, Gemini error handling, OpenAI-compatible JSON mode and streamed answers
Email the HTML template (links, escaping) and its text twin
Web link-preview cards, durations
Routes comments, shares, videos helpers

Run them:

cargo test -p vistilla-api
#   or, in Docker:
make test

Lint and format:

make clippy   # cargo clippy --all-targets -- -D warnings
make fmt

End-to-end smoke test

scripts/smoke.sh [base-url] drives a running instance with curl and checks the main flows:

  • health, accounts and workspaces;
  • uploads (whole and while recording) and Range requests;
  • comments, invitations and roles, private videos;
  • link previews, sharing and revocation;
  • insights, moments, notifications and search;
  • transcripts and summaries, AI settings;
  • bulk delete.
make up && make smoke                 # local stack
./scripts/smoke.sh https://staging.example.com

Needs updating

smoke.sh (and seed-demo.sh) were written before sign-up required the emailed 6-digit code. They call POST /api/auth/register and expect to be signed in, but that call now only sends a code, and the scripts never call /api/auth/register/verify. They therefore stop at the account step on every instance until they are taught to read and send the code.

Manual checks

  • web/assets/_mp4check.html prints which recording formats the current browser's MediaRecorder supports.
  • /assets/version.txt shows which commit a deployed instance is running.