Katlendar Developer manual GitHub

Testing

The test suite, the sibling test, pictures of the window and the checks against real servers.

Run the tests#

cargo test

There are about 220 tests. Most sit at the bottom of the file they test, in a tests module. Tests that draw the window use egui_kittest and run headless, so they need no screen.

CI (.github/workflows/ci.yml) runs on every pull request:

SystemWhat runs
Ubuntucargo test --locked
Windows, macOScargo check --locked

It skips changes that touch only site/, docs/ or Markdown files.

The sibling test#

settings::tests::calendars_and_task_lists_pages_line_up draws Settings › Active calendars and Settings › Task lists headless. It fails when their rows are in a different order or at different heights.

Each new pair of sibling pages goes into this test. See Siblings.

Screenshots#

To look at the window without touching your own data, take a picture:

KATLENDAR_SHOW_SETTINGS=lists cargo run -q -- --screenshot /tmp/lists.png

A picture:

  • uses sample data (Data::sample) and saves nothing;
  • skips the lock, so it runs beside your open copy;
  • waits for map tiles and takes the picture at frame 120.

Open the PNG to check it. An AI helper can read it too.

Test aids#

src/testaid.rs lists every aid. Each is an environment variable that sets the window up before the picture.

AidWhat it does
KATLENDAR_NOW=2026-11-11T10:30the current time
KATLENDAR_WINDOW=760x480the window size
KATLENDAR_THEME=light or darkthe theme
KATLENDAR_FONT=<family>a font other than the system's
KATLENDAR_SLOT=<minutes>the grid slot length
KATLENDAR_PANEL_RIGHTthe task panel on the right
KATLENDAR_NARROWas if the window were narrow
KATLENDAR_DAYS=3show that many days
KATLENDAR_NAV=<n>, KATLENDAR_NAV_DAYS=<n>turn that many pages, or move that many days
KATLENDAR_DEMO_ACCOUNTa signed-in account with calendars and lists
KATLENDAR_GREYscheduled tasks are done and every frame skips tomorrow
KATLENDAR_BUFFERSbuffers around each Work event
KATLENDAR_BLOCKS=dynamicblocks painted as gradients of their colours
KATLENDAR_SHOW_MENU=<name>a right-click menu, shown in a window
KATLENDAR_SHOW_SETTINGS=<page>a settings page: general, appearance, active, lists, tags, colours, planner, frames, quick, calendars, maps, shortcuts or info
KATLENDAR_SETTINGS_QUERY, KATLENDAR_SHORTCUT_QUERYtext typed into the settings or shortcut search
KATLENDAR_SUB_KIND=<n>, KATLENDAR_SUB_URL=<url>the integration being set up, and a subscription address
KATLENDAR_SHOW_CREATE[=frame], KATLENDAR_CREATE_AT=15the new block window open, its block at that hour
KATLENDAR_SHOW_FRAMEthe first frame's editor open
KATLENDAR_SHOW_EDIT=<n>the editor of the nth block open
KATLENDAR_SHOW_NEWTASK=<list>a new task, as that list's + opens it
KATLENDAR_QUICK=<text>the new task bar (Ctrl+T) with that typed in
KATLENDAR_LIST_EDIT=<list>, KATLENDAR_NEW_LISTa list's editor, or the new-list window
KATLENDAR_DRAG="title@x,y"a task, or a colour priority row, held as if dragged
KATLENDAR_MORPH=<0..1>the task panel part way between the rail and open
KATLENDAR_UPDATE=<version>the notice that that version is out
KATLENDAR_GEO=<lat>,<lon>, KATLENDAR_PICK[=<words>]sample places at that spot; the place picker open
KATLENDAR_MAPS=googleplaces from Google Maps, with no key saved
KATLENDAR_REPEAT=<field>a repeat field (crep, erep, rep) filled in

Some only work while a picture is being taken. Read src/testaid.rs for the values each one takes.

Without a screen#

On a server or in CI, run the picture under a virtual screen with software drawing:

LIBGL_ALWAYS_SOFTWARE=1 xvfb-run -a -s "-screen 0 1920x1080x24" cargo run -q -- --screenshot /tmp/shot.png

scripts/cloud-setup.sh installs the packages this needs.

Servers you run yourself#

Some tests talk to a real calendar server when you give them one. Without the variables, they pass without doing anything.

VariablesServer
KATLENDAR_TEST_CALDAV, KATLENDAR_TEST_USER, KATLENDAR_TEST_PASSany CalDAV server, such as Radicale on your own computer
KATLENDAR_TEST_NEXTCLOUDa Nextcloud server

Live checks#

Live checks use the real accounts set up in your own copy of katlendar. They are marked #[ignore], so cargo test skips them. Run them by hand:

cargo test live_ -- --ignored --nocapture

Each makes a test event about a week ahead, named "katlendar map check (delete me)", changes it and deletes it again, also when a step fails. They go through the same code as the app: the keyring's secret, open_account, sync::push and pull. They only read data.json and config.json, so the app may stay open.

KATLENDAR_LIVE_CALENDAR names the calendar to use; without it, the first one that can be written to. Only Proton is covered so far (src/syncing/live.rs). What the map checks found is in docs/map-checks.md.

The keyring check needs a running keyring:

cargo test keyring_round_trip -- --ignored

Run the live checks after changing a provider, the keyring code or the map code.

Improve this page on GitHub