chore(unit tests): Leverage existing topology logic for unit test internals (#10540)
* Checkpoint commit * Checkpoint working iteration * Refactor and add build_unit_test_sources skeleton * Refactor logic to build unit test sources * Refactor build test sinks * Refactor sink to check conditions * Remove some legacy code * Refactor to use UnitTestSinkResult * Handle test input errors * Implement function to find leaf components * Wire up topology disconnect error * Fix condition checking and pass success tests * Refactor sanitizing original config to pass route test * Raise error on no events received * Pass several more tests * Refactor such that a source and sink is attached to each transform * Remove unnecessary code and format * Reorganize module * Fix issues with route and topology connection tests * Pass all existing tests * Change unit_test.rs to mod.rs * Quite info logs for test cmd * Add unit test for branched transform * Add test for task transform with multiple inputs * Move tests into separate file * Remove unused graph unchecked constructor * Turn topology disconnect error into runtime error * Remove inspections * Wire up diagnostic output for failed conditions * Refactor unit test construction using metadata struct * Refactor unit test run output * Fix clippy errors * Remove unnecessary file from rebase mishap * Remove unused test file * Clean up comments and unnecessary code * Reword route comment to expanded transform * Add comment regarding shutdown trigger in unit test source * Fix formatting * Move build_inputs into hydrate source to avoid misuse * Move build output into hydrate sinks to avoid misuse * Use uuid for unit test component ids * Add behavior tests for branching and task style transforms * Fix formatting in new tests * Simplify configuration input sanitizing logic * Limit sources and sinks based on inputs/ouputs Though adding a source and sink to every transform allows us to trivially create valid topologies, doing so also has a significant performance impact on tests involving large configs. Thus, we switch to a more complex but performant method of adding sources and sinks only where necessary, walking the topology to trim any unnecessary components. * Add new error message for disconnected topology * Update outdated comment * Refactor paths_to_sink_from and add corresponding tests * Remove unnecessary clone * Remove ConfigDiff field in unit test struct * Add support for glob inputs
W
Will committed
34119d10bda05f1da829adea7eed18fee68359d2
Parent: 86548fd
Committed by GitHub <noreply@github.com>
on 1/4/2022, 6:27:13 PM