diff --git a/Makefile b/Makefile index 607dd04f8..daa0eb345 100644 --- a/Makefile +++ b/Makefile @@ -15,12 +15,6 @@ ADDTL_LINTERS := goconst,gofmt,unparam PKG := ./... TESTS := . -# coverage -COVER := $(SCRIPTS_DIR)/coverage_test.sh -COVER_FILE := cover.out -MIN_COVERAGE := 70 - - .PHONY: build build: @CGO_ENABLED=0 go build -o $(BINDIR)/$(EXECUTABLE_CLI) $(GO_FLAGS) @@ -30,19 +24,13 @@ test: build test: lint test: TESTFLAGS += -race -v test: unit-tests -test: cover .PHONY: unit-tests unit-tests: build @echo "Performing unit test step..." - @go test -run $(TESTS) $(PKG) $(TESTFLAGS) -coverprofile=$(COVER_FILE) -coverpkg=$(PKG) + @go test -run $(TESTS) $(PKG) $(TESTFLAGS) @echo "All unit tests passed" -.PHONY: cover -cover: unit-tests - @./$(COVER) $(COVER_FILE) $(MIN_COVERAGE) - - .PHONY: lint lint: @echo "Performing linting step..." @@ -52,7 +40,6 @@ lint: .PHONY: clean clean: @rm -fr $(BINDIR) - @rm -fr $(COVER_FILE) .PHONY: docs docs: diff --git a/scripts/coverage_test.sh b/scripts/coverage_test.sh deleted file mode 100755 index 3ef6982e0..000000000 --- a/scripts/coverage_test.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -check_coverage() { - cover_file=$1 - min_coverage=$2 - sed -i -e "\,airshipctl/pkg/apis\|airshipctl/pkg/client,d" "${cover_file}" - coverage_float=$(go tool cover -func="${cover_file}" | awk "/^total:/ { print \$3 }") - coverage_int=${coverage_float%.*} - if (( "${coverage_int}" < "${min_coverage}" )) ; then - echo "Coverage is at ${coverage_float}, but the required coverage is ${min_coverage}" - exit 1 - else - echo "Overall coverage: ${coverage_float} of statements" - fi -} - -if [ "$#" -ne 2 ]; then - echo "Usage: $0 " - exit 1 -fi - -check_coverage "$1" "$2"