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)
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_FakeShipperbut 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 toManager.connectShippers,comp.ShipperSpecis non-nil. However, in a real configuration,comp.ShipperSpecshould only be non-nil for the shipper itself, and should be nil for its inputs (the testif comp.ShipperSpec != nilis 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)