From 3697843a98c960c5ef4e5299ac3f1c9054dc93f2 Mon Sep 17 00:00:00 2001 From: Douglas Camata <159076+douglascamata@users.noreply.github.com> Date: Mon, 24 Apr 2023 11:53:21 +0200 Subject: [PATCH] tests: Remove custom Between test matcher (#6310) * Remove custom Between test matcher The upstream PR to efficientgo/e2e has been merged, so we can use it from there. Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com> * Run go mod tidy Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com> --------- Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- test/e2e/compact_test.go | 2 +- test/e2e/e2ethanos/custom_test_matchers.go | 19 ------------------- 4 files changed, 4 insertions(+), 23 deletions(-) delete mode 100644 test/e2e/e2ethanos/custom_test_matchers.go diff --git a/go.mod b/go.mod index 8587f5efa11..8b69966d6dd 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/chromedp/chromedp v0.8.2 github.com/davecgh/go-spew v1.1.1 // indirect github.com/dustin/go-humanize v1.0.0 - github.com/efficientgo/e2e v0.14.1-0.20230119090947-fa7ceb0197c5 + github.com/efficientgo/e2e v0.14.1-0.20230413163036-7a7e0bae9913 github.com/efficientgo/tools/extkingpin v0.0.0-20220817170617-6c25e3b627dd github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb github.com/fatih/structtag v1.2.0 diff --git a/go.sum b/go.sum index 4eccd1d027f..33c196a42e9 100644 --- a/go.sum +++ b/go.sum @@ -245,8 +245,8 @@ github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= github.com/efficientgo/core v1.0.0-rc.2 h1:7j62qHLnrZqO3V3UA0AqOGd5d5aXV3AX6m/NZBHp78I= github.com/efficientgo/core v1.0.0-rc.2/go.mod h1:FfGdkzWarkuzOlY04VY+bGfb1lWrjaL6x/GLcQ4vJps= -github.com/efficientgo/e2e v0.14.1-0.20230119090947-fa7ceb0197c5 h1:N1fHVcNEPMJNB93sxT6icl5yvoFxa2sp3/1NnVlrAFc= -github.com/efficientgo/e2e v0.14.1-0.20230119090947-fa7ceb0197c5/go.mod h1:plsKU0YHE9uX+7utvr7SiDtVBSHJyEfHRO4UnUgDmts= +github.com/efficientgo/e2e v0.14.1-0.20230413163036-7a7e0bae9913 h1:/CcqWjW1rMnoYiiKpiVKcReOJCGnCo868z85g7TwRhg= +github.com/efficientgo/e2e v0.14.1-0.20230413163036-7a7e0bae9913/go.mod h1:plsKU0YHE9uX+7utvr7SiDtVBSHJyEfHRO4UnUgDmts= github.com/efficientgo/tools/extkingpin v0.0.0-20220817170617-6c25e3b627dd h1:VaYzzXeUbC5fVheskcKVNOyJMEYD+HgrJNzIAg/mRIM= github.com/efficientgo/tools/extkingpin v0.0.0-20220817170617-6c25e3b627dd/go.mod h1:ZV0utlglOczUWv3ih2AbqPSoLoFzdplUYxwV62eZi6Q= github.com/elastic/go-sysinfo v1.1.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0= diff --git a/test/e2e/compact_test.go b/test/e2e/compact_test.go index 69577d1dcad..a4d8bb4c4f2 100644 --- a/test/e2e/compact_test.go +++ b/test/e2e/compact_test.go @@ -723,7 +723,7 @@ func testCompactWithStoreGateway(t *testing.T, penaltyDedup bool) { operationMatcher, err := matchers.NewMatcher(matchers.MatchEqual, "operation", "get") testutil.Ok(t, err) testutil.Ok(t, c.WaitSumMetricsWithOptions( - e2ethanos.Between(0, 1000), + e2emon.Between(0, 1000), []string{"thanos_objstore_bucket_operations_total"}, e2emon.WithLabelMatchers( bucketMatcher, operationMatcher, diff --git a/test/e2e/e2ethanos/custom_test_matchers.go b/test/e2e/e2ethanos/custom_test_matchers.go deleted file mode 100644 index d95258c54f2..00000000000 --- a/test/e2e/e2ethanos/custom_test_matchers.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) The Thanos Authors. -// Licensed under the Apache License 2.0. - -package e2ethanos - -import ( - e2emon "github.com/efficientgo/e2e/monitoring" -) - -// Between is a MetricValueExpectation function for WaitSumMetrics that returns true if given single sum is between -// the lower and upper bounds (non-inclusive, as in `lower < x < upper`). -func Between(lower, upper float64) e2emon.MetricValueExpectation { - return func(sums ...float64) bool { - if len(sums) != 1 { - panic("between: expected one value") - } - return sums[0] > lower && sums[0] < upper - } -}