Skip to content

Commit 4e2a00a

Browse files
mmorel-35dmathieu
authored andcommitted
[chore]: fix testifylint rules (cmd,connector,testbed) (open-telemetry#39169)
#### Description This fixes testifylint issues in cmd, connector and testbed folders discovered after golangci-lint@v2 upgrade Signed-off-by: Matthieu MOREL <[email protected]>
1 parent cfc35e1 commit 4e2a00a

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

cmd/telemetrygen/pkg/logs/worker_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func TestLogsWithOneTelemetryAttributes(t *testing.T) {
177177

178178
l.WalkAttributes(func(attr log.KeyValue) bool {
179179
if attr.Key == telemetryAttrKeyOne {
180-
assert.EqualValues(t, telemetryAttrValueOne, attr.Value.AsString())
180+
assert.Equal(t, telemetryAttrValueOne, attr.Value.AsString())
181181
}
182182
return true
183183
})

connector/signaltometricsconnector/factory_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func TestNewFactoryWithLogs(t *testing.T) {
2424
name: "factory_type",
2525
f: func(t *testing.T) {
2626
factory := NewFactory()
27-
require.EqualValues(t, metadata.Type, factory.Type())
27+
require.Equal(t, metadata.Type, factory.Type())
2828
},
2929
},
3030
{

testbed/testbed/data_providers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ func TestGoldenDataProvider(t *testing.T) {
2424
}
2525
ms = append(ms, m)
2626
}
27-
require.Equal(t, len(dp.(*goldenDataProvider).metricsGenerated), len(ms))
27+
require.Len(t, ms, len(dp.(*goldenDataProvider).metricsGenerated))
2828
}

testbed/testbed/validator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ type PerfTestValidator struct {
7272
}
7373

7474
func (v *PerfTestValidator) Validate(tc *TestCase) {
75-
if assert.EqualValues(tc.t,
75+
if assert.Equal(tc.t,
7676
int64(tc.LoadGenerator.DataItemsSent()),
7777
int64(tc.MockBackend.DataItemsReceived()),
7878
"Received and sent counters do not match.") {
@@ -130,7 +130,7 @@ func NewCorrectTestValidator(senderName string, receiverName string, provider Da
130130
}
131131

132132
func (v *CorrectnessTestValidator) Validate(tc *TestCase) {
133-
if assert.EqualValues(tc.t,
133+
if assert.Equal(tc.t,
134134
int64(tc.LoadGenerator.DataItemsSent())-int64(tc.LoadGenerator.PermanentErrors()),
135135
int64(tc.MockBackend.DataItemsReceived()),
136136
"Received and sent counters do not match.") {

testbed/tests/trace_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ func verifySingleSpan(
316316
}
317317
}
318318
}
319-
assert.EqualValues(t, 1, count, "must receive one span")
319+
assert.Equal(t, 1, count, "must receive one span")
320320
}
321321

322322
func TestTraceAttributesProcessor(t *testing.T) {
@@ -399,7 +399,7 @@ func TestTraceAttributesProcessor(t *testing.T) {
399399
require.Equal(t, 1, span.Attributes().Len())
400400
attrVal, ok := span.Attributes().Get("new_attr")
401401
assert.True(t, ok)
402-
assert.EqualValues(t, "string value", attrVal.Str())
402+
assert.Equal(t, "string value", attrVal.Str())
403403
}
404404

405405
verifySingleSpan(t, tc, nodeToInclude, spanToInclude, verifySpan)
@@ -493,7 +493,7 @@ func TestTraceAttributesProcessorJaegerGRPC(t *testing.T) {
493493
require.Equal(t, 1, span.Attributes().Len())
494494
attrVal, ok := span.Attributes().Get("new_attr")
495495
assert.True(t, ok)
496-
assert.EqualValues(t, "string value", attrVal.Str())
496+
assert.Equal(t, "string value", attrVal.Str())
497497
}
498498

499499
verifySingleSpan(t, tc, nodeToInclude, spanToInclude, verifySpan)

0 commit comments

Comments
 (0)