Repository: kopia/kopia
Pull request #3982 (2024-07-11 23:26:49)

chore(general): misc cleanups
chore(test): leverage `testutil.ServerParameters` in server test
chore(general): remove unused `Behavior` type

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/kopia/kopia/pull/3982?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 77.21%. Comparing base [(`cb455c6`)](https://app.codecov.io/gh/kopia/kopia/commit/cb455c699a04e54cb47e25a676d7d65063ce883e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia) to head [(`066d028`)](https://app.codecov.io/gh/kopia/kopia/commit/066d028101f6e5b888de1085e0b1f9eec1b90d65?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia).
> Report is 188 commits behind head on master.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##           master    #3982      +/-   ##
==========================================
+ Coverage   75.86%   77.21%   +1.35%     
==========================================
  Files         470      481      +11     
  Lines       37301    28803    -8498     
==========================================
- Hits        28299    22241    -6058     
+ Misses       7071     4665    -2406     
+ Partials     1931     1897      -34     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/kopia/kopia/pull/3982?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia).


Patch:
diff --git a/internal/feature/feature.go b/internal/feature/feature.go
index 10f32763..e1788520 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


Test patch:
diff --git a/cli/terminate_signal_test.go b/cli/terminate_signal_test.go
index 4813a0ea..5669f508 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")