Skip to content

Commit b498a99

Browse files
sincejunemalus2077
authored andcommitted
[chore][mdatagen] Fix failed tests when there are no enabled events b… (open-telemetry#13121)
…y default <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Sometimes, we want all events to be disabled by default, allowing users to enable them manually. This approach can be helpful in such cases. <!--Please delete paragraphs that you did not use before submitting.-->
1 parent cc9290a commit b498a99

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_logs_test.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func TestLogsBuilder(t *testing.T) {
215215
{{- end }}
216216
logs := lb.Emit(WithLogsResource(res))
217217

218-
if tt.expectEmpty {
218+
if tt.expectEmpty || ((tt.name == "default" || tt.name == "filter_set_include") && defaultEventsCount == 0) {
219219
assert.Equal(t, 0, logs.ResourceLogs().Len())
220220
return
221221
}

0 commit comments

Comments
 (0)