From 469f3d7e875c6b45fcccd93de6b15178ef16ef21 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Mon, 30 Sep 2024 08:44:52 +0200 Subject: [PATCH] [chore]: enable negative-positive rule from testifylint (#5849) Testifylint is a linter that provides best practices with the use of testify. This PR enables [negative-positive](https://github.com/Antonboom/testifylint?tab=readme-ov-file#negative-positive) rule from [testifylint](https://github.com/Antonboom/testifylint) Signed-off-by: Matthieu MOREL --- .golangci.yml | 1 - sdk/metric/internal/aggregate/exponential_histogram_test.go | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index f971865bbf4..d09555506f7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -308,5 +308,4 @@ linters-settings: disable: - float-compare - go-require - - negative-positive - require-error diff --git a/sdk/metric/internal/aggregate/exponential_histogram_test.go b/sdk/metric/internal/aggregate/exponential_histogram_test.go index f3ef2434632..9ede71ac88c 100644 --- a/sdk/metric/internal/aggregate/exponential_histogram_test.go +++ b/sdk/metric/internal/aggregate/exponential_histogram_test.go @@ -180,7 +180,7 @@ func testExpoHistogramMinMaxSumInt64(t *testing.T) { assert.Equal(t, tt.expected.max, dp.max) assert.Equal(t, tt.expected.min, dp.min) - assert.Equal(t, tt.expected.sum, dp.sum) + assert.InDelta(t, tt.expected.sum, dp.sum, 0.01) }) } } @@ -222,7 +222,7 @@ func testExpoHistogramMinMaxSumFloat64(t *testing.T) { assert.Equal(t, tt.expected.max, dp.max) assert.Equal(t, tt.expected.min, dp.min) - assert.Equal(t, tt.expected.sum, dp.sum) + assert.InDelta(t, tt.expected.sum, dp.sum, 0.01) }) } }