Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reset the strategy registry on each run
These conditions ... - the pipeline reconciler is constructed in TestMain; - the test setup appends the mock strategy to the reconciler's strategies; - the mock strategy operates on values in its closure; - the first strategy answering `true` to Handle(...) will be used; ... all together mean that when you run the test case more than once, it will end up running the mock strategy on apps that aren't used any more. We decided earlier that replacing the whole set of strategies broke encapsulation too much; but, I think it may be the simplest way to make the test repeatable. These are alternatives I considered: - construct the reconciler anew for each test case (drags in the manager, then other things ...); - have a `Reset` method for the strategies (I don't like exporting methods just for testing); - refer to the app values indirectly, e.g., by having the mock strategy refer to a func which is re-assigned, rather than inlining it (would have to ensure the mock is installed once, but the func is reassigned -- awkward) Signed-off-by: Michael Bridgen <[email protected]>
- Loading branch information