Skip to content

Commit 76dcdef

Browse files
authored
Merge pull request #52 from BlaineEXE/prow-scripts-for-unit-lint
ci: add prow lint/test scripts w/ CPU limits
2 parents ccd92dd + 077f158 commit 76dcdef

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ test-e2e: chainsaw # Run e2e tests against the K8s cluster specified in ~/.kube/
8989
.PHONY: lint
9090
lint: golangci-lint.client golangci-lint.controller golangci-lint.sidecar ## Run all linters (suggest `make -k`)
9191
golangci-lint.%: golangci-lint
92-
cd $* && $(GOLANGCI_LINT) run --config $(CURDIR)/.golangci.yaml --new
92+
cd $* && $(GOLANGCI_LINT) run $(GOLANGCI_LINT_RUN_OPTS) --config $(CURDIR)/.golangci.yaml --new
9393

9494
.PHONY: lint-fix
9595
lint-fix: golangci-lint-fix.client golangci-lint-fix.controller golangci-lint-fix.sidecar ## Run all linters and perform fixes where possible (suggest `make -k`)
9696
golangci-lint-fix.%: golangci-lint
97-
cd $* && $(GOLANGCI_LINT) run --config $(CURDIR)/.golangci.yaml --new --fix
97+
cd $* && $(GOLANGCI_LINT) run $(GOLANGCI_LINT_RUN_OPTS) --config $(CURDIR)/.golangci.yaml --new --fix
9898

9999
##@ Build
100100

hack/prow-lint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
set -o errexit
3+
set -o nounset
4+
set -o xtrace
5+
6+
GOLANGCI_LINT_RUN_OPTS=""
7+
GOLANGCI_LINT_RUN_OPTS="$GOLANGCI_LINT_RUN_OPTS --verbose" # debug linter timing and mem usage
8+
GOLANGCI_LINT_RUN_OPTS="$GOLANGCI_LINT_RUN_OPTS --concurrency=2" # prow job lags if too many threads
9+
export GOLANGCI_LINT_RUN_OPTS
10+
11+
make lint

hack/prow-test.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
set -o errexit
3+
set -o nounset
4+
set -o xtrace
5+
6+
export GOMAXPROCS=2 # prow job lags if too many threads
7+
8+
make test

0 commit comments

Comments
 (0)