Closed axaysagathiya closed 4 months ago
Investigation:
Conclusion:
To test a subsystem, we need to run that subsystem and be able to mock the behaviour of the overseer.
We have an Overseer
interface, which we can implement, a mockable overseer, and other helper methods that help set the expected/mock behaviour for the overseer.
We can have helper methods of a mocked overseer that can handle messages coming from a subsystem instead of forwarding them to other subsystems.
Any interaction that is supposed to happen with any other subsystem other than the one being tested will be mocked. We can have a method that sets an action for a given message received from the subsystem being tested. This is similar to how we can add mock behaviour in gomock.
To mockable overseer, we will be telling explicitly what behaviour we want, using say SetActionForAMessage
. To a subsystem that is being tested, there is no other difference between a mockable overseer and a fully implemented overseer.
My implementation of mock overseer is here https://github.com/ChainSafe/gossamer/pull/4069
Issue summary
Acceptance criteria's or Outcomes