Skip to content

Otel TracerProvider Embedding hard to auto-mock. #1130

@rbtcollins

Description

@rbtcollins

Description

There is a marker interface 'embedded.TracerProvider' with unexported methods https://pkg.go.dev/go.opentelemetry.io/otel/trace/embedded#TracerProvider

With a testify style mock, the Mock does not implement otel.trace.TracerProvider unless the generated code is edited to add that same embedded interface.

Perhaps there is another way of doing it; I'm not sure, but I thought you'd like to know :>

Having some way to add some code to the generated mock struct definition would perhaps be enough to solve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions