From bcbab79dd0571ede08230e1775824049cec5a12d Mon Sep 17 00:00:00 2001 From: Jarek Kowalski Date: Sat, 20 Oct 2018 09:20:08 -0700 Subject: [PATCH] coverage: updated 'go test' command to include all packages previously the coverage for each package only included lines covered by tests in the same package, excluding end-to-end tests now, we get very different coverage numbers... --- Makefile | 4 ++-- repo/tests/repository_stress_test/repository_stress.go | 3 +++ repo/tests/repository_stress_test/repository_stress_test.go | 2 +- repo/tests/stress_test/stress.go | 3 +++ tests/end_to_end_test/end_to_end.go | 1 + tests/end_to_end_test/end_to_end_test.go | 2 +- 6 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 repo/tests/repository_stress_test/repository_stress.go create mode 100644 repo/tests/stress_test/stress.go create mode 100644 tests/end_to_end_test/end_to_end.go diff --git a/Makefile b/Makefile index 5b39fd962..5a7d202bd 100644 --- a/Makefile +++ b/Makefile @@ -72,9 +72,9 @@ godoc: godoc -http=:33333 coverage: - go test --coverprofile tmp.cov github.com/kopia/kopia/... + go test --coverprofile tmp.cov --coverpkg github.com/kopia/kopia/... github.com/kopia/kopia/... go tool cover -html=tmp.cov coverage-repo: - go test --coverprofile tmp.cov github.com/kopia/kopia/repo/... + go test --coverprofile tmp.cov --coverpkg github.com/kopia/kopia/repo/... github.com/kopia/kopia/repo/... go tool cover -html=tmp.cov diff --git a/repo/tests/repository_stress_test/repository_stress.go b/repo/tests/repository_stress_test/repository_stress.go new file mode 100644 index 000000000..ec4817f32 --- /dev/null +++ b/repo/tests/repository_stress_test/repository_stress.go @@ -0,0 +1,3 @@ +package repositorystress + +// dummy package diff --git a/repo/tests/repository_stress_test/repository_stress_test.go b/repo/tests/repository_stress_test/repository_stress_test.go index 8e533d0fe..35984bf5a 100644 --- a/repo/tests/repository_stress_test/repository_stress_test.go +++ b/repo/tests/repository_stress_test/repository_stress_test.go @@ -1,4 +1,4 @@ -package block_manager_stress_test +package repositorystress_test import ( "context" diff --git a/repo/tests/stress_test/stress.go b/repo/tests/stress_test/stress.go new file mode 100644 index 000000000..1d01396c9 --- /dev/null +++ b/repo/tests/stress_test/stress.go @@ -0,0 +1,3 @@ +package stress + +// dummy package diff --git a/tests/end_to_end_test/end_to_end.go b/tests/end_to_end_test/end_to_end.go new file mode 100644 index 000000000..6ee3d8a56 --- /dev/null +++ b/tests/end_to_end_test/end_to_end.go @@ -0,0 +1 @@ +package endtoend diff --git a/tests/end_to_end_test/end_to_end_test.go b/tests/end_to_end_test/end_to_end_test.go index 7e78067a1..5202c52f9 100644 --- a/tests/end_to_end_test/end_to_end_test.go +++ b/tests/end_to_end_test/end_to_end_test.go @@ -1,4 +1,4 @@ -package tests +package endtoend_test import ( "encoding/hex"