Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ has a matching GitHub release whose body comes from its section below.

### Fixed

- `go test ./internal/cli` on a Windows machine with Berth installed no longer deletes the installed services'
launchers (`units\*.vbs` in the state directory). Three service tests ran a real uninstall or install against
the user's own state directory instead of a temporary one. (#351)
- On Windows, `berth service install --notify` no longer opens a console window at logon. The Run key started
`berth.exe notify` itself, a console program, and closing that window ended the tray. It now starts the tray
through the hidden launcher the other services use, and its output goes to `logs\berth-notify.log`. Run the
Expand Down
5 changes: 5 additions & 0 deletions internal/cli/service_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ func TestServiceInstallWindows(t *testing.T) {
}

func TestServiceInstallWindowsCommandFails(t *testing.T) {
t.Setenv("XDG_STATE_HOME", t.TempDir())
dir := t.TempDir()
ops, _ := fakeOps(t, dir, func(a argv) (string, error) {
return "ERROR: Access is denied.", errors.New("exit status 1")
Expand Down Expand Up @@ -403,6 +404,9 @@ func TestServiceStatusWindows(t *testing.T) {
}

func TestServiceUninstallWindows(t *testing.T) {
// The uninstall removes each unit's stub for real: without its own
// state directory it deletes a live install's launchers (issue 351).
t.Setenv("XDG_STATE_HOME", t.TempDir())
ops, calls := fakeOps(t, t.TempDir(), func(a argv) (string, error) {
if a.args[0] == "/Delete" {
if a.args[2] == `\Berth\berth-gateway` {
Expand Down Expand Up @@ -442,6 +446,7 @@ func TestServiceUninstallWindows(t *testing.T) {

// A task that is not running makes /End fail; the uninstall still deletes it.
func TestServiceUninstallWindowsIgnoresEndFailure(t *testing.T) {
t.Setenv("XDG_STATE_HOME", t.TempDir())
ops, _ := fakeOps(t, t.TempDir(), func(a argv) (string, error) {
if a.args[0] == "/End" {
return "ERROR: There is no running instance of the task.", errors.New("exit status 1")
Expand Down
Loading