Skip to content

Follow-up: finish the goos refactor and harden callLog's zero-arg case #1106

Closed

Description

@Alan-Cha

Context

Two follow-up items surfaced during review of #1080 (the fakeSystemctl/fakeLoginctl test harness), both explicitly noted by the reviewer as out of scope for that PR:

Items

  • serviceIsCurrent (cmd_service.go) and reportInstallSuccess (cmd_service.go:498) already receive goos/runtime.GOOS as a parameter but still branch on it internally in places, the same pattern loadService/controlService/supervisorRunning/unloadService had before Test: Add a fakeSystemctl/fakeLoginctl harness for the Linux service path #1080's refactor. Their darwin-only and linux-only logic still can't be exercised from the other host. Second half of the same refactor Test: Add a fakeSystemctl/fakeLoginctl harness for the Linux service path #1080 did for the other four functions.
  • cmd_service_systemd_test.go's callLog helper writes echo "$@" to the log file; a zero-argument invocation would append a blank line, which readCallLog filters out as empty — making a real (bugged) zero-argument call indistinguishable from a genuine "never called" outcome. Latent only: no real call site in the current code passes zero arguments, so nothing exercises this today. Worth hardening (e.g. echo "argv: $@") before it silently matters.

Additional Context

Both found during the #1076/#1080 review cycle for #945 (Linux install and systemd service lifecycle verification). Neither blocks anything currently shipped; low priority.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions