diff --git a/pkg/cli/server_test.go b/pkg/cli/server_test.go index f3494b2..e5c5ddb 100644 --- a/pkg/cli/server_test.go +++ b/pkg/cli/server_test.go @@ -37,7 +37,7 @@ func TestServerCommand(t *testing.T) { testRSAPrivateKeyString, _ := keyutil.TestGenerateRSAPrivateKey(t) - ctx := logging.WithLogger(context.Background(), logging.TestLogger(t)) + ctx := logging.WithLogger(t.Context(), logging.TestLogger(t)) fakeGitHub := func() *httptest.Server { mux := http.NewServeMux() diff --git a/pkg/plugin/plugin_test.go b/pkg/plugin/plugin_test.go index 12085a4..d72edfa 100644 --- a/pkg/plugin/plugin_test.go +++ b/pkg/plugin/plugin_test.go @@ -127,7 +127,7 @@ func TestValidate(t *testing.T) { } for _, tc := range cases { - ctx := context.Background() + ctx := t.Context() t.Run(tc.name, func(t *testing.T) { t.Parallel() @@ -148,7 +148,7 @@ func TestValidate(t *testing.T) { func TestGetUIData(t *testing.T) { t.Parallel() - ctx := context.Background() + ctx := t.Context() uiData := &jvspb.UIData{ DisplayName: testGitHubPluginDisplayName, diff --git a/pkg/plugin/validator_test.go b/pkg/plugin/validator_test.go index 8be8e4c..364837f 100644 --- a/pkg/plugin/validator_test.go +++ b/pkg/plugin/validator_test.go @@ -15,7 +15,6 @@ package plugin import ( - "context" "crypto/tls" "errors" "fmt" @@ -121,7 +120,7 @@ func TestMatchIssue(t *testing.T) { t.Run(tc.name, func(t *testing.T) { t.Parallel() - ctx := context.Background() + ctx := t.Context() fakeGitHub := func() *httptest.Server { mux := http.NewServeMux()