Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
Added fast cover target and fullcoverage tag
Browse files Browse the repository at this point in the history
  • Loading branch information
yuce committed Oct 3, 2017
1 parent 7254204 commit 5a51d91
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 19 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
19 changes: 2 additions & 17 deletions client_internal_test.go → client_internal_it_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build integration

package pilosa

import (
Expand Down Expand Up @@ -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,
Expand Down
22 changes: 22 additions & 0 deletions full_coverage_test.go
Original file line number Diff line number Diff line change
@@ -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)
}
}

0 comments on commit 5a51d91

Please sign in to comment.