-
Notifications
You must be signed in to change notification settings - Fork 35
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
in use with tests #76
Comments
The runner namespace doesn't depend on the test namespaces. When a test namespace is changed, only the dependent namespaces are recompiled and as runner ns is not such, it is not reloaded. This is the way incremental compilation is implemented in ClojureScript compiler. You could check how the compiler works by compiling the same project with cljs.jar and using cljs.compiler.api/watch. To fix this you should require all the test namespaces in the runner ns. |
Please reopen or create another issue if this doesn't fix this. |
Sorry for leaving this dangling. Including the tests specifically in the runner fixes the problem, although in an inconvenient manner. I'll keep thinking and come up with a better solution. |
Due to how ClojureScript compiler works, and how boot-reload leverages it, this is not easy thing to solve. The compiler depends on static dependency information to select which namespaces and in which order to compile, and boot-reload completely depends on that. Check https://github.com/crisptrutski/boot-cljs-test. It is not perfect, and doesn't really solve this problem yet but there are two issues related to this: crisptrutski/boot-cljs-test#40 crisptrutski/boot-cljs-test#7 |
I'm trying to pinpoint the issue I'm having here, and was wondering if anyone has experience with something similar? I feel like the root of my problems is that boot-reload might be caching something that it ought not to be.
I'm running a cljs.test suite that serves up
test.html
where my namespaces are loaded via the following:And I'm using the boot hook for reloading as follows:
(reload :on-jsload 'testing-util.runner/rerun)
. This simply invokes the following inside of my testing util:Now, here's the weird part. When I run the boot environment the first time, no tests are run. Even if I save a test file and see the reload message in a
console.log
, no tests are run. It's not until I save mytesting_util/runner.cljs
do I actually get any tests to run. Here is the reload message I get when saving the runner:After a safe of the runner, suddenly all my tests namespaced
*-test
are run. Similarly, if I comment out a complete(deftest ...)
block, then save that file- the tests are run as if I didn't comment out the block at all.The reload looks like:
What's more confusing, though, is if I change a test to fail, then save the test file, it will fail as expected. So it seems like there are some namespaces being overwritten, but only some of the time, and I can't figure out the secret sauce. Is this aggressive caching that's causing the issue? Is it namespaces not being properly reloaded that need to (something to do with the
run-all-tests
macro)?The text was updated successfully, but these errors were encountered: