Skip to content

[cmd/mdatagen] Mdatagen generates faulty test code #10866

@SamerJ

Description

@SamerJ

Describe the bug

Having a metadata.yaml file with disabled tests (lifecycle & shutdown), generates faulty code.
We end up with an unused import in the go test file generated_component_test.go
The specific unused import is go.opentelemetry.io/collector/confmap/confmaptest

Steps to reproduce
Any mdata yaml file with both skip_lifecycle and skip_shutdown set to true

What version did you use?
Latest (v0.107.0)

What config did you use?

type: foo
scope_name: foo

tests:
skip_lifecycle: true
skip_shutdown: true

status:
class: processor
stability:
alpha: [metrics]
distributions:
- contrib
codeowners:
active: [name]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions