From 32732b3038917f7f7c93dd08219b8f0778e90468 Mon Sep 17 00:00:00 2001 From: Silvin Lubecki Date: Tue, 21 Apr 2020 14:31:13 +0200 Subject: [PATCH] Fix linter timeout: add some concurrency Fix linter errors due to linter bump Signed-off-by: Silvin Lubecki --- .golangci.yml | 5 +++++ Makefile | 2 +- e2e/helper_test.go | 5 ++--- internal/commands/image/tag_test.go | 2 +- loader/loader_test.go | 4 ++-- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 2c6f43826..ad6665dcd 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,9 @@ linters: + run: + concurrency: 2 + modules-download-mode: vendor + skip-dirs: + - vendor enable-all: false disable-all: true enable: diff --git a/Makefile b/Makefile index 4620d886c..7db67c0b8 100644 --- a/Makefile +++ b/Makefile @@ -67,7 +67,7 @@ test: test-unit test-e2e ## run all tests lint: ## run linter(s) @echo "Linting..." - @golangci-lint run ./... + golangci-lint run --verbose --print-resources-usage --timeout 10m0s ./... test-e2e: bin/$(BIN_NAME) ## run end-to-end tests @echo "Running e2e tests..." diff --git a/e2e/helper_test.go b/e2e/helper_test.go index d489086a9..cdc591a44 100644 --- a/e2e/helper_test.go +++ b/e2e/helper_test.go @@ -122,14 +122,13 @@ func runWithDindSwarmAndRegistry(t *testing.T, todo func(dindSwarmAndRegistryInf todo(runner) } -func build(t *testing.T, cmd icmd.Cmd, dockerCli dockerCliCommand, ref, path string) string { +func build(t *testing.T, cmd icmd.Cmd, dockerCli dockerCliCommand, ref, path string) { iidfile := fs.NewFile(t, "iid") defer iidfile.Remove() cmd.Command = dockerCli.Command("app", "build", "--iidfile", iidfile.Path(), "-t", ref, path) icmd.RunCmd(cmd).Assert(t, icmd.Success) - bytes, err := ioutil.ReadFile(iidfile.Path()) + _, err := ioutil.ReadFile(iidfile.Path()) assert.NilError(t, err) - return string(bytes) } // Container represents a docker container diff --git a/internal/commands/image/tag_test.go b/internal/commands/image/tag_test.go index acc95c794..8639f764d 100644 --- a/internal/commands/image/tag_test.go +++ b/internal/commands/image/tag_test.go @@ -95,7 +95,7 @@ func TestInvalidDestinationReference(t *testing.T) { err := runTag(mockedImageStore, "ref", badRef) - assert.ErrorContains(t, err, fmt.Sprintf("invalid reference format")) + assert.ErrorContains(t, err, "invalid reference format") } func TestBundleNotStored(t *testing.T) { diff --git a/loader/loader_test.go b/loader/loader_test.go index 8009e8b8c..e035ea1eb 100644 --- a/loader/loader_test.go +++ b/loader/loader_test.go @@ -35,7 +35,7 @@ func TestLoadFromDirectory(t *testing.T) { app, err := LoadFromDirectory(dir.Path()) assert.NilError(t, err) assert.Assert(t, app != nil) - assert.Assert(t, is.Equal(app.Path, dir.Path())) + assert.Assert(t, is.Equal(app.Path, dir.Path())) //nolint:staticcheck assertAppContent(t, app) } @@ -62,7 +62,7 @@ func TestLoadFromTar(t *testing.T) { app, err := LoadFromTar(myapp.Path()) assert.NilError(t, err) assert.Assert(t, app != nil) - assert.Assert(t, is.Equal(app.Path, myapp.Path())) + assert.Assert(t, is.Equal(app.Path, myapp.Path())) //nolint:staticcheck assertAppContent(t, app) }