diff --git a/Makefile b/Makefile index 41b24de..79fb32d 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,13 @@ -.PHONY: all cover generate-proto test test-all +.PHONY: all cover fast-cover generate-proto test test-all all: test cover: - go test -cover -tags=integration + go test -cover -tags="integration fullcoverage" + +fast-cover: + go test -cover -tags="integration" generate: protoc --go_out=. gopilosa_pbuf/public.proto diff --git a/client_internal_test.go b/client_internal_it_test.go similarity index 82% rename from client_internal_test.go rename to client_internal_it_test.go index f912875..26dc2cf 100644 --- a/client_internal_test.go +++ b/client_internal_it_test.go @@ -1,3 +1,5 @@ +// +build integration + package pilosa import ( @@ -41,23 +43,6 @@ func TestNewClientFromAddresses(t *testing.T) { } } -func TestMakeRequestData(t *testing.T) { - q := make([]byte, 2<<30) - q[0] = 'a' - p := PQLBaseQuery{ - pql: string(q), - } - uri, err := NewURIFromAddress("localhost:10101") - if err != nil { - t.Fatal(err) - } - cli := NewClientWithURI(uri) - resp, err := cli.Query(&p, nil) - if err == nil { - t.Fatalf("expected err with too large query, but got %v", resp) - } -} - func TestAnyError(t *testing.T) { err := anyError( &http.Response{StatusCode: 400, diff --git a/full_coverage_test.go b/full_coverage_test.go new file mode 100644 index 0000000..d40a317 --- /dev/null +++ b/full_coverage_test.go @@ -0,0 +1,22 @@ +// +build fullcoverage + +package pilosa + +import "testing" + +func TestMakeRequestData(t *testing.T) { + q := make([]byte, 2<<30) + q[0] = 'a' + p := PQLBaseQuery{ + pql: string(q), + } + uri, err := NewURIFromAddress("localhost:10101") + if err != nil { + t.Fatal(err) + } + cli := NewClientWithURI(uri) + resp, err := cli.Query(&p, nil) + if err == nil { + t.Fatalf("expected err with too large query, but got %v", resp) + } +}