Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shipper configuration tests are run against invalid configurations #2147

Closed
Tracked by #16
faec opened this issue Jan 19, 2023 · 1 comment
Closed
Tracked by #16

Shipper configuration tests are run against invalid configurations #2147

faec opened this issue Jan 19, 2023 · 1 comment
Assignees
Labels
bug Something isn't working Team:Elastic-Agent Label for the Agent team

Comments

@faec
Copy link
Contributor

faec commented Jan 19, 2023

The Agent tests that construct fake shippers / inputs and their configurations are, at least in some cases, verifying the output configurations against incorrect or impossible inputs, such that the real code paths aren't being exercised. The problem was first observed in TestManager_FakeShipper but may apply to other contexts.

I haven't pinned down the exact mechanism of failure yet since these tests are pretty large and involve a lot of setup / mocked elements, but one visible consequence is: when an input unit configuration (unit.Type() == client.UnitTypeInput) is generated and passed through to Manager.connectShippers, comp.ShipperSpec is non-nil. However, in a real configuration, comp.ShipperSpec should only be non-nil for the shipper itself, and should be nil for its inputs (the test if comp.ShipperSpec != nil is used to recognize a shipper unit as opposed to an input). In consequence, any tests that rely on distinguishing shipper and input units during initialization will receive the wrong metadata, and that is what ends up being tested rather than the intended unit types.

(Problem was discovered in the context of this pending PR)

@faec faec added bug Something isn't working Team:Elastic-Agent Label for the Agent team labels Jan 19, 2023
@jlind23
Copy link
Contributor

jlind23 commented Jun 5, 2024

The shipper project has been revisited hence closing this as outdated/not relevant.

@jlind23 jlind23 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

No branches or pull requests

2 participants