Skip to content

Commit

Permalink
enable CNI unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rastislavs committed Oct 6, 2017
1 parent 9bcce78 commit b43fa16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ endef
# run all tests
define test_only
@echo "# running unit tests"
@go test ./cmd/contiv-cni
@go test ./plugins/contiv
@go test ./plugins/kvdbproxy
@echo "# done"
Expand All @@ -37,11 +38,12 @@ endef
# run all tests with coverage
define test_cover_only
@echo "# running unit tests with coverage analysis"
@go test -covermode=count -coverprofile=${COVER_DIR}coverage_unit1.out ./plugins/contiv
@go test -covermode=count -coverprofile=${COVER_DIR}coverage_unit2.out ./plugins/kvdbproxy
@go test -covermode=count -coverprofile=${COVER_DIR}cov_u1.out ./cmd/contiv-cni
@go test -covermode=count -coverprofile=${COVER_DIR}cov_u2.out ./plugins/contiv
@go test -covermode=count -coverprofile=${COVER_DIR}cov_u3.out ./plugins/kvdbproxy
@echo "# merging coverage results"
@cd vendor/github.com/wadey/gocovmerge && go install -v
@gocovmerge ${COVER_DIR}coverage_unit1.out ${COVER_DIR}coverage_unit2.out > ${COVER_DIR}coverage.out
@gocovmerge ${COVER_DIR}cov_u1.out ${COVER_DIR}cov_u2.out ${COVER_DIR}cov_u3.out > ${COVER_DIR}coverage.out
@echo "# coverage data generated into ${COVER_DIR}coverage.out"
@echo "# done"
endef
Expand Down
3 changes: 1 addition & 2 deletions cmd/contiv-cni/contiv_cni_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ func TestCNIAddDelete(t *testing.T) {
RegisterTestingT(t)

// start testing gRPC server
grpcServer := runTestGrpcServer()
defer grpcServer.Stop()
runTestGrpcServer()

// prepare CNI config
conf := `{
Expand Down

0 comments on commit b43fa16

Please sign in to comment.