Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update project tooling #52

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.57
version: v1.59
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ GOIMPORTS ?= $(LOCALBIN)/goimports-$(GOIMPORTS_VERSION)

## Tool Versions
KUSTOMIZE_VERSION ?= v5.3.0
CONTROLLER_TOOLS_VERSION ?= v0.14.0
CONTROLLER_TOOLS_VERSION ?= v0.15.0
ENVTEST_VERSION ?= latest
GOLANGCI_LINT_VERSION ?= v1.57.2
GOIMPORTS_VERSION ?= v0.20.0
GOLANGCI_LINT_VERSION ?= v1.59.1
GOIMPORTS_VERSION ?= v0.22.0

.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ import (
// Run e2e tests using the Ginkgo runner.
func TestE2E(t *testing.T) {
RegisterFailHandler(Fail)
fmt.Fprintf(GinkgoWriter, "Starting metal-operator suite\n")
_, _ = fmt.Fprintf(GinkgoWriter, "Starting metal-operator suite\n")
RunSpecs(t, "e2e suite")
}
10 changes: 7 additions & 3 deletions test/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
)

func warnError(err error) {
fmt.Fprintf(GinkgoWriter, "warning: %v\n", err)
_, _ = fmt.Fprintf(GinkgoWriter, "warning: %v\n", err)
}

// InstallPrometheusOperator installs the prometheus Operator to be used to export the enabled metrics.
Expand All @@ -52,12 +52,16 @@ func Run(cmd *exec.Cmd) ([]byte, error) {
cmd.Dir = dir

if err := os.Chdir(cmd.Dir); err != nil {
fmt.Fprintf(GinkgoWriter, "chdir dir: %s\n", err)
if _, err := fmt.Fprintf(GinkgoWriter, "chdir dir: %s\n", err); err != nil {
return nil, fmt.Errorf("%w", err)
}
}

cmd.Env = append(os.Environ(), "GO111MODULE=on")
command := strings.Join(cmd.Args, " ")
fmt.Fprintf(GinkgoWriter, "running: %s\n", command)
if _, err := fmt.Fprintf(GinkgoWriter, "running: %s\n", command); err != nil {
return nil, fmt.Errorf("%w", err)
}
output, err := cmd.CombinedOutput()
if err != nil {
return output, fmt.Errorf("%s failed with error: (%v) %s", command, err, string(output))
Expand Down