Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate watcher interactions #7

Closed
novemberborn opened this issue Jan 27, 2020 · 4 comments · Fixed by #11
Closed

Investigate watcher interactions #7

novemberborn opened this issue Jan 27, 2020 · 4 comments · Fixed by #11
Labels
bug Something isn't working

Comments

@novemberborn
Copy link
Member

AVA's watcher may be watching both source files and the TypeScript build output. It must watch the source files, otherwise it won't know to rerun tests. But there's no point in rerunning tests until the build output has changed.

Delaying the watcher may work but this is not configurable. Perhaps if the watcher could figure out it should wait for a rewritten path to be updated too that may work. It'll require changes to how AVA and this package interact.

@novemberborn novemberborn added the bug Something isn't working label Jan 27, 2020
@novemberborn
Copy link
Member Author

Worse, of course, is that this breaks dependency tracking in the watcher. The loaded files will be from the build output, so AVA doesn't realize build files are dependencies of test files.

If AVA could perform the path rewrites (or maybe invert them), it could track dependencies correctly.

Combine that with knowing to wait for the build output of a specific test file to change and we're close to having a functional watcher again.

Users should then configure AVA to ignore non-test file updates of sources, so that it's purely watching the build output.

@novemberborn novemberborn pinned this issue Jan 27, 2020
@jaapz
Copy link

jaapz commented Jan 28, 2020

I think it would be nice if ava would use the watcher on the actual test files to decide which test to rerun, but only rerun those once the build files have also actually changed. That would be the result I would expect (even though all tests are technically rebuilt).

Currently the --watch flag with precompiled builds is not very useful.

Maybe ava could even have support for executing the precompilation step?

@novemberborn
Copy link
Member Author

I think it would be nice if ava would use the watcher on the actual test files to decide which test to rerun, but only rerun those once the build files have also actually changed. That would be the result I would expect (even though all tests are technically rebuilt).

Yes, that's what this issue is about.

Maybe ava could even have support for executing the precompilation step?

See #3.

novemberborn added a commit that referenced this issue Feb 2, 2020
Have the watcher ignore changes to the original TypeScript source files.
This way, the watcher will only react to changes to the TypeScript build
output.

Allow the watcher to resolve the rewritten path of a test file, so it
can track it as a dependency of the original TypeScript source file.
This way, when the build output changes, the watcher knows to re-run the
original test file.

Update file patterns to ignore *.d.ts files, as well as any files in the
build output.

Updated the ignored-by-watcher patterns to ignore source map files from
the build output.

Fixes #10, #7, #9.
novemberborn added a commit that referenced this issue Feb 2, 2020
Have the watcher ignore changes to the original TypeScript source files.
This way, the watcher will only react to changes to the TypeScript build
output.

Allow the watcher to resolve the rewritten path of a test file, so it
can track it as a dependency of the original TypeScript source file.
This way, when the build output changes, the watcher knows to re-run the
original test file.

Update file patterns to ignore *.d.ts files, as well as any files in the
build output.

Updated the ignored-by-watcher patterns to ignore source map files from
the build output.

Fixes #10, #7, #9.
@novemberborn novemberborn linked a pull request Feb 2, 2020 that will close this issue
@novemberborn
Copy link
Member Author

Fixed by #11.

@novemberborn novemberborn unpinned this issue Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants