This is related to the question I asked here:
but taking a different approach. One of the unit test runners that I’m integrating into my plugin has a --watch argument that allows it to monitor source files for changes and rerun tests automatically, streaming structured results each time to the consumer. By using this approach, it takes advantage of incremental recompilation of the source files and is therefore significantly faster than restarting test execution from scratch (in large projects, it could be the differences between minutes and a small number of seconds).
I actually have it working overall, but the issue is that when the subsequent test runs occur, I’m not sure how to reset the existing test results.
Obviously the unit test framework is based on message passing via ServiceMessageBuilder, so I’m wondering if there’s some message I can send to it to reset its internal state before I call things like testSuiteStarted and testStarted again for the tests that are being re-executed by the watcher process.
My fallback plan would be to start a new unit test process attached to the same watcher process, but that hand-off might be a bit tricky.
Any thoughts are greatly appreciated.