Skip to content

Commit

Permalink
return assert.AnError from mockHostIDProviderWithError
Browse files Browse the repository at this point in the history
  • Loading branch information
mwear committed Mar 8, 2023
1 parent 8f6b557 commit f850251
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sdk/resource/host_id_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
package resource_test

import (
"errors"

"github.com/stretchr/testify/assert"
"go.opentelemetry.io/otel/sdk/resource"
)

Expand All @@ -28,8 +27,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)
assert.True(t, errors.Is(err, assert.AnError))
require.EqualValues(t, map[string]string{}, toMap(res))
}

Expand Down

0 comments on commit f850251

Please sign in to comment.