Repository navigation
friglet-tray: drop duplicate test fakes and tests (SNB-672) - #51
Closed
setavenger wants to merge 3 commits into
Closed
setavenger wants to merge 3 commits into
setavenger wants to merge 3 commits into
Conversation
Three lifecycle e2e tests wrote a shell script to a temp dir and then ran it as the "daemon binary". The test harness runs tests on parallel threads of one process, so another test's spawn could fork while the script was still open for writing; the forked child holds that write handle until it execs, and running the script in that window fails with "Text file busy" (ETXTBSY, os error 26). The scripts are now committed as executable fixtures under friglet-tray/tests/fixtures/ and located via CARGO_MANIFEST_DIR, so nothing is written while the tests run. The long-running fixture uses `exec sleep 30`, so killing the spawned child no longer leaves a stray sleep behind for 30 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…NB-667) Nothing here changes what the tray does: - Tauri commands set_config and set_scan_key: registered, but the UI has saved settings through apply_settings since 8bf4c40 and never invokes them. The SetConfig / SetScanKey protocol requests stay (wire compatibility with separately installed daemons). - lifecycle: decide/Action (used only by its own test), attach_or_spawn (no callers) and QuitAction/quit_action (an enum around one bool; perform_quit now tests the bool). - show_settings_window / show_wallet_window were copies differing only in the tab: one show_window_tab(app, tab). The FRIGLET_TRAY_SHOW_ON_START parse is a pure function of the value, so its test no longer sets the process environment (the unsafe set_var's safety comment was false: tests run in parallel). - get_config and send_with_note share one daemon_request helper (connect, request, map errors); the poller and the poll_once test helper share record_poll. - ErrorBook::event returned "should be logged", which its only caller ignored; it returns nothing now. Doc links point at the constants that exist (STALL_GRACE_SECS, UNREACHABLE_GRACE_SECS). - fake-daemon example: uses friglet_ipc's NETWORKS and one scan-key check instead of copies. - UI: CSS rules already covered by `[hidden] { display: none !important; }`, a `.hint code` rule that matches nothing, and an unused id="recent-errors". - tauri.conf.json: the bundle.linux.deb.depends block. The Tauri CLI adds libwebkit2gtk-4.1-0 and the appindicator package itself (with tauri's tray-icon feature on) and does not de-duplicate, so the .deb listed both packages twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- lib.rs tests: spawn_fake_daemon / spawn_fake_daemon_owned were a second fake next to spawn_stoppable_fake_daemon, differing only in canned GetStatus fields no test reads. Their four users never send Shutdown or check the pid, so they now use the one fake. - lifecycle_e2e: attaches_when_daemon_already_running is covered by attach_carries_daemons_self_reported_ownership, which attaches the same way (the locator panics if consulted) and also checks the carried ownership. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 3, 2026
Owner
Author
|
Merged into |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #48; review only the commits after it.
Implements SNB-672. Net −65 lines (7 added, 72 removed).
What was removed and why it was duplicated
lib.rstests:spawn_fake_daemon/spawn_fake_daemon_ownedwere a second fake daemon next tospawn_stoppable_fake_daemon. They differed only in cannedGetStatusfields that no test reads (height, network, version, pid, scan state). Their four users (retry_keeps_child_when_socket_reachable,retry_reattaches_after_child_exited,attach_adopts_daemons_self_reported_ownership,supervisor_records_crash_and_schedules_restart) never sendShutdownand never check the pid. They now usespawn_stoppable_fake_daemonwith the samespawned_by_trayanswer as before.tests/lifecycle_e2e.rs: droppedattaches_when_daemon_already_running.attach_carries_daemons_self_reported_ownershipcovers the same path: it attaches throughattach_or_spawn_withwith a locator that panics if it is consulted, then also checks the ownership carried through.Why behaviour is unchanged
Test-only change. Every remaining test asserts what it did before, and the attach path keeps its e2e coverage.
Verification
cargo check --workspace --all-targets --all-features: 0 warnings.cargo clippy --no-deps -p friglet -p friglet-ipc -p friglet-tray --all-targets -- -D warnings: clean.cargo fmt -p friglet -p friglet-ipc -p friglet-tray -- --check: clean.cargo test --workspace: 251 passed, 1 ignored, 0 failed. That is friglet-tray: remove dead commands, lifecycle API and UI leftovers (SNB-667) #48's 252 minus the removed duplicateattaches_when_daemon_already_running. friglet-tray: lib 65 passed, e2e 8 passed.