Olical / cljs-test-runner

Discover and run your ClojureScript tests
https://clojars.org/olical/cljs-test-runner
The Unlicense
85 stars 16 forks source link

-c option and optimizations problem #16

Closed henryw374 closed 5 years ago

henryw374 commented 5 years ago

Hi, when using the -c option. and when the opts file passed to that contains e.g. :optimizations :advanced or whitespace, or simple, no tests are run. Setting it to :none does work though.

Any ideas?

Thanks, Henry

Olical commented 5 years ago

So I guess this is because advanced optimisations mangle all of the names and maybe test code get's cut out because it's not called directly. Why are you running tests with advanced optimisations anyway? Just to make sure it works?

I think this would require some extern files or something to stop Closure Compiler from mangling the code and deleting things that are actually required.

henryw374 commented 5 years ago

Ok, thanks for the info. Yes, basically I've taken to having a build that involves running code with the same optimization level it'll have in production.

On Fri, 19 Oct 2018, 13:05 Oliver Caldwell, notifications@github.com wrote:

So I guess this is because advanced optimisations mangle all of the names and maybe test code get's cut out because it's not called directly. Why are you running tests with advanced optimisations anyway? Just to make sure it works?

I think this would require some extern files or something to stop Closure Compiler from mangling the code and deleting things that are actually required.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Olical/cljs-test-runner/issues/16#issuecomment-431340862, or mute the thread https://github.com/notifications/unsubscribe-auth/AC7ZDHfkJGQBZip6H70cbGXKe7d1QxjAks5umcAWgaJpZM4Xt4vf .

Olical commented 5 years ago

So this should be fixed in 3.1.0, let me know what you think! It has the following caveat where cljs-test-runner-out/gen needs to be on the path, but that's all. https://github.com/Olical/cljs-test-runner#advanced-compilation

Seems to work well for me when switching between :none and :advanced a lot. I hope this helps :smiley:

Olical commented 5 years ago

Seems to still behave weirdly for :whitespace and maybe things like foreign libs are a bit messed up. It's better but maybe not fixed.

henryw374 commented 5 years ago

Thanks.

Whitespace aside, the project I was trying it out on has some issues I've got to fix first (relating to the external lib)... once that's sorted out I'll give this a go.

On Tue, Oct 23, 2018 at 9:11 AM Oliver Caldwell notifications@github.com wrote:

Seems to still behave weirdly for :whitespace and maybe things like foreign libs are a bit messed up. It's better but maybe not fixed.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Olical/cljs-test-runner/issues/16#issuecomment-432142372, or mute the thread https://github.com/notifications/unsubscribe-auth/AC7ZDNPZejZR751WqG4R1Xak-MST1aKTks5uns8-gaJpZM4Xt4vf .

-- @henryw374

henryw374 commented 5 years ago

Hey, :optimizations :advanced is working fine for me now. creating the directory before running etc not a problem.

I'll leave the issue for you to close in case you're addressing :whitespace but it's not an issue for me.

Thanks

Olical commented 5 years ago

I might take another look soon, but if I can't work it out I might just mark it as a known issue. I'm really confused by it, I can understand "no optimisations" and "optimisations" behaving differently. But I would expect once any level of optimisations works, especially advanced, all of the rest will work fine too.

Olical commented 5 years ago

It looks like #31 has it working fine for :none, :simple and :advanced. :whitespace is still a bit wonky for some reason, seems a lot better though! (sorry to bump a dead thread, just thought this might be useful information for future googlers)