Skip to content

Commit 466310f

Browse files
authored
Enable unit test run in CI (#14)
1 parent 2d9eab1 commit 466310f

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
default: test
2+
3+
.PHONY: test
4+
test:
5+
go test `go list ./... | grep -v test`
6+
7+
.PHONY: gomod_tidy
8+
gomod_tidy:
9+
go mod tidy
10+
11+
.PHONY: gofmt
12+
gofmt:
13+
go fmt -x ./...

scripts/openshiftci-presubmit-unittests.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export CUSTOM_HOMEDIR=$ARTIFACTS_DIR
1010
export PATH=$PATH:$GOPATH/bin
1111

1212
go env
13-
if [[ $(go fmt `go list ./...`) ]]; then
13+
go mod vendor
14+
if [[ $(go fmt `go list ./... | grep -v vendor`) ]]; then
1415
echo "not well formatted sources are found"
1516
exit 1
1617
fi
@@ -22,4 +23,4 @@ then
2223
fi
2324

2425
# Unit tests to be referenced here
25-
echo "Please reference the unit test script(s) here"
26+
make test

0 commit comments

Comments
 (0)