fix: use watch strategy #236
NB: Fixes #232
NB: submitting this for a gut-check / as a proof of concept. There's a lot of style / cleanup work that needs to be done before this is ready for a line-by-line.
Motivation and Context
Let's say you're a new developer working on Polly. You check out the repo, install deps and run
This is a development pain point for the following reasons:
While this required a lot of trial and error, the changes are actually fairly contained:
Tradeoffs, deficiencies and future work
As implemented, this requires developers to manually kick off watch, see when it settles and then start testem. I personally prefer this approach, but I suspect something more streamlined will be required. So, I'd propose the following:
Types of Changes
I believe the quickest win is to disable testem's watcher option by default. I noticed awhile ago that the tests would re-execute midway through a test run and have long suspect it was because of
This morning I found when
When disabled, I see a noticeable speed improvement at the the cost of the developer experience in having to hit
@jasonmit Hey Jason -- appreciate the response & detective work. I agree that in the very short term, looking at the watch behavior will make the development experience much more pleasant.
However, I'm eager to clean up and merge this PR since using a watch strategy means that for repeated test runs (e.g. when you're TDDing) you only re-build the changed files, cutting even that ~22s down to a second or so.
@agraves looking forward to seeing this land. Let me know if there's anything I can help with.
Looks like it's currently dead code. I don't see anything importing it so we'll need to look into resolving that. I'd be fine tackling this separately since it's an existing issue.
Ok guys -- @jasonmit et al -- think this is ready for review.
As mentioned elsewhere, this supports two workflows. There's the existing
This now adds a second workflow, where you
Personally I like the explicit nature of that workflow (and the simplicity of its implementation) but I'm open to adding other workflows as well.
The build experience is much better!
Some things I need we need are a helpful error message explaining to run a build (
I also think we need to add a section to the README or contributor section explaining this setup before merging.
@jasonmit Ok, pushing out some fixes for this now. Here are the key changes: