Skip to content

chore(deps): update module github.com/antonboom/testifylint to v1.6.0 #6440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions baggage/baggage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ func TestBaggageParseValue(t *testing.T) {

val := b.Members()[0].Value()

assert.EqualValues(t, tc.valueWant, val)
assert.Equal(t, tc.valueWant, val)
assert.Equal(t, len(val), tc.valueWantSize)
assert.True(t, utf8.ValidString(val))
})
Expand Down Expand Up @@ -971,7 +971,7 @@ func TestBaggageMember(t *testing.T) {

func TestMemberKey(t *testing.T) {
m := Member{}
assert.Equal(t, "", m.Key(), "even invalid values should be returned")
assert.Empty(t, m.Key(), "even invalid values should be returned")

key := "k"
m.key = key
Expand Down
2 changes: 1 addition & 1 deletion bridge/opencensus/metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func TestMetricProducer(t *testing.T) {
} else {
require.NoError(t, err)
}
require.Equal(t, len(output), len(tc.expected))
require.Len(t, tc.expected, len(output))
for i := range output {
metricdatatest.AssertEqual(t, tc.expected[i], output[i])
}
Expand Down
2 changes: 1 addition & 1 deletion exporters/otlp/otlptrace/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestExporterClientError(t *testing.T) {

assert.Error(t, err)
assert.ErrorIs(t, err, context.Canceled)
assert.True(t, strings.HasPrefix(err.Error(), "traces export: "), err)
assert.True(t, strings.HasPrefix(err.Error(), "traces export: "), "%+v", err)

assert.NoError(t, exp.Shutdown(ctx))
}
2 changes: 1 addition & 1 deletion exporters/otlp/otlptrace/otlptracegrpc/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func TestExportSpansTimeoutHonored(t *testing.T) {

unwrapped := errors.Unwrap(err)
require.Equal(t, codes.DeadlineExceeded, status.Convert(unwrapped).Code())
require.True(t, strings.HasPrefix(err.Error(), "traces export: "), err)
require.True(t, strings.HasPrefix(err.Error(), "traces export: "), "%+v", err)
}

func TestNewWithMultipleAttributeTypes(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion exporters/prometheus/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func TestNewConfig(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
cfg := newConfig(tt.options...)
// only check the length of readerOpts, since they are not comparable
assert.Equal(t, len(tt.wantConfig.readerOpts), len(cfg.readerOpts))
assert.Len(t, cfg.readerOpts, len(tt.wantConfig.readerOpts))
cfg.readerOpts = nil
tt.wantConfig.readerOpts = nil

Expand Down
2 changes: 1 addition & 1 deletion exporters/prometheus/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ func TestExemplars(t *testing.T) {
}
require.NotNil(t, exemplar)
require.Equal(t, tc.expectedExemplarValue, exemplar.GetValue())
require.Equal(t, len(tc.expectedLabels), len(exemplar.GetLabel()))
require.Len(t, exemplar.GetLabel(), len(tc.expectedLabels))
for _, label := range exemplar.GetLabel() {
val, ok := tc.expectedLabels[label.GetName()]
require.True(t, ok)
Expand Down
2 changes: 1 addition & 1 deletion internal/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
github.com/Abirdcfly/dupword v0.1.3 // indirect
github.com/Antonboom/errname v1.1.0 // indirect
github.com/Antonboom/nilnil v1.0.1 // indirect
github.com/Antonboom/testifylint v1.5.2 // indirect
github.com/Antonboom/testifylint v1.6.0 // indirect
github.com/BurntSushi/toml v1.4.1-0.20241028111116-b7406c026f5a // indirect
github.com/Crocmagnon/fatcontext v0.7.1 // indirect
github.com/Djarvur/go-err113 v0.1.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions internal/tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ github.com/Antonboom/errname v1.1.0 h1:A+ucvdpMwlo/myWrkHEUEBWc/xuXdud23S8tmTb/o
github.com/Antonboom/errname v1.1.0/go.mod h1:O1NMrzgUcVBGIfi3xlVuvX8Q/VP/73sseCaAppfjqZw=
github.com/Antonboom/nilnil v1.0.1 h1:C3Tkm0KUxgfO4Duk3PM+ztPncTFlOf0b2qadmS0s4xs=
github.com/Antonboom/nilnil v1.0.1/go.mod h1:CH7pW2JsRNFgEh8B2UaPZTEPhCMuFowP/e8Udp9Nnb0=
github.com/Antonboom/testifylint v1.5.2 h1:4s3Xhuv5AvdIgbd8wOOEeo0uZG7PbDKQyKY5lGoQazk=
github.com/Antonboom/testifylint v1.5.2/go.mod h1:vxy8VJ0bc6NavlYqjZfmp6EfqXMtBgQ4+mhCojwC1P8=
github.com/Antonboom/testifylint v1.6.0 h1:6rdILVPt4+rqcvhid8w9wJNynKLUgqHNpFyM67UeXyc=
github.com/Antonboom/testifylint v1.6.0/go.mod h1:k+nEkathI2NFjKO6HvwmSrbzUcQ6FAnbZV+ZRrnXPLI=
github.com/BurntSushi/toml v1.4.1-0.20241028111116-b7406c026f5a h1:jvCp1xfUeIIselwOL/l83yNikq4EKN6pPgDVFrjVCs0=
github.com/BurntSushi/toml v1.4.1-0.20241028111116-b7406c026f5a/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/Crocmagnon/fatcontext v0.7.1 h1:SC/VIbRRZQeQWj/TcQBS6JmrXcfA+BU4OGSVUt54PjM=
Expand Down
2 changes: 1 addition & 1 deletion propagation/trace_context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func TestInvalidSpanContextDropped(t *testing.T) {

header := http.Header{}
propagation.TraceContext{}.Inject(ctx, propagation.HeaderCarrier(header))
assert.Equal(t, "", header.Get("traceparent"), "injected invalid SpanContext")
assert.Empty(t, header.Get("traceparent"), "injected invalid SpanContext")
}

func TestTraceContextFields(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion schema/v1.0/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestParseSchemaFile(t *testing.T) {
ts, err := ParseFile("testdata/valid-example.yaml")
assert.NoError(t, err)
assert.NotNil(t, ts)
assert.EqualValues(
assert.Equal(
t, &ast.Schema{
FileFormat: "1.0.0",
SchemaURL: "https://opentelemetry.io/schemas/1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion schema/v1.1/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestParseSchemaFile(t *testing.T) {
ts, err := ParseFile("testdata/valid-example.yaml")
assert.NoError(t, err)
assert.NotNil(t, ts)
assert.EqualValues(
assert.Equal(
t, &ast11.Schema{
FileFormat: "1.1.0",
SchemaURL: "https://opentelemetry.io/schemas/1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/log/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ func TestLoggerProviderLogger(t *testing.T) {
assert.Equal(t, 1, l.level, "logged level")
assert.Equal(t, "Invalid Logger name.", l.msg, "logged message")
require.Len(t, l.keysAndValues, 2, "logged key values")
assert.Equal(t, "", l.keysAndValues[1], "logged name")
assert.Empty(t, l.keysAndValues[1], "logged name")
})

t.Run("Stopped", func(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions sdk/metric/pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ func TestLogConflictName(t *testing.T) {
tc.existing, tc.name,
)
} else {
assert.Equalf(
t, "", msg,
assert.Emptyf(
t, msg,
"warning logged for non-conflicting names: %s, %s",
tc.existing, tc.name,
)
Expand Down
2 changes: 1 addition & 1 deletion sdk/metric/reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func TestDefaultAggregationSelector(t *testing.T) {
}

for _, ik := range iKinds {
assert.NoError(t, DefaultAggregationSelector(ik).err(), ik)
assert.NoError(t, DefaultAggregationSelector(ik).err(), "%+v", ik)
}
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/resource/auto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestDetect(t *testing.T) {
if c.wantErr != nil {
assert.ErrorIs(t, err, c.wantErr)
if errors.Is(c.wantErr, resource.ErrSchemaURLConflict) {
assert.Zero(t, r.SchemaURL())
assert.Empty(t, r.SchemaURL())
}
} else {
assert.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion sdk/resource/builtin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ func TestStringDetectorErrors(t *testing.T) {
for _, kv := range res.Attributes() {
m[string(kv.Key)] = kv.Value.Emit()
}
require.EqualValues(t, map[string]string{"A": "B"}, m)
require.Equal(t, map[string]string{"A": "B"}, m)
}
}
16 changes: 8 additions & 8 deletions sdk/resource/os_release_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ PROP3='Final value'`)

t.Run(tc.Name, func(t *testing.T) {
result := resource.ParseOSReleaseFile(tc.OSRelease)
require.EqualValues(t, tc.Parsed, result)
require.Equal(t, tc.Parsed, result)
})
}
}
Expand Down Expand Up @@ -157,7 +157,7 @@ func TestSkip(t *testing.T) {

t.Run(tc.Name, func(t *testing.T) {
result := resource.Skip(tc.Line)
require.EqualValues(t, tc.Expected, result)
require.Equal(t, tc.Expected, result)
})
}
}
Expand All @@ -184,9 +184,9 @@ func TestParse(t *testing.T) {

t.Run(tc.Name, func(t *testing.T) {
key, value, ok := resource.Parse(tc.Line)
require.EqualValues(t, tc.ExpectedKey, key)
require.EqualValues(t, tc.ExpectedValue, value)
require.EqualValues(t, tc.OK, ok)
require.Equal(t, tc.ExpectedKey, key)
require.Equal(t, tc.ExpectedValue, value)
require.Equal(t, tc.OK, ok)
})
}
}
Expand Down Expand Up @@ -224,7 +224,7 @@ func TestUnquote(t *testing.T) {

t.Run(tc.Name, func(t *testing.T) {
result := resource.Unquote(tc.Text)
require.EqualValues(t, tc.Expected, result)
require.Equal(t, tc.Expected, result)
})
}
}
Expand All @@ -248,7 +248,7 @@ func TestUnescape(t *testing.T) {

t.Run(tc.Name, func(t *testing.T) {
result := resource.Unescape(tc.Text)
require.EqualValues(t, tc.Expected, result)
require.Equal(t, tc.Expected, result)
})
}
}
Expand Down Expand Up @@ -290,7 +290,7 @@ func TestBuildOSRelease(t *testing.T) {

t.Run(tc.Name, func(t *testing.T) {
result := resource.BuildOSRelease(tc.Values)
require.EqualValues(t, tc.Expected, result)
require.Equal(t, tc.Expected, result)
})
}
}
2 changes: 1 addition & 1 deletion sdk/resource/os_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestMapRuntimeOSToSemconvOSType(t *testing.T) {

t.Run(tc.Name, func(t *testing.T) {
osTypeAttribute := resource.MapRuntimeOSToSemconvOSType(tc.Goos)
require.EqualValues(t, osTypeAttribute, tc.OSType)
require.Equal(t, osTypeAttribute, tc.OSType)
})
}
}
14 changes: 7 additions & 7 deletions sdk/resource/process_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,23 @@ func TestWithProcessFuncsErrors(t *testing.T) {
}

func TestCommandArgs(t *testing.T) {
require.EqualValues(t, os.Args, resource.CommandArgs())
require.Equal(t, os.Args, resource.CommandArgs())
}

func TestRuntimeName(t *testing.T) {
if runtime.Compiler == "gc" {
require.EqualValues(t, "go", resource.RuntimeName())
require.Equal(t, "go", resource.RuntimeName())
} else {
require.EqualValues(t, runtime.Compiler, resource.RuntimeName())
require.Equal(t, runtime.Compiler, resource.RuntimeName())
}
}

func TestRuntimeOS(t *testing.T) {
require.EqualValues(t, runtime.GOOS, resource.RuntimeOS())
require.Equal(t, runtime.GOOS, resource.RuntimeOS())
}

func TestRuntimeArch(t *testing.T) {
require.EqualValues(t, runtime.GOARCH, resource.RuntimeArch())
require.Equal(t, runtime.GOARCH, resource.RuntimeArch())
}

func testWithProcessExecutablePathError(t *testing.T) {
Expand All @@ -131,7 +131,7 @@ func testWithProcessExecutablePathError(t *testing.T) {
)

require.Error(t, err)
require.EqualValues(t, map[string]string{}, toMap(res))
require.Equal(t, map[string]string{}, toMap(res))
}

func testWithProcessOwnerError(t *testing.T) {
Expand All @@ -142,5 +142,5 @@ func testWithProcessOwnerError(t *testing.T) {
)

require.Error(t, err)
require.EqualValues(t, map[string]string{}, toMap(res))
require.Equal(t, map[string]string{}, toMap(res))
}
Loading
Loading