Olical / cljs-test-runner

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

Dynamically add gen-path to classloader #31

Closed mfikes closed 5 years ago

mfikes commented 5 years ago

Fixes #30

mfikes commented 5 years ago

@Olical The way this works is that it steals the approach used by add-lib to dynamically add code to the classpath.

add-loader-url comes from here originally https://github.com/clojure/tools.deps.alpha/blob/e160f184f051f120014244679831a9bccb37c9de/src/main/clojure/clojure/tools/deps/alpha/repl.clj#L22

And the bit of code that ensures that the correct class loader at play is from here https://github.com/mfikes/clojurescript/commit/d68c9397599366777d9b322ec586fdd398302f25#diff-2c521d7ba435fbef7d128f4295f86785R611

The PR removes the gotcha warning, as well as the extra instructions regarding manually adding to :paths in deps.edn.

I successfully tested this locally, but I think I must have an older clone of cljs-test-runner (and thus the conflicts). Let me update and try again with a revision to this PR to consider.

mfikes commented 5 years ago

OK. Rebaselined against master. Going to re-test to ensure all is OK.

mfikes commented 5 years ago

OK @Olical, I've re-tested locally after having resolved merge conflicts and all appears to be OK.

This PR is ready for review.

Olical commented 5 years ago

This is great, thank you very much! I've got a bus ride to my parents right now so I'll give it a whirl and merge if it looks good. Thank you so much for lending your expertise to fix this.

Olical commented 5 years ago

It worked! :tada:

I altered the readme to put the advanced compilation section above the gotchas on it's own now but that's all. It's no longer a gotcha, just a tip. Thanks for removing the part about the weird bug though. I guess it didn't fix simple or whitespace... will try though.

Olical commented 5 years ago

Oh, it looks like you fixed the whitespace and simple errors too... I don't fully understand why this fixes it but I'm very happy about it!

Olical commented 5 years ago

Hmm, okay, :whitespace still just ends with a non-zero exit code, you accidentally fixed :simple though :sweat_smile: