Skip to content
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

add host.id to resource auto-detection #3812

Merged
merged 12 commits into from
Mar 21, 2023
Prev Previous commit
Next Next commit
return assert.AnError from mockHostIDProviderWithError
  • Loading branch information
mwear committed Mar 8, 2023
commit 0260501d9f5bf2286441639b7466ab627c6aa89e
5 changes: 2 additions & 3 deletions sdk/resource/host_id_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package resource_test

import (
"errors"
"github.com/stretchr/testify/assert"

"go.opentelemetry.io/otel/sdk/resource"
)
Expand All @@ -28,8 +28,7 @@ func mockHostIDProvider() {

func mockHostIDProviderWithError() {
resource.SetHostIDProvider(
// TODO: After #3844 merges, return assert.AnError and update tests in `resource_test.go`.
func() (string, error) { return "", errors.New("not found") },
func() (string, error) { return "", assert.AnError },
)
}

Expand Down
1 change: 1 addition & 0 deletions sdk/resource/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ func TestWithHostIDError(t *testing.T) {
)

require.Error(t, err)
MrAlias marked this conversation as resolved.
Show resolved Hide resolved
assert.True(t, errors.Is(err, assert.AnError))
require.EqualValues(t, map[string]string{}, toMap(res))
}

Expand Down