Skip to content

Commit cda77f5

Browse files
author
Dmitry Rozhkov
committed
use BUILDTAGS=kerneldrv in CI
1 parent 8390388 commit cda77f5

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ before_install:
4343
script:
4444
- make format
4545
- make lint
46-
- make
46+
- make BUILDTAGS=kerneldrv
4747
- make vet
4848
- make cyclomatic-check
49-
- make test
49+
- make test BUILDTAGS=kerneldrv
5050
- make images
5151
- make images BUILDER=buildah
5252
- make demos

Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ pipeline {
8686
}
8787
}
8888
}
89-
stage("make test") {
89+
stage("make test BUILDTAGS=kerneldrv") {
9090
steps {
9191
dir(path: "$REPO_DIR") {
92-
sh "make test"
92+
sh "make test BUILDTAGS=kerneldrv"
9393
}
9494
}
9595
}

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ GO := go
22
GOFMT := gofmt
33
GOCYCLO := gocyclo
44

5+
BUILDTAGS ?= ""
6+
57
pkgs = $(shell $(GO) list ./... | grep -v vendor)
68
cmds = $(shell ls cmd)
79

@@ -18,10 +20,10 @@ cyclomatic-check:
1820

1921
test:
2022
ifndef WHAT
21-
@$(GO) test -race -coverprofile=coverage.txt -covermode=atomic $(pkgs)
23+
@$(GO) test -tags $(BUILDTAGS) -race -coverprofile=coverage.txt -covermode=atomic $(pkgs)
2224
else
2325
@cd $(WHAT) && \
24-
$(GO) test -v -cover -coverprofile cover.out || rc=1; \
26+
$(GO) test -tags $(BUILDTAGS) -v -cover -coverprofile cover.out || rc=1; \
2527
$(GO) tool cover -html=cover.out -o coverage.html; \
2628
rm cover.out; \
2729
echo "Coverage report: file://$$(realpath coverage.html)"; \
@@ -32,7 +34,7 @@ lint:
3234
@rc=0 ; for f in $$(find -name \*.go | grep -v \.\/vendor) ; do golint -set_exit_status $$f || rc=1 ; done ; exit $$rc
3335

3436
$(cmds):
35-
cd cmd/$@; $(GO) build
37+
cd cmd/$@; $(GO) build -tags $(BUILDTAGS)
3638

3739
build: $(cmds)
3840

0 commit comments

Comments
 (0)