From abe332832ef16c5c53941d8be6412be1ec65e9ff Mon Sep 17 00:00:00 2001 From: Kate Osborn Date: Fri, 16 Sep 2022 15:47:13 -0600 Subject: [PATCH 1/2] Increase lint timeout to 3m The lint make command consistently times out. This commit increases the timeout from default of 1 minute to 3 minutes. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8c262cb0ac..50ea72960a 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,7 @@ vet: ## Run go vet against code .PHONY: lint lint: ## Run golangci-lint against code - docker run --pull always --rm -v $(shell pwd):/nginx-kubernetes-gateway -w /nginx-kubernetes-gateway -v $(shell go env GOCACHE):/cache/go -e GOCACHE=/cache/go -e GOLANGCI_LINT_CACHE=/cache/go -v $(shell go env GOPATH)/pkg:/go/pkg golangci/golangci-lint:latest golangci-lint --color always run + docker run --pull always --rm -v $(shell pwd):/nginx-kubernetes-gateway -w /nginx-kubernetes-gateway -v $(shell go env GOCACHE):/cache/go -e GOCACHE=/cache/go -e GOLANGCI_LINT_CACHE=/cache/go -v $(shell go env GOPATH)/pkg:/go/pkg golangci/golangci-lint:latest golangci-lint --color always run --timeout 3m .PHONY: unit-test unit-test: ## Run unit tests for the go code From 6687cf9a9fa67d3360a15fb5d6948347cf1148ae Mon Sep 17 00:00:00 2001 From: Kate Osborn Date: Mon, 19 Sep 2022 10:52:59 -0600 Subject: [PATCH 2/2] Move timeout to golangci-lint config --- .golangci.yml | 2 ++ Makefile | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 5c75873eda..19c2d3eece 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -62,3 +62,5 @@ linters: issues: max-issues-per-linter: 0 max-same-issues: 0 +run: + timeout: 3m diff --git a/Makefile b/Makefile index 50ea72960a..8c262cb0ac 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,7 @@ vet: ## Run go vet against code .PHONY: lint lint: ## Run golangci-lint against code - docker run --pull always --rm -v $(shell pwd):/nginx-kubernetes-gateway -w /nginx-kubernetes-gateway -v $(shell go env GOCACHE):/cache/go -e GOCACHE=/cache/go -e GOLANGCI_LINT_CACHE=/cache/go -v $(shell go env GOPATH)/pkg:/go/pkg golangci/golangci-lint:latest golangci-lint --color always run --timeout 3m + docker run --pull always --rm -v $(shell pwd):/nginx-kubernetes-gateway -w /nginx-kubernetes-gateway -v $(shell go env GOCACHE):/cache/go -e GOCACHE=/cache/go -e GOLANGCI_LINT_CACHE=/cache/go -v $(shell go env GOPATH)/pkg:/go/pkg golangci/golangci-lint:latest golangci-lint --color always run .PHONY: unit-test unit-test: ## Run unit tests for the go code