Skip to content

Fix updater test corrupting real LaunchAgent plist - #21

Merged
KTSCode merged 3 commits into
mainfrom
todo/fix_plist_test_isolation
Apr 16, 2026
Merged

Fix updater test corrupting real LaunchAgent plist#21
KTSCode merged 3 commits into
mainfrom
todo/fix_plist_test_isolation

Conversation

@KTSCode

@KTSCode KTSCode commented Apr 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • rewrite_plist/2 condition override_path || File.exists?(path) always wrote when an override was given, and the "skips plist rewrite" test omitted the override — falling through to ~/Library/LaunchAgents on the real filesystem
  • Every mix test run overwrote the installed plist with a temp-dir binary path, breaking the LaunchAgent on next login (exit code 78)
  • Changed condition to File.exists?(path) so plist is only rewritten when one already exists
  • Added plist_path: isolation to the "skips" test and pre-created the plist file in the "rewrites" test

Test plan

  • "skips plist rewrite when no plist exists" fails before fix, passes after
  • "rewrites plist after successful update" still passes with pre-created plist
  • Full updater test suite passes (31 tests)
  • Full project suite passes (222 tests, 5 doctests, 0 failures)
  • mix quality passes (format, compile, credo, doctor, tests)
  • Restored real ~/Library/LaunchAgents/com.severance.daemon.plist to correct binary path

KTSCode added 3 commits April 15, 2026 19:35
rewrite_plist/2 always wrote when plist_path was overridden,
and one test omitted the override entirely — falling through
to ~/Library/LaunchAgents on the real filesystem. Every test
run overwrote the plist with a temp-dir path, breaking the
LaunchAgent on next login.

Change the condition from `override_path || File.exists?(path)`
to `File.exists?(path)` so rewrite_plist only updates files
that already exist, regardless of how the path was resolved.
@KTSCode
KTSCode merged commit 3b4afee into main Apr 16, 2026
@KTSCode
KTSCode deleted the todo/fix_plist_test_isolation branch April 16, 2026 02:43
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