You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moving generated code under internal/metadata generally seems preferable to me, as it allows other generated code to depend on it. As it is currently generated, it lives in a component's top-level directory.
However, this results in an unintended consequence. Since generated_component_telemetry_test.go is a test file, it won't be compiled as part of its package, so another package depending on it won't have access to its methods. In the case of the sample receiver, the metrics_test.go file wouldn't have access to SetupTestTelemetry if generated_component_telemetry_test.go was under internal/metadata.
We have a couple of options:
Rename generated_component_telemetry_test.go to no longer be a test file, something like generated_telemetry_test_helper.go.
Create a new package under internal/metadata that includes test helpers, named something like telemetrytest. The file could then be moved there without the _test.go suffix and referenced in tests.
Alternative
The result of leaving it in its current location is that we need to add generated telemetry tests to a component's top-level directory alongside generated_component_telemetry_test.go, which may add more clutter to components.
The text was updated successfully, but these errors were encountered:
Request
Originally suggested here, related to #10801.
Moving generated code under
internal/metadata
generally seems preferable to me, as it allows other generated code to depend on it. As it is currently generated, it lives in a component's top-level directory.However, this results in an unintended consequence. Since
generated_component_telemetry_test.go
is a test file, it won't be compiled as part of its package, so another package depending on it won't have access to its methods. In the case of the sample receiver, themetrics_test.go
file wouldn't have access toSetupTestTelemetry
ifgenerated_component_telemetry_test.go
was underinternal/metadata
.We have a couple of options:
generated_component_telemetry_test.go
to no longer be a test file, something likegenerated_telemetry_test_helper.go
.internal/metadata
that includes test helpers, named something liketelemetrytest
. The file could then be moved there without the_test.go
suffix and referenced in tests.Alternative
The result of leaving it in its current location is that we need to add generated telemetry tests to a component's top-level directory alongside
generated_component_telemetry_test.go
, which may add more clutter to components.The text was updated successfully, but these errors were encountered: