1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-06-27 00:21:15 +02:00

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

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[github.com/Antonboom/testifylint](https://redirect.github.com/Antonboom/testifylint)
| `v1.5.2` -> `v1.6.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fAntonboom%2ftestifylint/v1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fAntonboom%2ftestifylint/v1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fAntonboom%2ftestifylint/v1.5.2/v1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fAntonboom%2ftestifylint/v1.5.2/v1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>Antonboom/testifylint
(github.com/Antonboom/testifylint)</summary>

###
[`v1.6.0`](https://redirect.github.com/Antonboom/testifylint/releases/tag/v1.6.0):
– new `equal-values` and `suite-method-signature`

[Compare
Source](https://redirect.github.com/Antonboom/testifylint/compare/v1.5.2...v1.6.0)

#### What's Changed

##### New checkers

- new checker `equal-values` by
[@&#8203;Antonboom](https://redirect.github.com/Antonboom) in
[https://github.com/Antonboom/testifylint/pull/223](https://redirect.github.com/Antonboom/testifylint/pull/223)
- new checker `suite-method-signature` by
[@&#8203;Antonboom](https://redirect.github.com/Antonboom) in
[https://github.com/Antonboom/testifylint/pull/228](https://redirect.github.com/Antonboom/testifylint/pull/228)

##### New features

- `len`: support len-len and value-len cases by
[@&#8203;Antonboom](https://redirect.github.com/Antonboom) in
[https://github.com/Antonboom/testifylint/pull/204](https://redirect.github.com/Antonboom/testifylint/pull/204)
- `error-is-as`: support NotErrorAs by
[@&#8203;Antonboom](https://redirect.github.com/Antonboom) in
[https://github.com/Antonboom/testifylint/pull/219](https://redirect.github.com/Antonboom/testifylint/pull/219)
- `useless-assert`: add NotElementsMatch and NotErrorAs by
[@&#8203;Antonboom](https://redirect.github.com/Antonboom) in
[https://github.com/Antonboom/testifylint/pull/220](https://redirect.github.com/Antonboom/testifylint/pull/220)
- `formatter`: support non-string-message checks by
[@&#8203;Antonboom](https://redirect.github.com/Antonboom) in
[https://github.com/Antonboom/testifylint/pull/221](https://redirect.github.com/Antonboom/testifylint/pull/221)
- `formatter`: warn on empty message by
[@&#8203;Antonboom](https://redirect.github.com/Antonboom) in
[https://github.com/Antonboom/testifylint/pull/225](https://redirect.github.com/Antonboom/testifylint/pull/225)
- `empty`: support empty strings, Zero for strings and len + bubbled
useless-assert cases by
[@&#8203;ccoVeille](https://redirect.github.com/ccoVeille) in
[https://github.com/Antonboom/testifylint/pull/129](https://redirect.github.com/Antonboom/testifylint/pull/129)

##### New fixes

- `negative-positive`: remove untyping, ignore Negative for len
comparisons by
[@&#8203;Antonboom](https://redirect.github.com/Antonboom) in
[https://github.com/Antonboom/testifylint/pull/226](https://redirect.github.com/Antonboom/testifylint/pull/226)
- fixes: support `assert.CollectT` by
[@&#8203;Antonboom](https://redirect.github.com/Antonboom) in
[https://github.com/Antonboom/testifylint/pull/233](https://redirect.github.com/Antonboom/testifylint/pull/233)

##### Bump deps

- Upgrade testdata to v1.10.0 of testify by
[@&#8203;Antonboom](https://redirect.github.com/Antonboom) in
[https://github.com/Antonboom/testifylint/pull/218](https://redirect.github.com/Antonboom/testifylint/pull/218)
- Go 1.24 by [@&#8203;Antonboom](https://redirect.github.com/Antonboom)
in
[https://github.com/Antonboom/testifylint/pull/234](https://redirect.github.com/Antonboom/testifylint/pull/234)
- build(deps): bump golang.org/x/tools from 0.26.0 to 0.27.0 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Antonboom/testifylint/pull/206](https://redirect.github.com/Antonboom/testifylint/pull/206)
- build(deps): bump rlespinasse/github-slug-action from 4.4.1 to 5.0.0
by [@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Antonboom/testifylint/pull/207](https://redirect.github.com/Antonboom/testifylint/pull/207)
- build(deps): bump golang.org/x/tools from 0.27.0 to 0.29.0 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Antonboom/testifylint/pull/214](https://redirect.github.com/Antonboom/testifylint/pull/214)

**Full Changelog**:
https://github.com/Antonboom/testifylint/compare/v1.5.2...v1.6.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-go).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMDAuMiIsInVwZGF0ZWRJblZlciI6IjM5LjIwMC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
This commit is contained in:
renovate[bot]
2025-03-13 14:31:12 -07:00
committed by GitHub
parent a43e266c64
commit 05de07bcf5
26 changed files with 68 additions and 68 deletions

View File

@ -597,7 +597,7 @@ func TestBaggageParseValue(t *testing.T) {
val := b.Members()[0].Value() 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.Equal(t, len(val), tc.valueWantSize)
assert.True(t, utf8.ValidString(val)) assert.True(t, utf8.ValidString(val))
}) })
@ -971,7 +971,7 @@ func TestBaggageMember(t *testing.T) {
func TestMemberKey(t *testing.T) { func TestMemberKey(t *testing.T) {
m := Member{} 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" key := "k"
m.key = key m.key = key

View File

@ -133,7 +133,7 @@ func TestMetricProducer(t *testing.T) {
} else { } else {
require.NoError(t, err) require.NoError(t, err)
} }
require.Equal(t, len(output), len(tc.expected)) require.Len(t, tc.expected, len(output))
for i := range output { for i := range output {
metricdatatest.AssertEqual(t, tc.expected[i], output[i]) metricdatatest.AssertEqual(t, tc.expected[i], output[i])
} }

View File

@ -45,7 +45,7 @@ func TestExporterClientError(t *testing.T) {
assert.Error(t, err) assert.Error(t, err)
assert.ErrorIs(t, err, context.Canceled) 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)) assert.NoError(t, exp.Shutdown(ctx))
} }

View File

@ -255,7 +255,7 @@ func TestExportSpansTimeoutHonored(t *testing.T) {
unwrapped := errors.Unwrap(err) unwrapped := errors.Unwrap(err)
require.Equal(t, codes.DeadlineExceeded, status.Convert(unwrapped).Code()) 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) { func TestNewWithMultipleAttributeTypes(t *testing.T) {

View File

@ -141,7 +141,7 @@ func TestNewConfig(t *testing.T) {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
cfg := newConfig(tt.options...) cfg := newConfig(tt.options...)
// only check the length of readerOpts, since they are not comparable // 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 cfg.readerOpts = nil
tt.wantConfig.readerOpts = nil tt.wantConfig.readerOpts = nil

View File

@ -1101,7 +1101,7 @@ func TestExemplars(t *testing.T) {
} }
require.NotNil(t, exemplar) require.NotNil(t, exemplar)
require.Equal(t, tc.expectedExemplarValue, exemplar.GetValue()) 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() { for _, label := range exemplar.GetLabel() {
val, ok := tc.expectedLabels[label.GetName()] val, ok := tc.expectedLabels[label.GetName()]
require.True(t, ok) require.True(t, ok)

View File

@ -25,7 +25,7 @@ require (
github.com/Abirdcfly/dupword v0.1.3 // indirect github.com/Abirdcfly/dupword v0.1.3 // indirect
github.com/Antonboom/errname v1.1.0 // indirect github.com/Antonboom/errname v1.1.0 // indirect
github.com/Antonboom/nilnil v1.0.1 // 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/BurntSushi/toml v1.4.1-0.20241028111116-b7406c026f5a // indirect
github.com/Crocmagnon/fatcontext v0.7.1 // indirect github.com/Crocmagnon/fatcontext v0.7.1 // indirect
github.com/Djarvur/go-err113 v0.1.0 // indirect github.com/Djarvur/go-err113 v0.1.0 // indirect

View File

@ -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/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 h1:C3Tkm0KUxgfO4Duk3PM+ztPncTFlOf0b2qadmS0s4xs=
github.com/Antonboom/nilnil v1.0.1/go.mod h1:CH7pW2JsRNFgEh8B2UaPZTEPhCMuFowP/e8Udp9Nnb0= 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.6.0 h1:6rdILVPt4+rqcvhid8w9wJNynKLUgqHNpFyM67UeXyc=
github.com/Antonboom/testifylint v1.5.2/go.mod h1:vxy8VJ0bc6NavlYqjZfmp6EfqXMtBgQ4+mhCojwC1P8= 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 h1:jvCp1xfUeIIselwOL/l83yNikq4EKN6pPgDVFrjVCs0=
github.com/BurntSushi/toml v1.4.1-0.20241028111116-b7406c026f5a/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= 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= github.com/Crocmagnon/fatcontext v0.7.1 h1:SC/VIbRRZQeQWj/TcQBS6JmrXcfA+BU4OGSVUt54PjM=

View File

@ -333,7 +333,7 @@ func TestInvalidSpanContextDropped(t *testing.T) {
header := http.Header{} header := http.Header{}
propagation.TraceContext{}.Inject(ctx, propagation.HeaderCarrier(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) { func TestTraceContextFields(t *testing.T) {

View File

@ -17,7 +17,7 @@ func TestParseSchemaFile(t *testing.T) {
ts, err := ParseFile("testdata/valid-example.yaml") ts, err := ParseFile("testdata/valid-example.yaml")
assert.NoError(t, err) assert.NoError(t, err)
assert.NotNil(t, ts) assert.NotNil(t, ts)
assert.EqualValues( assert.Equal(
t, &ast.Schema{ t, &ast.Schema{
FileFormat: "1.0.0", FileFormat: "1.0.0",
SchemaURL: "https://opentelemetry.io/schemas/1.1.0", SchemaURL: "https://opentelemetry.io/schemas/1.1.0",

View File

@ -18,7 +18,7 @@ func TestParseSchemaFile(t *testing.T) {
ts, err := ParseFile("testdata/valid-example.yaml") ts, err := ParseFile("testdata/valid-example.yaml")
assert.NoError(t, err) assert.NoError(t, err)
assert.NotNil(t, ts) assert.NotNil(t, ts)
assert.EqualValues( assert.Equal(
t, &ast11.Schema{ t, &ast11.Schema{
FileFormat: "1.1.0", FileFormat: "1.1.0",
SchemaURL: "https://opentelemetry.io/schemas/1.1.0", SchemaURL: "https://opentelemetry.io/schemas/1.1.0",

View File

@ -285,7 +285,7 @@ func TestLoggerProviderLogger(t *testing.T) {
assert.Equal(t, 1, l.level, "logged level") assert.Equal(t, 1, l.level, "logged level")
assert.Equal(t, "Invalid Logger name.", l.msg, "logged message") assert.Equal(t, "Invalid Logger name.", l.msg, "logged message")
require.Len(t, l.keysAndValues, 2, "logged key values") 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) { t.Run("Stopped", func(t *testing.T) {

View File

@ -243,8 +243,8 @@ func TestLogConflictName(t *testing.T) {
tc.existing, tc.name, tc.existing, tc.name,
) )
} else { } else {
assert.Equalf( assert.Emptyf(
t, "", msg, t, msg,
"warning logged for non-conflicting names: %s, %s", "warning logged for non-conflicting names: %s, %s",
tc.existing, tc.name, tc.existing, tc.name,
) )

View File

@ -307,7 +307,7 @@ func TestDefaultAggregationSelector(t *testing.T) {
} }
for _, ik := range iKinds { for _, ik := range iKinds {
assert.NoError(t, DefaultAggregationSelector(ik).err(), ik) assert.NoError(t, DefaultAggregationSelector(ik).err(), "%+v", ik)
} }
} }

View File

@ -81,7 +81,7 @@ func TestDetect(t *testing.T) {
if c.wantErr != nil { if c.wantErr != nil {
assert.ErrorIs(t, err, c.wantErr) assert.ErrorIs(t, err, c.wantErr)
if errors.Is(c.wantErr, resource.ErrSchemaURLConflict) { if errors.Is(c.wantErr, resource.ErrSchemaURLConflict) {
assert.Zero(t, r.SchemaURL()) assert.Empty(t, r.SchemaURL())
} }
} else { } else {
assert.NoError(t, err) assert.NoError(t, err)

View File

@ -60,6 +60,6 @@ func TestStringDetectorErrors(t *testing.T) {
for _, kv := range res.Attributes() { for _, kv := range res.Attributes() {
m[string(kv.Key)] = kv.Value.Emit() 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)
} }
} }

View File

@ -128,7 +128,7 @@ PROP3='Final value'`)
t.Run(tc.Name, func(t *testing.T) { t.Run(tc.Name, func(t *testing.T) {
result := resource.ParseOSReleaseFile(tc.OSRelease) result := resource.ParseOSReleaseFile(tc.OSRelease)
require.EqualValues(t, tc.Parsed, result) require.Equal(t, tc.Parsed, result)
}) })
} }
} }
@ -157,7 +157,7 @@ func TestSkip(t *testing.T) {
t.Run(tc.Name, func(t *testing.T) { t.Run(tc.Name, func(t *testing.T) {
result := resource.Skip(tc.Line) result := resource.Skip(tc.Line)
require.EqualValues(t, tc.Expected, result) require.Equal(t, tc.Expected, result)
}) })
} }
} }
@ -184,9 +184,9 @@ func TestParse(t *testing.T) {
t.Run(tc.Name, func(t *testing.T) { t.Run(tc.Name, func(t *testing.T) {
key, value, ok := resource.Parse(tc.Line) key, value, ok := resource.Parse(tc.Line)
require.EqualValues(t, tc.ExpectedKey, key) require.Equal(t, tc.ExpectedKey, key)
require.EqualValues(t, tc.ExpectedValue, value) require.Equal(t, tc.ExpectedValue, value)
require.EqualValues(t, tc.OK, ok) require.Equal(t, tc.OK, ok)
}) })
} }
} }
@ -224,7 +224,7 @@ func TestUnquote(t *testing.T) {
t.Run(tc.Name, func(t *testing.T) { t.Run(tc.Name, func(t *testing.T) {
result := resource.Unquote(tc.Text) result := resource.Unquote(tc.Text)
require.EqualValues(t, tc.Expected, result) require.Equal(t, tc.Expected, result)
}) })
} }
} }
@ -248,7 +248,7 @@ func TestUnescape(t *testing.T) {
t.Run(tc.Name, func(t *testing.T) { t.Run(tc.Name, func(t *testing.T) {
result := resource.Unescape(tc.Text) result := resource.Unescape(tc.Text)
require.EqualValues(t, tc.Expected, result) require.Equal(t, tc.Expected, result)
}) })
} }
} }
@ -290,7 +290,7 @@ func TestBuildOSRelease(t *testing.T) {
t.Run(tc.Name, func(t *testing.T) { t.Run(tc.Name, func(t *testing.T) {
result := resource.BuildOSRelease(tc.Values) result := resource.BuildOSRelease(tc.Values)
require.EqualValues(t, tc.Expected, result) require.Equal(t, tc.Expected, result)
}) })
} }
} }

