Skip to content

Commit

Permalink
chore(deps): bump golangci-lint from 1.55.1 to 1.59.1
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Joibel committed Aug 15, 2024
1 parent ec45482 commit 6010a6c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/argoexec/commands/emissary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
6 changes: 3 additions & 3 deletions server/workflow/workflow_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand All @@ -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()
}
Expand Down Expand Up @@ -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()
}
Expand Down
5 changes: 3 additions & 2 deletions workflow/artifacts/http/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 6010a6c

Please sign in to comment.