Skip to content

test: keep the sync tests out of the real data dir - #116

Merged
davidboulay merged 1 commit into
mainfrom
test/isolate-sync-tests
Nov 6, 2026
Merged

davidboulay merged 1 commit into
mainfrom
test/isolate-sync-tests

Conversation

@davidboulay

Copy link
Copy Markdown
Owner

Why

Five sync tests imported `clippy` with the user's real XDG dirs. Running them on a dev machine wrote into the real `~/.local/share/clippy/received/`: since 1.7.1, every run leaves an empty `received//` folder there. They also read the real `settings.json`, so a result could depend on local settings.

What

`sync_delivery_test`, `sync_drift_test`, `sync_hint_test`, `sync_readvertise_test` and `sync_selftest` now point `XDG_DATA_HOME`, `XDG_CONFIG_HOME` and `XDG_RUNTIME_DIR` at a throwaway dir before importing `clippy`, as `multi_file_groups_test` already does. Test code only; no app change and no version bump.

Tested (on the Mac)

  • Before: running the five tests created `received/3daa15e6…/` in the real data dir.
  • After: all five pass, and `find ~/.local/share/clippy ~/.config/clippy -newer ` lists nothing.

🤖 Generated with Claude Code

sync_delivery_test, sync_drift_test, sync_hint_test,
sync_readvertise_test and sync_selftest imported clippy with the user's
XDG dirs. A received file was moved into the real
~/.local/share/clippy/received/ (1.7.1 leaves an empty received/<hash>/
folder behind each run) and the tests read the real settings.

Each now points XDG_DATA_HOME, XDG_CONFIG_HOME and XDG_RUNTIME_DIR at a
throwaway dir before importing clippy, as multi_file_groups_test does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@davidboulay
davidboulay merged commit 7825437 into main Nov 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant