Skip to content

Commit f38b0e1

Browse files
authored
[cmd/mdatagen] fix #12298 unit tests failures (#12523)
Fixes #12298 Inspired by #12477, but looks like that PR is hard to pass queue merge. Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
1 parent dc62746 commit f38b0e1

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

.chloggen/fix-12298.yaml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: bug_fix
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
7+
component: mdatagen
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Fix broken imports in the generated files.
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [12298]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# Optional: The change log or logs in which this entry should be included.
21+
# e.g. '[user]' or '[user, api]'
22+
# Include 'user' if the change is relevant to end users.
23+
# Include 'api' if there is a change to a library API.
24+
# Default: '[user]'
25+
change_logs: [api]

cmd/mdatagen/internal/templates/component_test.go.tmpl

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import (
3535
"go.opentelemetry.io/collector/receiver/receivertest"
3636
{{- end }}
3737
{{- if isScraper }}
38-
"go.opentelemetry.io/collector/consumer/consumertest"
3938
"go.opentelemetry.io/collector/scraper"
4039
"go.opentelemetry.io/collector/scraper/scrapertest"
4140
{{- end }}

cmd/mdatagen/internal/templates/telemetrytest.go.tmpl

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
package {{ .Package }}test
44

55
import (
6-
"context"
76
"testing"
87

98
"github.com/stretchr/testify/require"

cmd/mdatagen/internal/templates/telemetrytest_test.go.tmpl

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
package {{ .Package }}test
44

55
import (
6-
"context"
6+
"context"
77
"testing"
88

99
"github.com/stretchr/testify/require"
10+
"go.opentelemetry.io/otel/metric"
1011
"go.opentelemetry.io/otel/sdk/metric/metricdata"
1112
"go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest"
1213

13-
"go.opentelemetry.io/collector/component/componenttest"
14+
"go.opentelemetry.io/collector/component/componenttest"
1415
)
1516

1617
func TestSetupTelemetry(t *testing.T) {

0 commit comments

Comments
 (0)