View File

@ -49,7 +49,7 @@ func TestMapRuntimeOSToSemconvOSType(t *testing.T) {
t.Run(tc.Name, func(t *testing.T) { t.Run(tc.Name, func(t *testing.T) {
osTypeAttribute := resource.MapRuntimeOSToSemconvOSType(tc.Goos) osTypeAttribute := resource.MapRuntimeOSToSemconvOSType(tc.Goos)
require.EqualValues(t, osTypeAttribute, tc.OSType) require.Equal(t, osTypeAttribute, tc.OSType)
}) })
} }
} }

View File

@ -104,23 +104,23 @@ func TestWithProcessFuncsErrors(t *testing.T) {
} }
func TestCommandArgs(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) { func TestRuntimeName(t *testing.T) {
if runtime.Compiler == "gc" { if runtime.Compiler == "gc" {
require.EqualValues(t, "go", resource.RuntimeName()) require.Equal(t, "go", resource.RuntimeName())
} else { } else {
require.EqualValues(t, runtime.Compiler, resource.RuntimeName()) require.Equal(t, runtime.Compiler, resource.RuntimeName())
} }
} }
func TestRuntimeOS(t *testing.T) { func TestRuntimeOS(t *testing.T) {
require.EqualValues(t, runtime.GOOS, resource.RuntimeOS()) require.Equal(t, runtime.GOOS, resource.RuntimeOS())
} }
func TestRuntimeArch(t *testing.T) { func TestRuntimeArch(t *testing.T) {
require.EqualValues(t, runtime.GOARCH, resource.RuntimeArch()) require.Equal(t, runtime.GOARCH, resource.RuntimeArch())
} }
func testWithProcessExecutablePathError(t *testing.T) { func testWithProcessExecutablePathError(t *testing.T) {
@ -131,7 +131,7 @@ func testWithProcessExecutablePathError(t *testing.T) {
) )
require.Error(t, err) 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) { func testWithProcessOwnerError(t *testing.T) {
@ -142,5 +142,5 @@ func testWithProcessOwnerError(t *testing.T) {
) )
require.Error(t, err) require.Error(t, err)
require.EqualValues(t, map[string]string{}, toMap(res)) require.Equal(t, map[string]string{}, toMap(res))
} }

View File

@ -184,7 +184,7 @@ func TestMerge(t *testing.T) {
} else { } else {
assert.NoError(t, err) assert.NoError(t, err)
} }
assert.EqualValues(t, c.schemaURL, res.SchemaURL()) assert.Equal(t, c.schemaURL, res.SchemaURL())
if diff := cmp.Diff( if diff := cmp.Diff(
res.Attributes(), res.Attributes(),
c.want, c.want,
@ -197,8 +197,8 @@ func TestMerge(t *testing.T) {
func TestEmpty(t *testing.T) { func TestEmpty(t *testing.T) {
var res *resource.Resource var res *resource.Resource
assert.Equal(t, "", res.SchemaURL()) assert.Empty(t, res.SchemaURL())
assert.Equal(t, "", res.String()) assert.Empty(t, res.String())
assert.Equal(t, []attribute.KeyValue(nil), res.Attributes()) assert.Equal(t, []attribute.KeyValue(nil), res.Attributes())
it := res.Iter() it := res.Iter()
@ -441,12 +441,12 @@ func TestNew(t *testing.T) {
assert.NoError(t, err) assert.NoError(t, err)
} }
require.EqualValues(t, tt.resourceValues, toMap(res)) require.Equal(t, tt.resourceValues, toMap(res))
// TODO: do we need to ensure that resource is never nil and eliminate the // TODO: do we need to ensure that resource is never nil and eliminate the
// following if? // following if?
if res != nil { if res != nil {
assert.EqualValues(t, tt.schemaURL, res.SchemaURL()) assert.Equal(t, tt.schemaURL, res.SchemaURL())
} }
}) })
} }
@ -482,7 +482,7 @@ func TestWithHostID(t *testing.T) {
) )
require.NoError(t, err) require.NoError(t, err)
require.EqualValues(t, map[string]string{ require.Equal(t, map[string]string{
"host.id": "f2c668b579780554f70f72a063dc0864", "host.id": "f2c668b579780554f70f72a063dc0864",
}, toMap(res)) }, toMap(res))
} }
@ -498,7 +498,7 @@ func TestWithHostIDError(t *testing.T) {
) )
assert.ErrorIs(t, err, assert.AnError) assert.ErrorIs(t, err, assert.AnError)
require.EqualValues(t, map[string]string{}, toMap(res)) require.Equal(t, map[string]string{}, toMap(res))
} }
func TestWithOSType(t *testing.T) { func TestWithOSType(t *testing.T) {
@ -512,7 +512,7 @@ func TestWithOSType(t *testing.T) {
) )
require.NoError(t, err) require.NoError(t, err)
require.EqualValues(t, map[string]string{ require.Equal(t, map[string]string{
"os.type": "linux", "os.type": "linux",
}, toMap(res)) }, toMap(res))
} }
@ -528,7 +528,7 @@ func TestWithOSDescription(t *testing.T) {
) )
require.NoError(t, err) require.NoError(t, err)
require.EqualValues(t, map[string]string{ require.Equal(t, map[string]string{
"os.description": "Test", "os.description": "Test",
}, toMap(res)) }, toMap(res))
} }
@ -544,7 +544,7 @@ func TestWithOS(t *testing.T) {
) )
require.NoError(t, err) require.NoError(t, err)
require.EqualValues(t, map[string]string{ require.Equal(t, map[string]string{
"os.type": "linux", "os.type": "linux",
"os.description": "Test", "os.description": "Test",
}, toMap(res)) }, toMap(res))
@ -559,7 +559,7 @@ func TestWithProcessPID(t *testing.T) {
) )
require.NoError(t, err) require.NoError(t, err)
require.EqualValues(t, map[string]string{ require.Equal(t, map[string]string{
"process.pid": fmt.Sprint(fakePID), "process.pid": fmt.Sprint(fakePID),
}, toMap(res)) }, toMap(res))
} }
@ -573,7 +573,7 @@ func TestWithProcessExecutableName(t *testing.T) {
) )
require.NoError(t, err) require.NoError(t, err)
require.EqualValues(t, map[string]string{ require.Equal(t, map[string]string{
"process.executable.name": fakeExecutableName, "process.executable.name": fakeExecutableName,
}, toMap(res)) }, toMap(res))
} }
@ -587,7 +587,7 @@ func TestWithProcessExecutablePath(t *testing.T) {
) )
require.NoError(t, err) require.NoError(t, err)
require.EqualValues(t, map[string]string{ require.Equal(t, map[string]string{
"process.executable.path": fakeExecutablePath, "process.executable.path": fakeExecutablePath,
}, toMap(res)) }, toMap(res))
} }
@ -602,7 +602,7 @@ func TestWithProcessCommandArgs(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
jsonCommandArgs, _ := json.Marshal(fakeCommandArgs) jsonCommandArgs, _ := json.Marshal(fakeCommandArgs)
require.EqualValues(t, map[string]string{ require.Equal(t, map[string]string{
"process.command_args": string(jsonCommandArgs), "process.command_args": string(jsonCommandArgs),
}, toMap(res)) }, toMap(res))
} }
@ -616,7 +616,7 @@ func TestWithProcessOwner(t *testing.T) {
) )
require.NoError(t, err) require.NoError(t, err)
require.EqualValues(t, map[string]string{ require.Equal(t, map[string]string{
"process.owner": fakeOwner, "process.owner": fakeOwner,
}, toMap(res)) }, toMap(res))
} }
@ -630,7 +630,7 @@ func TestWithProcessRuntimeName(t *testing.T) {
) )
require.NoError(t, err) require.NoError(t, err)
require.EqualValues(t, map[string]string{ require.Equal(t, map[string]string{
"process.runtime.name": fakeRuntimeName, "process.runtime.name": fakeRuntimeName,
}, toMap(res)) }, toMap(res))
} }
@ -644,7 +644,7 @@ func TestWithProcessRuntimeVersion(t *testing.T) {
) )
require.NoError(t, err) require.NoError(t, err)
require.EqualValues(t, map[string]string{ require.Equal(t, map[string]string{
"process.runtime.version": fakeRuntimeVersion, "process.runtime.version": fakeRuntimeVersion,
}, toMap(res)) }, toMap(res))
} }
@ -658,7 +658,7 @@ func TestWithProcessRuntimeDescription(t *testing.T) {
) )
require.NoError(t, err) require.NoError(t, err)
require.EqualValues(t, map[string]string{ require.Equal(t, map[string]string{
"process.runtime.description": fakeRuntimeDescription, "process.runtime.description": fakeRuntimeDescription,
}, toMap(res)) }, toMap(res))
} }
@ -673,7 +673,7 @@ func TestWithProcess(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
jsonCommandArgs, _ := json.Marshal(fakeCommandArgs) jsonCommandArgs, _ := json.Marshal(fakeCommandArgs)
require.EqualValues(t, map[string]string{ require.Equal(t, map[string]string{
"process.pid": fmt.Sprint(fakePID), "process.pid": fmt.Sprint(fakePID),
"process.executable.name": fakeExecutableName, "process.executable.name": fakeExecutableName,
"process.executable.path": fakeExecutablePath, "process.executable.path": fakeExecutablePath,

View File

@ -192,7 +192,7 @@ func TestSchemaURL(t *testing.T) {
// Verify that the SchemaURL of the constructed Tracer is correctly populated. // Verify that the SchemaURL of the constructed Tracer is correctly populated.
tracerStruct := tracerIface.(*tracer) tracerStruct := tracerIface.(*tracer)
assert.EqualValues(t, schemaURL, tracerStruct.instrumentationScope.SchemaURL) assert.Equal(t, schemaURL, tracerStruct.instrumentationScope.SchemaURL)
} }
func TestRegisterAfterShutdownWithoutProcessors(t *testing.T) { func TestRegisterAfterShutdownWithoutProcessors(t *testing.T) {

View File

@ -1583,7 +1583,7 @@ func TestReadOnlySpan(t *testing.T) {
assert.Equal(t, kv.Key, ro.Events()[0].Attributes[0].Key) assert.Equal(t, kv.Key, ro.Events()[0].Attributes[0].Key)
assert.Equal(t, kv.Value, ro.Events()[0].Attributes[0].Value) assert.Equal(t, kv.Value, ro.Events()[0].Attributes[0].Value)
assert.Equal(t, codes.Ok, ro.Status().Code) assert.Equal(t, codes.Ok, ro.Status().Code)
assert.Equal(t, "", ro.Status().Description) assert.Empty(t, ro.Status().Description)
assert.Equal(t, "ReadOnlySpan", ro.InstrumentationLibrary().Name) assert.Equal(t, "ReadOnlySpan", ro.InstrumentationLibrary().Name)
assert.Equal(t, "3", ro.InstrumentationLibrary().Version) assert.Equal(t, "3", ro.InstrumentationLibrary().Version)
assert.Equal(t, "ReadOnlySpan", ro.InstrumentationScope().Name) assert.Equal(t, "ReadOnlySpan", ro.InstrumentationScope().Name)

View File

@ -262,7 +262,7 @@ func TestRequiredHTTPPort(t *testing.T) {
} }
for _, test := range tests { for _, test := range tests {
got := requiredHTTPPort(test.https, test.port) got := requiredHTTPPort(test.https, test.port)
assert.Equal(t, test.want, got, test.https, test.port) assert.Equalf(t, test.want, got, "HTTP: %t, Port: %d", test.https, test.port)
} }
} }
@ -279,8 +279,8 @@ func TestFirstHostPort(t *testing.T) {
for _, src := range sources { for _, src := range sources {
h, p := firstHostPort(src...) h, p := firstHostPort(src...)
assert.Equal(t, host, h, src) assert.Equal(t, host, h, "%+v", src)
assert.Equal(t, port, p, src) assert.Equal(t, port, p, "%+v", src)
} }
} }

View File

@ -262,7 +262,7 @@ func TestRequiredHTTPPort(t *testing.T) {
} }
for _, test := range tests { for _, test := range tests {
got := requiredHTTPPort(test.https, test.port) got := requiredHTTPPort(test.https, test.port)
assert.Equal(t, test.want, got, test.https, test.port) assert.Equalf(t, test.want, got, "HTTP: %t, Port: %d", test.https, test.port)
} }
} }
@ -279,8 +279,8 @@ func TestFirstHostPort(t *testing.T) {
for _, src := range sources { for _, src := range sources {
h, p := firstHostPort(src...) h, p := firstHostPort(src...)
assert.Equal(t, host, h, src) assert.Equal(t, host, h, "%+v", src)
assert.Equal(t, port, p, src) assert.Equal(t, port, p, "%+v", src)
} }
} }

