Repository navigation
test: check the XDG_STATE_HOME branch in database-path-agreement - #830
Conversation
Signed-off-by: Ym <[email protected]>
vladimirrott
left a comment
There was a problem hiding this comment.
Reviewed at 3ded27ac3c101c9ede8838341b68f9473775dcd3.
Reading the daemon's suffix out of default_database_path() instead of rebuilding it with the installer's own path.join is the detail that makes this test worth having: it compares two pieces of code, not one with itself. The loud failure when the join line changes shape is the right default too.
I ran tests/release/database-path-agreement.test.sh in a container with no network:
| tree | result |
|---|---|
| your head | rc=0, Installer, daemon and docs agree on /home/testuser/.local/state/sysknife/daemon.sqlite. |
installer's XDG branch changed to 'sysknife-audit' |
rc=1, installer (install-daemon.js): /xdg/state/sysknife-audit/daemon.sqlite against daemon (default_database_path): /xdg/state/sysknife/daemon.sqlite |
daemon's XDG join changed to sysknife/audit.sqlite |
rc=1, installer: /xdg/state/sysknife/daemon.sqlite against daemon: /xdg/state/sysknife/audit.sqlite |
the installer mutant on main's test |
rc=0 (the gap #818 describes) |
shellcheck --severity=warning (0.10.0) is clean on the script, which covers the one check you couldn't run locally.
Nothing blocks this. Approving. Your CI runs are waiting on an approval that is mine to give, so the merge is on my side from here.
If you run Linux machines yourself, npx sysknife-setup --daemon-mode=user installs SysKnife with no system service and read-only actions only. No obligation.
|
Sysknife has my attention, and I'd like to stay involved, both by sending more changes and by helping maintain it down the road. If it would help you, I'd welcome being considered for collaborator access, and no worries at all if not. |
Fixes #818
tests/release/database-path-agreement.test.shonly asked the installer for its database path withXDG_STATE_HOMEunset, so the other branch ofdatabasePath()inpackages/setup/install-daemon.jswas never compared with the daemon's.This adds a second comparison: the installer is asked with
XDG_STATE_HOME=/xdg/state, and the answer is compared with/xdg/state/plus the suffix read out of thePathBuf::from(state).join("...")line incrates/sysknife-core/src/lib.rs(grep on the source, no build). The expected value is not computed with the installer's ownpath.join. The existing fallback check and the docs check are unchanged. If the join line can no longer be found, the guard fails with a message instead of passing.What I ran
bash tests/release/database-path-agreement.test.shon the unmodified installer: exit 0.'sysknife'changed to'sysknife-audit'on thexdgStatebranch ofinstall-daemon.js:installer: /xdg/state/sysknife-audit/daemon.sqliteagainstdaemon: /xdg/state/sysknife/daemon.sqlite;bash -non the script is clean.scripts/ci-local.sh, shellcheck (not installed here).