Skip to content

Commit

Permalink
fix code coverage report issue
Browse files Browse the repository at this point in the history
Added checks target in makefile to perform all checks in go
and updated unit-tests target now verifying checks first then
executing unit-tests

Change-Id: I3ab379e2de4dd38df814c7e8bfce42781c5649aa
Signed-off-by: rameshbabu <rameshbabu.thoomu@gmail.com>
  • Loading branch information
rameshthoomu committed Nov 23, 2016
1 parent 109b30c commit 66cd46d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
# - all (default) - builds all targets and runs all tests
# - license - check all go files for license headers
# - cop - builds the cop executable
# - tests - runs all the cop tests
# - unit-tests - runs the go-test based unit tests
# - unit-tests - Performs checks first and runs the go-test based unit tests
# - checks - runs all check conditions (license, format, imports, lint and vet)

all: license vet lint format imports cop tests unit-tests
all: checks cop unit-tests

checks: license vet lint format imports

license: .FORCE
@scripts/check_license
Expand All @@ -46,9 +48,7 @@ cop:
@mkdir -p bin && cd cli && go build -o ../bin/cop
@echo "Built bin/cop"

tests: cop unit-tests

unit-tests: cop
unit-tests: checks cop
@scripts/run_tests

.FORCE:
9 changes: 3 additions & 6 deletions scripts/run_tests
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ echo "Running all tests ..."
go get github.com/axw/gocov/...
go get github.com/AlekSi/gocov-xml

for file in `find . | egrep -v "vendor|.git|bin|scripts|testdata|idp"`
do
if [ -d $file ]; then
gocov test $file | gocov-xml > coverage.xml
fi
done
PKGS=`go list github.com/hyperledger/fabric-cop/... | grep -v /vendor/`

gocov test $PKGS | gocov-xml > coverage.xml
} | tee /tmp/test.results
echo "Finished running all tests"
SC=0
Expand Down

0 comments on commit 66cd46d

Please sign in to comment.