Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Commit

Permalink
Fix linter timeout: add some concurrency
Browse files Browse the repository at this point in the history
Fix linter errors due to linter bump

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
  • Loading branch information
silvin-lubecki committed Apr 21, 2020
1 parent d484da2 commit 32732b3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
linters:
run:
concurrency: 2
modules-download-mode: vendor
skip-dirs:
- vendor
enable-all: false
disable-all: true
enable:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down
5 changes: 2 additions & 3 deletions e2e/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/image/tag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions loader/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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)
}

Expand Down

0 comments on commit 32732b3

Please sign in to comment.