From dfa432eb06e88b4838688f037ee042798de0965f Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Tue, 3 Sep 2019 10:59:11 -0400 Subject: [PATCH 1/3] lint: ignore protobuf generated code --- GNUmakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/GNUmakefile b/GNUmakefile index 325e5d197..5c7e6cb59 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -170,6 +170,7 @@ check: ## Lint the source code --deadline 10m \ --vendor \ --exclude='.*\.generated\.go' \ + --exclude='.*\.pb\.go' \ --exclude='.*bindata_assetfs\.go' \ --skip="ui/" \ --sort="path" \ From 0f401e6b8b6ea47ced5c650ddb8b1c118edc660b Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Tue, 3 Sep 2019 10:59:58 -0400 Subject: [PATCH 2/3] lint: ignore generated windows syscall wrappers --- client/fingerprint/storage_windows.go | 2 +- .../{zstorage_windows.go => zstorage_windows.generated.go} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename client/fingerprint/{zstorage_windows.go => zstorage_windows.generated.go} (100%) diff --git a/client/fingerprint/storage_windows.go b/client/fingerprint/storage_windows.go index 716f1baf0..457b09b58 100644 --- a/client/fingerprint/storage_windows.go +++ b/client/fingerprint/storage_windows.go @@ -6,7 +6,7 @@ import ( "syscall" ) -//go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zstorage_windows.go storage_windows.go +//go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zstorage_windows.generated.go storage_windows.go //sys getDiskFreeSpaceEx(dirName *uint16, availableFreeBytes *uint64, totalBytes *uint64, totalFreeBytes *uint64) (err error) = kernel32.GetDiskFreeSpaceExW diff --git a/client/fingerprint/zstorage_windows.go b/client/fingerprint/zstorage_windows.generated.go similarity index 100% rename from client/fingerprint/zstorage_windows.go rename to client/fingerprint/zstorage_windows.generated.go From 41102260edc1235eabe396dea53a4d57717911c0 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Tue, 3 Sep 2019 11:04:27 -0400 Subject: [PATCH 3/3] ignore nested pkgs in GOTEST_PKGS_EXCLUDE This fixes a bug where some packages tests run twice in CI, because they are subpackages of ones with dedicated jobs. For example, notice `client/allocrunner` tests ran in `test-client`[1] and `test-other`[2] despite them being in the same workflow[3]. [1] https://circleci.com/gh/hashicorp/nomad/5262 [2] https://circleci.com/gh/hashicorp/nomad/5261 [3] https://circleci.com/workflow-run/ee7a9167-8fc7-49a5-897c-6c967e966014 --- GNUmakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 5c7e6cb59..84e7cff97 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -13,7 +13,7 @@ GO_TEST_CMD = $(if $(shell which gotestsum),gotestsum --,go test) ifeq ($(origin GOTEST_PKGS_EXCLUDE), undefined) GOTEST_PKGS ?= "./..." else -GOTEST_PKGS=$(shell go list ./... | sed 's/github.com\/hashicorp\/nomad/./' | egrep -v "^($(GOTEST_PKGS_EXCLUDE))$$") +GOTEST_PKGS=$(shell go list ./... | sed 's/github.com\/hashicorp\/nomad/./' | egrep -v "^($(GOTEST_PKGS_EXCLUDE))(/.*)?$$") endif default: help