From c26299817310ce7d2baa777b37198ff97e86e916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20L=C3=B3pez?= <1953782+julio-lopez@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:18:44 -0700 Subject: [PATCH] chore(general): misc cleanups (#3982) * chore(general): remove unused `Behavior` type * chore(test): leverage `testutil.ServerParameters` in server test --- cli/terminate_signal_test.go | 11 ++++------- internal/feature/feature.go | 3 --- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/cli/terminate_signal_test.go b/cli/terminate_signal_test.go index 4813a0ea2..5669f508b 100644 --- a/cli/terminate_signal_test.go +++ b/cli/terminate_signal_test.go @@ -1,26 +1,23 @@ package cli_test import ( - "strings" "syscall" "testing" "github.com/stretchr/testify/require" + "github.com/kopia/kopia/internal/testutil" "github.com/kopia/kopia/tests/testenv" ) -// Waits until the server advertises its address on the line. -func serverStarted(line string) bool { - return !strings.HasPrefix(line, "SERVER ADDRESS: ") -} - func TestTerminate(t *testing.T) { env := testenv.NewCLITest(t, testenv.RepoFormatNotImportant, testenv.NewExeRunner(t)) env.RunAndExpectSuccess(t, "repo", "create", "filesystem", "--path", env.RepoDir) - wait, interrupt := env.RunAndProcessStderrInt(t, serverStarted, "server", "start", + var sp testutil.ServerParameters + + wait, interrupt := env.RunAndProcessStderrInt(t, sp.ProcessOutput, "server", "start", "--address=localhost:0", "--insecure") diff --git a/internal/feature/feature.go b/internal/feature/feature.go index 10f32763d..e17885205 100644 --- a/internal/feature/feature.go +++ b/internal/feature/feature.go @@ -6,9 +6,6 @@ "fmt" ) -// Behavior specifies how kopia should behave if it encounters a Feature it does not understand. -type Behavior string - // IfNotUnderstood describes the behavior of Kopia when a required feature is not understood. type IfNotUnderstood struct { Warn bool `json:"warn"` // warn instead of failing