View File

@ -288,7 +288,7 @@ func TestRequiredHTTPPort(t *testing.T) {
} }
for _, test := range tests { for _, test := range tests {
got := requiredHTTPPort(test.https, test.port) got := requiredHTTPPort(test.https, test.port)
assert.Equal(t, test.want, got, test.https, test.port) assert.Equalf(t, test.want, got, "HTTP: %t, Port: %d", test.https, test.port)
} }
} }
@ -305,8 +305,8 @@ func TestFirstHostPort(t *testing.T) {
for _, src := range sources { for _, src := range sources {
h, p := firstHostPort(src...) h, p := firstHostPort(src...)
assert.Equal(t, host, h, src) assert.Equal(t, host, h, "%+v", src)
assert.Equal(t, port, p, src) assert.Equal(t, port, p, "%+v", src)
} }
} }

View File

@ -565,7 +565,7 @@ func TestTraceStateImmutable(t *testing.T) {
ts1, err := ts0.Insert(k1, v1) ts1, err := ts0.Insert(k1, v1)
require.NoError(t, err) require.NoError(t, err)
assert.Equal(t, v0, ts0.Get(k0)) assert.Equal(t, v0, ts0.Get(k0))
assert.Equal(t, "", ts0.Get(k1)) assert.Empty(t, ts0.Get(k1))
assert.Equal(t, v0, ts1.Get(k0)) assert.Equal(t, v0, ts1.Get(k0))
assert.Equal(t, v1, ts1.Get(k1)) assert.Equal(t, v1, ts1.Get(k1))
@ -574,7 +574,7 @@ func TestTraceStateImmutable(t *testing.T) {
ts2, err := ts1.Insert(k1, v2) ts2, err := ts1.Insert(k1, v2)
require.NoError(t, err) require.NoError(t, err)
assert.Equal(t, v0, ts0.Get(k0)) assert.Equal(t, v0, ts0.Get(k0))
assert.Equal(t, "", ts0.Get(k1)) assert.Empty(t, ts0.Get(k1))
assert.Equal(t, v0, ts1.Get(k0)) assert.Equal(t, v0, ts1.Get(k0))
assert.Equal(t, v1, ts1.Get(k1)) assert.Equal(t, v1, ts1.Get(k1))
assert.Equal(t, v0, ts2.Get(k0)) assert.Equal(t, v0, ts2.Get(k0))
@ -585,7 +585,7 @@ func TestTraceStateImmutable(t *testing.T) {
assert.Equal(t, v0, ts0.Get(k0)) assert.Equal(t, v0, ts0.Get(k0))
assert.Equal(t, v0, ts1.Get(k0)) assert.Equal(t, v0, ts1.Get(k0))
assert.Equal(t, v0, ts2.Get(k0)) assert.Equal(t, v0, ts2.Get(k0))
assert.Equal(t, "", ts3.Get(k0)) assert.Empty(t, ts3.Get(k0))
} }
func BenchmarkParseTraceState(b *testing.B) { func BenchmarkParseTraceState(b *testing.B) {