From 7da218727db0f86bb5b0aa8240f1d2688f1e2040 Mon Sep 17 00:00:00 2001 From: nagamocha3000 Date: Sat, 27 Feb 2021 00:44:16 +0300 Subject: [PATCH] Separate out tests on Percentile to top level --- executor.go | 1 + executor_test.go | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/executor.go b/executor.go index d76a07da7..a0e92ea4b 100644 --- a/executor.go +++ b/executor.go @@ -1360,6 +1360,7 @@ func (e *executor) executePercentile(ctx context.Context, qcx *Qcx, index string intersectCall.Children = append(intersectCall.Children, filterCall) rangeCall = intersectCall.Children[0] } + k := (1 - nth) / nth min, max := minVal.Val, maxVal.Val diff --git a/executor_test.go b/executor_test.go index 28fa86792..33a70e5b7 100644 --- a/executor_test.go +++ b/executor_test.go @@ -25,6 +25,7 @@ import ( "io/ioutil" "math" "math/rand" + _ "net/http/pprof" "reflect" "sort" "strconv" @@ -6854,8 +6855,15 @@ func TestVariousQueries(t *testing.T) { c := test.MustRunCluster(t, clusterSize) defer c.Close() - variousQueries(t, clusterSize) - variousQueriesOnTimeFields(t, clusterSize) + variousQueries(t, c) + variousQueriesOnTimeFields(t, c) + }) + } +} + +func TestVariousQueriesOnPercentiles(t *testing.T) { + for _, clusterSize := range []int{1, 3, 4, 7} { + t.Run(fmt.Sprintf("%d-node", clusterSize), func(t *testing.T) { variousQueriesOnPercentiles(t, clusterSize) }) } @@ -6987,8 +6995,8 @@ func variousQueriesOnPercentiles(t *testing.T, clusterSize int) { } type testCase struct { - query string - qrVerifier func(t *testing.T, resp pilosa.QueryResponse) + query string + // qrVerifier func(t *testing.T, resp pilosa.QueryResponse) csvVerifier string } @@ -7023,7 +7031,6 @@ func variousQueriesOnPercentiles(t *testing.T, clusterSize int) { // TODO: add HTTP and Postgres and ability to convert // those results to CSV to run through CSV verifier ->>>>>>> Add basic test for Percentile query }) } }