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

Possible to use cljs-test-runner on core.rrb-vector library? #34

Closed jafingerhut closed 5 years ago

jafingerhut commented 5 years ago

I have made some changes to a local copy of the core.rrb-vector library, in particular the ClojureScript implementation of it, and tried using cljs-test-runner to run some tests that I have locally changed to attempt to use clojure.test deftest/is/are/etc.

When I tried to run the tests using cljs-test-runner, it kept failing to compiler an older version of one of the core.rrb-vector source files. After scratching my head wondering how that could happen, since the old version wasn't in my source tree, I realized that doo depends upon fipp, which uses core.rrb-vector version 0.0.11.

Is this simply an issue of conflicting dependency versions, and I shouldn't be trying to use cljs-test-runner for running core.rrb-vector library tests?

jafingerhut commented 5 years ago

I have not tested this, but it seems that perhaps any project that has a different version of core.rrb-vector, fipp, or any other library in cljs-test-runner's list of dependencies might lead to an issue where the version of the library compiled could be different than the one of the project being tested?

If that is so, 'shading' is a technique that can be used by tools like cljs-test-runner to avoid the conflict. There is a library called MrAnderson https://github.com/benedekfazekas/mranderson that can be used to help automate the shading process, but I do not know if it would work for cljs-test-runner and how it uses ClojureScript.

Olical commented 5 years ago

Ah, that's annoying, sorry about that! So I could probably get it working with mranderson but I'd need to use it through Clojure CLI as opposed to lein. I did that in Conjure but as a sort of pre-compile step :thinking:

If you're using lein it should be really easy to include cljs-test-runner via mranderson, if not maybe I can take a look at mrandersoning the project soon. It wouldn't be for a little while though, I've got quite a bit on my plate right now :grimacing:

jafingerhut commented 5 years ago

I had not thought of using mranderson myself on cljs-test-runner.

After creating this issue I realized I can create a single fairly simple deps.edn alias for running all tests that currently exist in the project, because right now there is only one test namespace in the project, so auto-gathering those does not give much help, at least right now. Thus I feel fairly low motivation to try out mranderson in order to use cljs-test-runner for it. It is also the reason why there is certainly no rush to make changes to cljs-test-runner just because of my request. In fact, if the problem is limited to only core.rrb-vector and the handful of libs that cljs-test-runner depends upon, it seems very low priority. You might want to wait for confirmation (or try out a test yourself) to see if the problem exists if the project using cljs-test-runner depends upon anything in common with it, the most likely being fipp.

Olical commented 5 years ago

I think this is okay and I'm going to close it for now accepting the risk. I think MrAndersonifying everything is one option (but I'd rather avoid the work if I can with so many other things on my plate right now), the alternative is to get doo etc updated to a newer version.

I'll close this but revist it if it appears again in other contexts. Thanks for the detailed report and help!

jafingerhut commented 5 years ago

If it actually does cause conflicts with different versions, not that one of the fun things about doo/cljs-test-runner being a tool, and being widely used by many projects, is that it might not matter what version of the dependency you or doo use -- it will always be different than the version used by some projects.