Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Code

527 commit(s) on main

Put job execution behind an interface Keenan Nemetz · 2h ago de3eec16
history blame raw 998 B
1//go:build !windows
2
3package main
4
5import (
6 "strings"
7 "testing"
8)
9
10// TestServiceIsWindowsOnly pins the answer a unix user gets. The verbs are in the
11// command table everywhere so the generated reference does not depend on the
12// platform that built the binary, but the service manager is Windows's business.
13func TestServiceIsWindowsOnly(t *testing.T) {
14 err := cmdService([]string{"status"})
15 if err == nil {
16 t.Fatal("vole service status succeeded outside Windows")
17 }
18 if !strings.Contains(err.Error(), "Windows") {
19 t.Fatalf("the error does not say the command is Windows-only: %v", err)
20 }
21}
22
23// TestServiceRejectsFlagsTheSubcommandDoesNotTake keeps the shared decode table
24// honest: `service status` reads no options, so a config path is a mistake
25// rather than something to ignore.
26func TestServiceRejectsFlagsTheSubcommandDoesNotTake(t *testing.T) {
27 if err := cmdService([]string{"status", "--config", "vole.toml"}); err == nil {
28 t.Fatal("service status accepted --config")
29 }
30}
31