From 6010a6ca675f5f06c0cb97f4175cc633d255a507 Mon Sep 17 00:00:00 2001 From: Alan Clucas Date: Thu, 15 Aug 2024 11:19:06 +0100 Subject: [PATCH] chore(deps): bump golangci-lint from 1.55.1 to 1.59.1 golangci-lint 1.60.1 was released yesterday, but that bumps govet causing some hard to resolve errors. I'll wait for the dust to settle on that before attempting the update. gosimple: fixes to `server/auth/sso/sso.go` `S1009: should omit nil check; len() for []string is defined as zero (gosimple)` testifylint: undo assert->require changes in functions where they won't work correctly `go-require: do not use require in http handlers (testifylint)` `go-require: require must only be used in the goroutine running the test function (testifylint)` Signed-off-by: Alan Clucas --- Makefile | 2 +- cmd/argoexec/commands/emissary_test.go | 2 +- server/workflow/workflow_server_test.go | 6 +++--- workflow/artifacts/http/http_test.go | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index ae2f2a4fa083d..db7732f1e6666 100644 --- a/Makefile +++ b/Makefile @@ -434,7 +434,7 @@ dist/manifests/%: manifests/% # lint/test/etc $(GOPATH)/bin/golangci-lint: - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b `go env GOPATH`/bin v1.60.1 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b `go env GOPATH`/bin v1.59.1 .PHONY: lint lint: server/static/files.go $(GOPATH)/bin/golangci-lint diff --git a/cmd/argoexec/commands/emissary_test.go b/cmd/argoexec/commands/emissary_test.go index 946d728a529e0..3313e0e789f42 100644 --- a/cmd/argoexec/commands/emissary_test.go +++ b/cmd/argoexec/commands/emissary_test.go @@ -75,7 +75,7 @@ func TestEmissary(t *testing.T) { go func() { defer wg.Done() err := run("sleep 3") - require.EqualError(t, err, fmt.Sprintf("exit status %d", 128+signal)) + assert.EqualError(t, err, fmt.Sprintf("exit status %d", 128+signal)) }() wg.Wait() } diff --git a/server/workflow/workflow_server_test.go b/server/workflow/workflow_server_test.go index a6a6d110a315b..366ed020b5d1d 100644 --- a/server/workflow/workflow_server_test.go +++ b/server/workflow/workflow_server_test.go @@ -690,7 +690,7 @@ func TestWatchWorkflows(t *testing.T) { ctx, cancel := context.WithCancel(ctx) go func() { err := server.WatchWorkflows(&workflowpkg.WatchWorkflowsRequest{}, &testWatchWorkflowServer{testServerStream{ctx}}) - require.NoError(t, err) + assert.NoError(t, err) }() cancel() } @@ -708,7 +708,7 @@ func TestWatchLatestWorkflow(t *testing.T) { FieldSelector: util.GenerateFieldSelectorFromWorkflowName("@latest"), }, }, &testWatchWorkflowServer{testServerStream{ctx}}) - require.NoError(t, err) + assert.NoError(t, err) }() cancel() } @@ -912,7 +912,7 @@ func TestPodLogs(t *testing.T) { Namespace: "workflows", LogOptions: &corev1.PodLogOptions{}, }, &testPodLogsServer{testServerStream{ctx}}) - require.NoError(t, err) + assert.NoError(t, err) }() cancel() } diff --git a/workflow/artifacts/http/http_test.go b/workflow/artifacts/http/http_test.go index 52e3502e715f2..2bf1ebd2bc37d 100644 --- a/workflow/artifacts/http/http_test.go +++ b/workflow/artifacts/http/http_test.go @@ -104,8 +104,9 @@ func TestSaveHTTPArtifactRedirect(t *testing.T) { // check that content is really there buf := new(bytes.Buffer) _, err = buf.ReadFrom(r.Body) - require.NoError(t, err) - assert.Equal(t, content, buf.String()) + if assert.NoError(t, err) { + assert.Equal(t, content, buf.String()) + } w.WriteHeader(http.StatusCreated) }