Skip to content
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9ef6a15
Autogenerate config marshal and unmarshal test with datagen
iblancasa Feb 16, 2026
b9452a6
Merge branch 'main' into 12906
iblancasa Feb 17, 2026
39af7ee
Merge branch 'main' into 12906
iblancasa Feb 18, 2026
13a528d
Merge branch '12906' of github.com:iblancasa/opentelemetry-collector …
iblancasa Feb 19, 2026
39c50e9
Run gomod
iblancasa Feb 19, 2026
a367539
Merge branch 'main' into 12906
iblancasa Feb 19, 2026
7cc30c7
Merge branch '12906' of github.com:iblancasa/opentelemetry-collector …
iblancasa Feb 19, 2026
ca2f52b
Fix changelog
iblancasa Feb 19, 2026
d930bcb
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
iblancasa Feb 20, 2026
34f0584
Apply changes requested in code review
iblancasa Feb 20, 2026
d939516
Fix ci
iblancasa Feb 20, 2026
d85a822
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
iblancasa Feb 23, 2026
f155b20
Fix ci
iblancasa Feb 23, 2026
73660b9
Fix ci
iblancasa Feb 23, 2026
726b168
Merge branch 'main' into 12906
iblancasa Feb 23, 2026
962eea8
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
iblancasa Feb 26, 2026
c27239c
Merge branch 'main' into 12906
iblancasa Feb 26, 2026
b98a8d5
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
iblancasa Mar 16, 2026
a0f3586
Merge branch '12906' of github.com:iblancasa/opentelemetry-collector …
iblancasa Mar 16, 2026
8930428
Fix ci
iblancasa Mar 16, 2026
3503841
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
iblancasa Mar 18, 2026
176b109
Fix ci
iblancasa Mar 18, 2026
36d4e4c
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
iblancasa Mar 31, 2026
ced8450
Fix gotidy
iblancasa Mar 31, 2026
9b48ed1
Merge remote-tracking branch 'upstream/main' into 12906
iblancasa Apr 23, 2026
29d09fd
Merge branch 'main' into 12906
iblancasa Apr 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .chloggen/12906.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. receiver/otlp)
component: cmd/mdatagen

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Add generated config marshal/unmarshal tests to mdatagen"

# One or more tracking issues or pull requests related to the change
issues: [12906]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
2 changes: 1 addition & 1 deletion .chloggen/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ components:
- extension/xextension
- extension/zpages
- pdata/pprofile
- pdata/xpdata
- pkg/config/configauth
- pkg/config/configcompression
- pkg/config/configgrpc
Expand All @@ -50,6 +49,7 @@ components:
- pkg/xconnector
- pkg/xexporter
- pkg/xexporterhelper
- pkg/xpdata
- pkg/xprocessor
- pkg/xreceiver
- pkg/xscraper
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions cmd/mdatagen/internal/samplescraper/generated_component_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions cmd/mdatagen/internal/templates/component_test.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package {{ .Package }}

import (
"encoding/json"
{{- if not (and .Tests.SkipLifecycle .Tests.SkipShutdown) }}
"context"
{{- end }}
Expand All @@ -18,6 +19,7 @@ import (
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/confmap"
{{- if not (and .Tests.SkipLifecycle .Tests.SkipShutdown) }}
"go.opentelemetry.io/collector/confmap/confmaptest"
{{- if isExporter }}
Expand Down Expand Up @@ -58,6 +60,7 @@ import (
"go.opentelemetry.io/collector/pdata/ptrace"
{{- end }}
{{- end }}
"go.yaml.in/yaml/v3"
)

var typ = component.MustNewType("{{ .Type }}")
Expand All @@ -70,6 +73,21 @@ func TestComponentConfigStruct(t *testing.T) {
require.NoError(t, componenttest.CheckConfigStruct(NewFactory().CreateDefaultConfig()))
}

func TestComponentConfigMarshal(t *testing.T) {
cfg := NewFactory().CreateDefaultConfig()
cm := confmap.New()
require.NoError(t, cm.Marshal(cfg))

data := cm.ToStringMap()
_, err := yaml.Marshal(data)
require.NoError(t, err)
_, err = json.Marshal(data)
require.NoError(t, err)

roundTrip := NewFactory().CreateDefaultConfig()
Comment thread
iblancasa marked this conversation as resolved.
require.NoError(t, cm.Unmarshal(&roundTrip))
}

{{ if not (and .Tests.SkipLifecycle .Tests.SkipShutdown) -}}
{{ if isExporter -}}
func TestComponentLifecycle(t *testing.T) {
Expand Down
19 changes: 19 additions & 0 deletions cmd/mdatagen/internal/testdata/generated_component_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions connector/forwardconnector/generated_component_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion connector/forwardconnector/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ require (
go.opentelemetry.io/collector/pipeline v1.52.0
go.opentelemetry.io/collector/pipeline/xpipeline v0.146.1
go.uber.org/goleak v1.3.0
go.yaml.in/yaml/v3 v3.0.4
)

require (
Expand Down Expand Up @@ -49,7 +50,6 @@ require (
go.opentelemetry.io/otel/trace v1.40.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.1 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/sys v0.40.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Expand Down
Loading
Loading