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

Fix test running with something other than :none optmisations #17

Merged
merged 5 commits into from
Oct 22, 2018

Conversation

Olical
Copy link
Owner

@Olical Olical commented Oct 19, 2018

Yes, "optimisations" not "optimizations"

Glares in British 🇬🇧

@Olical
Copy link
Owner Author

Olical commented Oct 19, 2018

This is for fixing #16, I hope I can find a solution. When you run with :advanced (or anything that isn't :none) you currently get No file for namespace gen.test-runner exists.

So clearly the namespace resolution is totally different as soon as you enable optimisations. My hunch is that the generated .cljs file needs to be in a specific path. Maybe it needs to be on the PATH?

@Olical
Copy link
Owner Author

Olical commented Oct 19, 2018

So, progress. If you want to use any optimisation level other than :none you must:

  • Add cljs-test-runner-out to your path so the compiler can find the gen.test-runner namespace.
  • Ensure that the cljs-test-runner-out directory exists before running the program otherwise I think the JVM drops the path from the path list.

This should be enough to get it to run but it seems like it only works the first time. On the second run it complains about not being able to find the test namespaces which is pretty weird. Using advanced compilation seems to change a lot about the build cycle, maybe we can't get around this?

Maybe since this is sort of an edge case these caveats are okay and they just need documenting? If you ran rm -rf cljs-test-runner-out && mkdir cljs-test-runner-out before each run I think it'd work fine on this branch.

Care to try it out, @henryw374?

@Olical Olical changed the title [WIP] Fix test running with something other than :none optmisations Fix test running with something other than :none optmisations Oct 21, 2018
@Olical Olical merged commit 176d541 into master Oct 22, 2018
@Olical Olical deleted the advanced-optimisations branch October 22, 2018 11:54
@henryw374
Copy link
Contributor

henryw374 commented Oct 22, 2018 via email

@Olical
Copy link
Owner Author

Olical commented Oct 22, 2018

Have you added all of the externs? I can take another look, I had this working fine for me with advanced, make sure your test ClojureScript / JS actually compiles properly with advanced. Try rm -rf cljs-test-runner-out; mkdir -p cljs-test-runner-out/gen too.

@Olical
Copy link
Owner Author

Olical commented Oct 23, 2018

In my test harness, :none, :simple and :advanced work fine. Whitespace errors but the error is suppressed so I'll need to have a look at it when running from the REPL. (also need to get errors printing when run from the CLI!)

I haven't tried with any foreign libs though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants