Skip to content

Commit

Permalink
Fix windows unit testing of logger set cli command.
Browse files Browse the repository at this point in the history
Signed-off-by: Edwin Buck <edwbuck@gmail.com>
  • Loading branch information
edwbuck committed Mar 6, 2024
1 parent 4214efd commit f83da8d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
14 changes: 14 additions & 0 deletions cmd/spire-server/cli/logger/set_posix_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//go:build !windows

package logger_test

var (
setUsage = `Usage of logger set:
-level string
The new log level, one of (panic, fatal, error, warn, info, debug, trace, launch)
-output value
Desired output format (pretty, json); default: pretty.
-socketPath string
Path to the SPIRE Server API socket (default "/tmp/spire-server/private/api.sock")
`
)
11 changes: 0 additions & 11 deletions cmd/spire-server/cli/logger/set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@ import (
"github.com/spiffe/spire/cmd/spire-server/cli/logger"
)

var (
setUsage = `Usage of logger set:
-level string
The new log level, one of (panic, fatal, error, warn, info, debug, trace, launch)
-output value
Desired output format (pretty, json); default: pretty.
-socketPath string
Path to the SPIRE Server API socket (default "/tmp/spire-server/private/api.sock")
`
)

func TestSetHelp(t *testing.T) {
test := setupCliTest(t, nil, logger.NewSetCommandWithEnv)
test.client.Help()
Expand Down
14 changes: 14 additions & 0 deletions cmd/spire-server/cli/logger/set_windows_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//go:build windows

package logger_test

var (
setUsage = `Usage of logger set:
-level string
The new log level, one of (panic, fatal, error, warn, info, debug, trace, launch)
-namedPipeName string
Pipe name of the SPIRE Server API named pipe (default "\\spire-server\\private\\api")
-output value
Desired output format (pretty, json); default: pretty.
`
)

0 comments on commit f83da8d

Please sign in to comment.