diff --git a/.golangci.yml b/.golangci.yml index ca228436fbc..23508362d50 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -124,7 +124,6 @@ linters-settings: testifylint: # TODO: enable all rules disable: - - compares - error-is-as - expected-actual - float-compare diff --git a/Makefile.Common b/Makefile.Common index d4e7e681363..bd08b2cd74d 100644 --- a/Makefile.Common +++ b/Makefile.Common @@ -38,7 +38,7 @@ SEMCONVGEN := $(TOOLS_BIN_DIR)/semconvgen SEMCONVKIT := $(TOOLS_BIN_DIR)/semconvkit TESTIFYLINT := $(TOOLS_BIN_DIR)/testifylint -TESTIFYLINT_OPT?= --enable-all --disable=compares,error-is-as,expected-actual,float-compare,formatter,go-require,negative-positive,require-error +TESTIFYLINT_OPT?= --enable-all --disable=error-is-as,expected-actual,float-compare,formatter,go-require,negative-positive,require-error .PHONY: install-tools install-tools: $(TOOLS_BIN_NAMES) diff --git a/exporter/exporterhelper/retry_sender_test.go b/exporter/exporterhelper/retry_sender_test.go index e4de2a7a764..c934f6561f6 100644 --- a/exporter/exporterhelper/retry_sender_test.go +++ b/exporter/exporterhelper/retry_sender_test.go @@ -188,7 +188,7 @@ func TestQueuedRetry_ThrottleError(t *testing.T) { ocs.awaitAsyncProcessing() // The initial backoff is 10ms, but because of the throttle this should wait at least 100ms. - assert.True(t, 100*time.Millisecond < time.Since(start)) + assert.Less(t, 100*time.Millisecond, time.Since(start)) mockR.checkNumRequests(t, 2) ocs.checkSendItemsCount(t, 2) diff --git a/internal/fanoutconsumer/logs_test.go b/internal/fanoutconsumer/logs_test.go index c1b91a7a4e8..59f834d8674 100644 --- a/internal/fanoutconsumer/logs_test.go +++ b/internal/fanoutconsumer/logs_test.go @@ -44,18 +44,18 @@ func TestLogsMultiplexingNonMutating(t *testing.T) { } } - assert.True(t, ld == p1.AllLogs()[0]) - assert.True(t, ld == p1.AllLogs()[1]) + assert.Equal(t, ld, p1.AllLogs()[0]) + assert.Equal(t, ld, p1.AllLogs()[1]) assert.EqualValues(t, ld, p1.AllLogs()[0]) assert.EqualValues(t, ld, p1.AllLogs()[1]) - assert.True(t, ld == p2.AllLogs()[0]) - assert.True(t, ld == p2.AllLogs()[1]) + assert.Equal(t, ld, p2.AllLogs()[0]) + assert.Equal(t, ld, p2.AllLogs()[1]) assert.EqualValues(t, ld, p2.AllLogs()[0]) assert.EqualValues(t, ld, p2.AllLogs()[1]) - assert.True(t, ld == p3.AllLogs()[0]) - assert.True(t, ld == p3.AllLogs()[1]) + assert.Equal(t, ld, p3.AllLogs()[0]) + assert.Equal(t, ld, p3.AllLogs()[1]) assert.EqualValues(t, ld, p3.AllLogs()[0]) assert.EqualValues(t, ld, p3.AllLogs()[1]) @@ -80,19 +80,19 @@ func TestLogsMultiplexingMutating(t *testing.T) { } } - assert.True(t, ld != p1.AllLogs()[0]) - assert.True(t, ld != p1.AllLogs()[1]) + assert.NotEqual(t, ld, p1.AllLogs()[0]) + assert.NotEqual(t, ld, p1.AllLogs()[1]) assert.EqualValues(t, ld, p1.AllLogs()[0]) assert.EqualValues(t, ld, p1.AllLogs()[1]) - assert.True(t, ld != p2.AllLogs()[0]) - assert.True(t, ld != p2.AllLogs()[1]) + assert.NotEqual(t, ld, p2.AllLogs()[0]) + assert.NotEqual(t, ld, p2.AllLogs()[1]) assert.EqualValues(t, ld, p2.AllLogs()[0]) assert.EqualValues(t, ld, p2.AllLogs()[1]) // For this consumer, will receive the initial data. - assert.True(t, ld == p3.AllLogs()[0]) - assert.True(t, ld == p3.AllLogs()[1]) + assert.Equal(t, ld, p3.AllLogs()[0]) + assert.Equal(t, ld, p3.AllLogs()[1]) assert.EqualValues(t, ld, p3.AllLogs()[0]) assert.EqualValues(t, ld, p3.AllLogs()[1]) @@ -121,18 +121,18 @@ func TestReadOnlyLogsMultiplexingMutating(t *testing.T) { // All consumers should receive the cloned data. - assert.True(t, ld != p1.AllLogs()[0]) - assert.True(t, ld != p1.AllLogs()[1]) + assert.NotEqual(t, ld, p1.AllLogs()[0]) + assert.NotEqual(t, ld, p1.AllLogs()[1]) assert.EqualValues(t, ldOrig, p1.AllLogs()[0]) assert.EqualValues(t, ldOrig, p1.AllLogs()[1]) - assert.True(t, ld != p2.AllLogs()[0]) - assert.True(t, ld != p2.AllLogs()[1]) + assert.NotEqual(t, ld, p2.AllLogs()[0]) + assert.NotEqual(t, ld, p2.AllLogs()[1]) assert.EqualValues(t, ldOrig, p2.AllLogs()[0]) assert.EqualValues(t, ldOrig, p2.AllLogs()[1]) - assert.True(t, ld != p3.AllLogs()[0]) - assert.True(t, ld != p3.AllLogs()[1]) + assert.NotEqual(t, ld, p3.AllLogs()[0]) + assert.NotEqual(t, ld, p3.AllLogs()[1]) assert.EqualValues(t, ldOrig, p3.AllLogs()[0]) assert.EqualValues(t, ldOrig, p3.AllLogs()[1]) } @@ -154,20 +154,20 @@ func TestLogsMultiplexingMixLastMutating(t *testing.T) { } } - assert.True(t, ld != p1.AllLogs()[0]) - assert.True(t, ld != p1.AllLogs()[1]) + assert.NotEqual(t, ld, p1.AllLogs()[0]) + assert.NotEqual(t, ld, p1.AllLogs()[1]) assert.EqualValues(t, ld, p1.AllLogs()[0]) assert.EqualValues(t, ld, p1.AllLogs()[1]) // For this consumer, will receive the initial data. - assert.True(t, ld == p2.AllLogs()[0]) - assert.True(t, ld == p2.AllLogs()[1]) + assert.Equal(t, ld, p2.AllLogs()[0]) + assert.Equal(t, ld, p2.AllLogs()[1]) assert.EqualValues(t, ld, p2.AllLogs()[0]) assert.EqualValues(t, ld, p2.AllLogs()[1]) // For this consumer, will clone the initial data. - assert.True(t, ld != p3.AllLogs()[0]) - assert.True(t, ld != p3.AllLogs()[1]) + assert.NotEqual(t, ld, p3.AllLogs()[0]) + assert.NotEqual(t, ld, p3.AllLogs()[1]) assert.EqualValues(t, ld, p3.AllLogs()[0]) assert.EqualValues(t, ld, p3.AllLogs()[1]) @@ -192,19 +192,19 @@ func TestLogsMultiplexingMixLastNonMutating(t *testing.T) { } } - assert.True(t, ld != p1.AllLogs()[0]) - assert.True(t, ld != p1.AllLogs()[1]) + assert.NotEqual(t, ld, p1.AllLogs()[0]) + assert.NotEqual(t, ld, p1.AllLogs()[1]) assert.EqualValues(t, ld, p1.AllLogs()[0]) assert.EqualValues(t, ld, p1.AllLogs()[1]) - assert.True(t, ld != p2.AllLogs()[0]) - assert.True(t, ld != p2.AllLogs()[1]) + assert.NotEqual(t, ld, p2.AllLogs()[0]) + assert.NotEqual(t, ld, p2.AllLogs()[1]) assert.EqualValues(t, ld, p2.AllLogs()[0]) assert.EqualValues(t, ld, p2.AllLogs()[1]) // For this consumer, will receive the initial data. - assert.True(t, ld == p3.AllLogs()[0]) - assert.True(t, ld == p3.AllLogs()[1]) + assert.Equal(t, ld, p3.AllLogs()[0]) + assert.Equal(t, ld, p3.AllLogs()[1]) assert.EqualValues(t, ld, p3.AllLogs()[0]) assert.EqualValues(t, ld, p3.AllLogs()[1]) @@ -224,8 +224,8 @@ func TestLogsWhenErrors(t *testing.T) { assert.Error(t, lfc.ConsumeLogs(context.Background(), ld)) } - assert.True(t, ld == p3.AllLogs()[0]) - assert.True(t, ld == p3.AllLogs()[1]) + assert.Equal(t, ld, p3.AllLogs()[0]) + assert.Equal(t, ld, p3.AllLogs()[1]) assert.EqualValues(t, ld, p3.AllLogs()[0]) assert.EqualValues(t, ld, p3.AllLogs()[1]) } diff --git a/internal/fanoutconsumer/metrics_test.go b/internal/fanoutconsumer/metrics_test.go index 51e00791a76..e6d6ef54697 100644 --- a/internal/fanoutconsumer/metrics_test.go +++ b/internal/fanoutconsumer/metrics_test.go @@ -44,18 +44,18 @@ func TestMetricsMultiplexingNonMutating(t *testing.T) { } } - assert.True(t, md == p1.AllMetrics()[0]) - assert.True(t, md == p1.AllMetrics()[1]) + assert.Equal(t, md, p1.AllMetrics()[0]) + assert.Equal(t, md, p1.AllMetrics()[1]) assert.EqualValues(t, md, p1.AllMetrics()[0]) assert.EqualValues(t, md, p1.AllMetrics()[1]) - assert.True(t, md == p2.AllMetrics()[0]) - assert.True(t, md == p2.AllMetrics()[1]) + assert.Equal(t, md, p2.AllMetrics()[0]) + assert.Equal(t, md, p2.AllMetrics()[1]) assert.EqualValues(t, md, p2.AllMetrics()[0]) assert.EqualValues(t, md, p2.AllMetrics()[1]) - assert.True(t, md == p3.AllMetrics()[0]) - assert.True(t, md == p3.AllMetrics()[1]) + assert.Equal(t, md, p3.AllMetrics()[0]) + assert.Equal(t, md, p3.AllMetrics()[1]) assert.EqualValues(t, md, p3.AllMetrics()[0]) assert.EqualValues(t, md, p3.AllMetrics()[1]) @@ -80,19 +80,19 @@ func TestMetricsMultiplexingMutating(t *testing.T) { } } - assert.True(t, md != p1.AllMetrics()[0]) - assert.True(t, md != p1.AllMetrics()[1]) + assert.NotEqual(t, md, p1.AllMetrics()[0]) + assert.NotEqual(t, md, p1.AllMetrics()[1]) assert.EqualValues(t, md, p1.AllMetrics()[0]) assert.EqualValues(t, md, p1.AllMetrics()[1]) - assert.True(t, md != p2.AllMetrics()[0]) - assert.True(t, md != p2.AllMetrics()[1]) + assert.NotEqual(t, md, p2.AllMetrics()[0]) + assert.NotEqual(t, md, p2.AllMetrics()[1]) assert.EqualValues(t, md, p2.AllMetrics()[0]) assert.EqualValues(t, md, p2.AllMetrics()[1]) // For this consumer, will receive the initial data. - assert.True(t, md == p3.AllMetrics()[0]) - assert.True(t, md == p3.AllMetrics()[1]) + assert.Equal(t, md, p3.AllMetrics()[0]) + assert.Equal(t, md, p3.AllMetrics()[1]) assert.EqualValues(t, md, p3.AllMetrics()[0]) assert.EqualValues(t, md, p3.AllMetrics()[1]) @@ -121,18 +121,18 @@ func TestReadOnlyMetricsMultiplexingMixFirstMutating(t *testing.T) { // All consumers should receive the cloned data. - assert.True(t, md != p1.AllMetrics()[0]) - assert.True(t, md != p1.AllMetrics()[1]) + assert.NotEqual(t, md, p1.AllMetrics()[0]) + assert.NotEqual(t, md, p1.AllMetrics()[1]) assert.EqualValues(t, mdOrig, p1.AllMetrics()[0]) assert.EqualValues(t, mdOrig, p1.AllMetrics()[1]) - assert.True(t, md != p2.AllMetrics()[0]) - assert.True(t, md != p2.AllMetrics()[1]) + assert.NotEqual(t, md, p2.AllMetrics()[0]) + assert.NotEqual(t, md, p2.AllMetrics()[1]) assert.EqualValues(t, mdOrig, p2.AllMetrics()[0]) assert.EqualValues(t, mdOrig, p2.AllMetrics()[1]) - assert.True(t, md != p3.AllMetrics()[0]) - assert.True(t, md != p3.AllMetrics()[1]) + assert.NotEqual(t, md, p3.AllMetrics()[0]) + assert.NotEqual(t, md, p3.AllMetrics()[1]) assert.EqualValues(t, mdOrig, p3.AllMetrics()[0]) assert.EqualValues(t, mdOrig, p3.AllMetrics()[1]) } @@ -154,20 +154,20 @@ func TestMetricsMultiplexingMixLastMutating(t *testing.T) { } } - assert.True(t, md != p1.AllMetrics()[0]) - assert.True(t, md != p1.AllMetrics()[1]) + assert.NotEqual(t, md, p1.AllMetrics()[0]) + assert.NotEqual(t, md, p1.AllMetrics()[1]) assert.EqualValues(t, md, p1.AllMetrics()[0]) assert.EqualValues(t, md, p1.AllMetrics()[1]) // For this consumer, will receive the initial data. - assert.True(t, md == p2.AllMetrics()[0]) - assert.True(t, md == p2.AllMetrics()[1]) + assert.Equal(t, md, p2.AllMetrics()[0]) + assert.Equal(t, md, p2.AllMetrics()[1]) assert.EqualValues(t, md, p2.AllMetrics()[0]) assert.EqualValues(t, md, p2.AllMetrics()[1]) // For this consumer, will clone the initial data. - assert.True(t, md != p3.AllMetrics()[0]) - assert.True(t, md != p3.AllMetrics()[1]) + assert.NotEqual(t, md, p3.AllMetrics()[0]) + assert.NotEqual(t, md, p3.AllMetrics()[1]) assert.EqualValues(t, md, p3.AllMetrics()[0]) assert.EqualValues(t, md, p3.AllMetrics()[1]) @@ -192,19 +192,19 @@ func TestMetricsMultiplexingMixLastNonMutating(t *testing.T) { } } - assert.True(t, md != p1.AllMetrics()[0]) - assert.True(t, md != p1.AllMetrics()[1]) + assert.NotEqual(t, md, p1.AllMetrics()[0]) + assert.NotEqual(t, md, p1.AllMetrics()[1]) assert.EqualValues(t, md, p1.AllMetrics()[0]) assert.EqualValues(t, md, p1.AllMetrics()[1]) - assert.True(t, md != p2.AllMetrics()[0]) - assert.True(t, md != p2.AllMetrics()[1]) + assert.NotEqual(t, md, p2.AllMetrics()[0]) + assert.NotEqual(t, md, p2.AllMetrics()[1]) assert.EqualValues(t, md, p2.AllMetrics()[0]) assert.EqualValues(t, md, p2.AllMetrics()[1]) // For this consumer, will receive the initial data. - assert.True(t, md == p3.AllMetrics()[0]) - assert.True(t, md == p3.AllMetrics()[1]) + assert.Equal(t, md, p3.AllMetrics()[0]) + assert.Equal(t, md, p3.AllMetrics()[1]) assert.EqualValues(t, md, p3.AllMetrics()[0]) assert.EqualValues(t, md, p3.AllMetrics()[1]) @@ -224,8 +224,8 @@ func TestMetricsWhenErrors(t *testing.T) { assert.Error(t, mfc.ConsumeMetrics(context.Background(), md)) } - assert.True(t, md == p3.AllMetrics()[0]) - assert.True(t, md == p3.AllMetrics()[1]) + assert.Equal(t, md, p3.AllMetrics()[0]) + assert.Equal(t, md, p3.AllMetrics()[1]) assert.EqualValues(t, md, p3.AllMetrics()[0]) assert.EqualValues(t, md, p3.AllMetrics()[1]) } diff --git a/internal/fanoutconsumer/profiles_test.go b/internal/fanoutconsumer/profiles_test.go index 0f108239f5d..1e11e747a8d 100644 --- a/internal/fanoutconsumer/profiles_test.go +++ b/internal/fanoutconsumer/profiles_test.go @@ -45,18 +45,18 @@ func TestProfilesMultiplexingNonMutating(t *testing.T) { } } - assert.True(t, td == p1.AllProfiles()[0]) - assert.True(t, td == p1.AllProfiles()[1]) + assert.Equal(t, td, p1.AllProfiles()[0]) + assert.Equal(t, td, p1.AllProfiles()[1]) assert.EqualValues(t, td, p1.AllProfiles()[0]) assert.EqualValues(t, td, p1.AllProfiles()[1]) - assert.True(t, td == p2.AllProfiles()[0]) - assert.True(t, td == p2.AllProfiles()[1]) + assert.Equal(t, td, p2.AllProfiles()[0]) + assert.Equal(t, td, p2.AllProfiles()[1]) assert.EqualValues(t, td, p2.AllProfiles()[0]) assert.EqualValues(t, td, p2.AllProfiles()[1]) - assert.True(t, td == p3.AllProfiles()[0]) - assert.True(t, td == p3.AllProfiles()[1]) + assert.Equal(t, td, p3.AllProfiles()[0]) + assert.Equal(t, td, p3.AllProfiles()[1]) assert.EqualValues(t, td, p3.AllProfiles()[0]) assert.EqualValues(t, td, p3.AllProfiles()[1]) @@ -81,19 +81,19 @@ func TestProfilesMultiplexingMutating(t *testing.T) { } } - assert.True(t, td != p1.AllProfiles()[0]) - assert.True(t, td != p1.AllProfiles()[1]) + assert.NotEqual(t, td, p1.AllProfiles()[0]) + assert.NotEqual(t, td, p1.AllProfiles()[1]) assert.EqualValues(t, td, p1.AllProfiles()[0]) assert.EqualValues(t, td, p1.AllProfiles()[1]) - assert.True(t, td != p2.AllProfiles()[0]) - assert.True(t, td != p2.AllProfiles()[1]) + assert.NotEqual(t, td, p2.AllProfiles()[0]) + assert.NotEqual(t, td, p2.AllProfiles()[1]) assert.EqualValues(t, td, p2.AllProfiles()[0]) assert.EqualValues(t, td, p2.AllProfiles()[1]) // For this consumer, will receive the initial data. - assert.True(t, td == p3.AllProfiles()[0]) - assert.True(t, td == p3.AllProfiles()[1]) + assert.Equal(t, td, p3.AllProfiles()[0]) + assert.Equal(t, td, p3.AllProfiles()[1]) assert.EqualValues(t, td, p3.AllProfiles()[0]) assert.EqualValues(t, td, p3.AllProfiles()[1]) @@ -123,18 +123,18 @@ func TestReadOnlyProfilesMultiplexingMutating(t *testing.T) { // All consumers should receive the cloned data. - assert.True(t, td != p1.AllProfiles()[0]) - assert.True(t, td != p1.AllProfiles()[1]) + assert.NotEqual(t, td, p1.AllProfiles()[0]) + assert.NotEqual(t, td, p1.AllProfiles()[1]) assert.EqualValues(t, tdOrig, p1.AllProfiles()[0]) assert.EqualValues(t, tdOrig, p1.AllProfiles()[1]) - assert.True(t, td != p2.AllProfiles()[0]) - assert.True(t, td != p2.AllProfiles()[1]) + assert.NotEqual(t, td, p2.AllProfiles()[0]) + assert.NotEqual(t, td, p2.AllProfiles()[1]) assert.EqualValues(t, tdOrig, p2.AllProfiles()[0]) assert.EqualValues(t, tdOrig, p2.AllProfiles()[1]) - assert.True(t, td != p3.AllProfiles()[0]) - assert.True(t, td != p3.AllProfiles()[1]) + assert.NotEqual(t, td, p3.AllProfiles()[0]) + assert.NotEqual(t, td, p3.AllProfiles()[1]) assert.EqualValues(t, tdOrig, p3.AllProfiles()[0]) assert.EqualValues(t, tdOrig, p3.AllProfiles()[1]) } @@ -156,20 +156,20 @@ func TestProfilesMultiplexingMixLastMutating(t *testing.T) { } } - assert.True(t, td != p1.AllProfiles()[0]) - assert.True(t, td != p1.AllProfiles()[1]) + assert.NotEqual(t, td, p1.AllProfiles()[0]) + assert.NotEqual(t, td, p1.AllProfiles()[1]) assert.EqualValues(t, td, p1.AllProfiles()[0]) assert.EqualValues(t, td, p1.AllProfiles()[1]) // For this consumer, will receive the initial data. - assert.True(t, td == p2.AllProfiles()[0]) - assert.True(t, td == p2.AllProfiles()[1]) + assert.Equal(t, td, p2.AllProfiles()[0]) + assert.Equal(t, td, p2.AllProfiles()[1]) assert.EqualValues(t, td, p2.AllProfiles()[0]) assert.EqualValues(t, td, p2.AllProfiles()[1]) // For this consumer, will clone the initial data. - assert.True(t, td != p3.AllProfiles()[0]) - assert.True(t, td != p3.AllProfiles()[1]) + assert.NotEqual(t, td, p3.AllProfiles()[0]) + assert.NotEqual(t, td, p3.AllProfiles()[1]) assert.EqualValues(t, td, p3.AllProfiles()[0]) assert.EqualValues(t, td, p3.AllProfiles()[1]) @@ -194,19 +194,19 @@ func TestProfilesMultiplexingMixLastNonMutating(t *testing.T) { } } - assert.True(t, td != p1.AllProfiles()[0]) - assert.True(t, td != p1.AllProfiles()[1]) + assert.NotEqual(t, td, p1.AllProfiles()[0]) + assert.NotEqual(t, td, p1.AllProfiles()[1]) assert.EqualValues(t, td, p1.AllProfiles()[0]) assert.EqualValues(t, td, p1.AllProfiles()[1]) - assert.True(t, td != p2.AllProfiles()[0]) - assert.True(t, td != p2.AllProfiles()[1]) + assert.NotEqual(t, td, p2.AllProfiles()[0]) + assert.NotEqual(t, td, p2.AllProfiles()[1]) assert.EqualValues(t, td, p2.AllProfiles()[0]) assert.EqualValues(t, td, p2.AllProfiles()[1]) // For this consumer, will receive the initial data. - assert.True(t, td == p3.AllProfiles()[0]) - assert.True(t, td == p3.AllProfiles()[1]) + assert.Equal(t, td, p3.AllProfiles()[0]) + assert.Equal(t, td, p3.AllProfiles()[1]) assert.EqualValues(t, td, p3.AllProfiles()[0]) assert.EqualValues(t, td, p3.AllProfiles()[1]) @@ -226,8 +226,8 @@ func TestProfilesWhenErrors(t *testing.T) { assert.Error(t, tfc.ConsumeProfiles(context.Background(), td)) } - assert.True(t, td == p3.AllProfiles()[0]) - assert.True(t, td == p3.AllProfiles()[1]) + assert.Equal(t, td, p3.AllProfiles()[0]) + assert.Equal(t, td, p3.AllProfiles()[1]) assert.EqualValues(t, td, p3.AllProfiles()[0]) assert.EqualValues(t, td, p3.AllProfiles()[1]) } diff --git a/internal/fanoutconsumer/traces_test.go b/internal/fanoutconsumer/traces_test.go index 829e4cd9069..c4714b63252 100644 --- a/internal/fanoutconsumer/traces_test.go +++ b/internal/fanoutconsumer/traces_test.go @@ -44,18 +44,18 @@ func TestTracesMultiplexingNonMutating(t *testing.T) { } } - assert.True(t, td == p1.AllTraces()[0]) - assert.True(t, td == p1.AllTraces()[1]) + assert.Equal(t, td, p1.AllTraces()[0]) + assert.Equal(t, td, p1.AllTraces()[1]) assert.EqualValues(t, td, p1.AllTraces()[0]) assert.EqualValues(t, td, p1.AllTraces()[1]) - assert.True(t, td == p2.AllTraces()[0]) - assert.True(t, td == p2.AllTraces()[1]) + assert.Equal(t, td, p2.AllTraces()[0]) + assert.Equal(t, td, p2.AllTraces()[1]) assert.EqualValues(t, td, p2.AllTraces()[0]) assert.EqualValues(t, td, p2.AllTraces()[1]) - assert.True(t, td == p3.AllTraces()[0]) - assert.True(t, td == p3.AllTraces()[1]) + assert.Equal(t, td, p3.AllTraces()[0]) + assert.Equal(t, td, p3.AllTraces()[1]) assert.EqualValues(t, td, p3.AllTraces()[0]) assert.EqualValues(t, td, p3.AllTraces()[1]) @@ -80,19 +80,19 @@ func TestTracesMultiplexingMutating(t *testing.T) { } } - assert.True(t, td != p1.AllTraces()[0]) - assert.True(t, td != p1.AllTraces()[1]) + assert.NotEqual(t, td, p1.AllTraces()[0]) + assert.NotEqual(t, td, p1.AllTraces()[1]) assert.EqualValues(t, td, p1.AllTraces()[0]) assert.EqualValues(t, td, p1.AllTraces()[1]) - assert.True(t, td != p2.AllTraces()[0]) - assert.True(t, td != p2.AllTraces()[1]) + assert.NotEqual(t, td, p2.AllTraces()[0]) + assert.NotEqual(t, td, p2.AllTraces()[1]) assert.EqualValues(t, td, p2.AllTraces()[0]) assert.EqualValues(t, td, p2.AllTraces()[1]) // For this consumer, will receive the initial data. - assert.True(t, td == p3.AllTraces()[0]) - assert.True(t, td == p3.AllTraces()[1]) + assert.Equal(t, td, p3.AllTraces()[0]) + assert.Equal(t, td, p3.AllTraces()[1]) assert.EqualValues(t, td, p3.AllTraces()[0]) assert.EqualValues(t, td, p3.AllTraces()[1]) @@ -122,18 +122,18 @@ func TestReadOnlyTracesMultiplexingMutating(t *testing.T) { // All consumers should receive the cloned data. - assert.True(t, td != p1.AllTraces()[0]) - assert.True(t, td != p1.AllTraces()[1]) + assert.NotEqual(t, td, p1.AllTraces()[0]) + assert.NotEqual(t, td, p1.AllTraces()[1]) assert.EqualValues(t, tdOrig, p1.AllTraces()[0]) assert.EqualValues(t, tdOrig, p1.AllTraces()[1]) - assert.True(t, td != p2.AllTraces()[0]) - assert.True(t, td != p2.AllTraces()[1]) + assert.NotEqual(t, td, p2.AllTraces()[0]) + assert.NotEqual(t, td, p2.AllTraces()[1]) assert.EqualValues(t, tdOrig, p2.AllTraces()[0]) assert.EqualValues(t, tdOrig, p2.AllTraces()[1]) - assert.True(t, td != p3.AllTraces()[0]) - assert.True(t, td != p3.AllTraces()[1]) + assert.NotEqual(t, td, p3.AllTraces()[0]) + assert.NotEqual(t, td, p3.AllTraces()[1]) assert.EqualValues(t, tdOrig, p3.AllTraces()[0]) assert.EqualValues(t, tdOrig, p3.AllTraces()[1]) } @@ -155,20 +155,20 @@ func TestTracesMultiplexingMixLastMutating(t *testing.T) { } } - assert.True(t, td != p1.AllTraces()[0]) - assert.True(t, td != p1.AllTraces()[1]) + assert.NotEqual(t, td, p1.AllTraces()[0]) + assert.NotEqual(t, td, p1.AllTraces()[1]) assert.EqualValues(t, td, p1.AllTraces()[0]) assert.EqualValues(t, td, p1.AllTraces()[1]) // For this consumer, will receive the initial data. - assert.True(t, td == p2.AllTraces()[0]) - assert.True(t, td == p2.AllTraces()[1]) + assert.Equal(t, td, p2.AllTraces()[0]) + assert.Equal(t, td, p2.AllTraces()[1]) assert.EqualValues(t, td, p2.AllTraces()[0]) assert.EqualValues(t, td, p2.AllTraces()[1]) // For this consumer, will clone the initial data. - assert.True(t, td != p3.AllTraces()[0]) - assert.True(t, td != p3.AllTraces()[1]) + assert.NotEqual(t, td, p3.AllTraces()[0]) + assert.NotEqual(t, td, p3.AllTraces()[1]) assert.EqualValues(t, td, p3.AllTraces()[0]) assert.EqualValues(t, td, p3.AllTraces()[1]) @@ -193,19 +193,19 @@ func TestTracesMultiplexingMixLastNonMutating(t *testing.T) { } } - assert.True(t, td != p1.AllTraces()[0]) - assert.True(t, td != p1.AllTraces()[1]) + assert.NotEqual(t, td, p1.AllTraces()[0]) + assert.NotEqual(t, td, p1.AllTraces()[1]) assert.EqualValues(t, td, p1.AllTraces()[0]) assert.EqualValues(t, td, p1.AllTraces()[1]) - assert.True(t, td != p2.AllTraces()[0]) - assert.True(t, td != p2.AllTraces()[1]) + assert.NotEqual(t, td, p2.AllTraces()[0]) + assert.NotEqual(t, td, p2.AllTraces()[1]) assert.EqualValues(t, td, p2.AllTraces()[0]) assert.EqualValues(t, td, p2.AllTraces()[1]) // For this consumer, will receive the initial data. - assert.True(t, td == p3.AllTraces()[0]) - assert.True(t, td == p3.AllTraces()[1]) + assert.Equal(t, td, p3.AllTraces()[0]) + assert.Equal(t, td, p3.AllTraces()[1]) assert.EqualValues(t, td, p3.AllTraces()[0]) assert.EqualValues(t, td, p3.AllTraces()[1]) @@ -225,8 +225,8 @@ func TestTracesWhenErrors(t *testing.T) { assert.Error(t, tfc.ConsumeTraces(context.Background(), td)) } - assert.True(t, td == p3.AllTraces()[0]) - assert.True(t, td == p3.AllTraces()[1]) + assert.Equal(t, td, p3.AllTraces()[0]) + assert.Equal(t, td, p3.AllTraces()[1]) assert.EqualValues(t, td, p3.AllTraces()[0]) assert.EqualValues(t, td, p3.AllTraces()[1]) } diff --git a/internal/iruntime/mem_info_test.go b/internal/iruntime/mem_info_test.go index 863fbe14028..6f35361a557 100644 --- a/internal/iruntime/mem_info_test.go +++ b/internal/iruntime/mem_info_test.go @@ -12,5 +12,5 @@ import ( func TestReadMemInfo(t *testing.T) { vmStat, err := readMemInfo() assert.NoError(t, err) - assert.True(t, vmStat > 0) + assert.Greater(t, vmStat, 0) } diff --git a/internal/iruntime/total_memory_linux_test.go b/internal/iruntime/total_memory_linux_test.go index 563f3942207..db78d4089a8 100644 --- a/internal/iruntime/total_memory_linux_test.go +++ b/internal/iruntime/total_memory_linux_test.go @@ -15,5 +15,5 @@ import ( func TestTotalMemory(t *testing.T) { totalMemory, err := TotalMemory() require.NoError(t, err) - assert.True(t, totalMemory > 0) + assert.Greater(t, totalMemory, 0) }