-
Notifications
You must be signed in to change notification settings - Fork 49
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
Cljs tests failing under new version of planck/cljs #222
Comments
Of note: - zprint lib tests - cljs tests under planck 2.26 fail, so disabled for now. kkinnear/zprint#222 - libs tests script will now use GITHUB_TOKEN env var when hitting GitHub endpoints. Use this to overcome rate limiting during dev. - bumped sci-test to test wich sci v0.3.0
After downgrading to planck 2.25.0 (which is not a mountain of fun to do via brew), I can confirm that cljs tests pass for me for zprint v1.2.1 and v1.2.2. There might be a better way to downgrade planck via brew, but here's what I managed to figure out.
|
Hey @lread, it is good to hear from you. Not that I like what I'm hearing, mind you. Thanks for figuring out that the change was related to the
And mine is also a version for arm/Apple Silicon, as the Intel version runs terribly with the Rosetta thing on the newer Macs. In looking at the error, I'm rather confused. This is the test:
It seems pretty clear that this test is about an odd number of things in a map. The test expects a failure from clj and for it to work with cljs. What you are getting with the newer version of But, but, isn't it rewrite-clj that is parsing this? Yes, here are some simple examples taken from that test that seem to illustrate what used to happen with planck Here it is in clj:
The same thing in cljs:
The difference in these two examples is the Apparently you used to not throw on the |
Hmmm... thanks for the clarifications and questions. |
So here's my rewrite-clj tests for invalid maps: And I documented this understanding as well. So I think you are telling me an sexpr was non-throwing on an unbalanced Clojure maps with the previous version of planck? I might have known that once, but I don't remember knowing it. |
Okay I've learned enough brew to switch between planck versions. 🙂 Here's a validation of your understanding: Plank 2.25.0 - can sexpr an unbalanced map $ plk
ClojureScript 1.10.597
cljs.user=> (require '[rewrite-clj.parser :as p])
nil
cljs.user=> (require '[rewrite-clj.node :as n])
nil
cljs.user=> (def x (p/parse-string "{:a}"))
#'cljs.user/x
cljs.user=> (n/sexpr x)
{:a nil}
cljs.user=> {:a}
Syntax error reading source at (<cljs repl>:1).
The map literal starting with :a contains 1 form(s). Map literals must contain an even number of forms.
cljs.user=> And plank 2.26.0 - cannot sexpr an unbalanced map $ plk
ClojureScript 1.10.914
cljs.user=> (require '[rewrite-clj.parser :as p])
nil
cljs.user=> (require '[rewrite-clj.node :as n])
nil
cljs.user=> (def x (p/parse-string "{:a}"))
#'cljs.user/x
cljs.user=> (n/sexpr x)
Execution error (Error) at (<cljs repl>:1).
No value supplied for key: :a
cljs.user=> {:a}
Syntax error reading source at (<cljs repl>:1).
The map literal starting with :a contains 1 form(s). Map literals must contain an even number of forms. |
Wow, caught me replying. Yes, that is what I think is happening. Overall, probably a good thing, yes? Brings the two environments into alignment. |
The question is, how do we clean up the tests. I'm at least a couple of weeks if not more away from a new release. I have just had two releases in quick succession. The simple thing to do is for me to upgrade my planck, though I haven't yet looked to see if that is possible for my environment, and then fix my tests to be correct for that environment. Then after 1.2.3 comes out, we would be in alignment. I'll look into that. But that isn't going to help your testing situation at the moment. |
Near as I can tell, there is now a more or less standard macOS ARM version of planck, so I'll plan to upgrade my planck and fix my tests prior to releasing zprint |
I raised this issue more in the spirit of informing you of a potential issue for zprint. I've adapted rewrite-clj canary testing to disable zprint cljs tests for now. |
In case you need them, more brew lessons: After following my brew instructions, you can switch:
It all seems rather awkward, and there might be better ways. |
Thank you for letting me know about this, I really appreciate it. Thank you also for the brew lessons. I don't use it often. While I agree it seems awkward, it also seems simple! Thanks again! I'll leave this issue open to ensure that I actually upgrade planck and fix the tests. |
Yeah, I agree. Feels like a cljs bug fix. Not to bore you, but here's the crux of the difference: Planck 2.25.0 ClojureScript 1.10.597
cljs.user=> (apply hash-map [:a])
{:a nil} Planck 2.26.0 ClojureScript 1.10.914
cljs.user=> (apply hash-map [:a])
Execution error (Error) at (<cljs repl>:1).
No value supplied for key: :a I expect this is not a planck thing at all, but a ClojureScript thing. If I compare the current version of cljs: $ clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.11.4"}}}' -M -m cljs.main
ClojureScript 1.11.4
cljs.user=> (apply hash-map [:a])
Execution error (Error) at (<cljs repl>:1).
No value supplied for key: :a To an early 1.10 release:
We see the same difference. |
Wow, thanks. That's very clear! |
This seems like the actual cljs change: CLSJ-3324 |
Thanks, that certainly nails down what is going on! |
I've upgraded my On a related note (related because of |
Congrats! I'll give it a go soon and letcha know! For rebel-readline, I expect explicitly excluding the rewrite-cljs dep might do the trick? |
All zprint planck tests pass for me on macOS! Woot! |
Wow, isn't that interesting about Regarding So, now zprint works with Figwheel both with and without I sort of assumed that the reason why zprint wasn't happy with But it does work with zprint just fine, so I'm considering that a win! |
Me neither! 🙂
Theoretically, rewrite-clj v1 should step in as a drop-in replacement for rewrite-cljs. |
I don't think there is more to do here. If I'm wrong, please re-open the issue. Thanks! |
I think you are right, @kkinnear. I did take a whirl at getting a new release working for planck but came to the feeling that maybe the javascript engine (which planck uses) on Ubuntu is 20.04 is problematic. But planck should work on ubuntu 22.04 (will still need to wait for a new release of planck). Once Ubuntu 22.04 is out of beta on GitHub Actions, I'll try to remember to suggest a new release of planck over at the planck repo. After that, I'll update my canary tests for zprint at rewrite-clj. |
Hi @kkinnear, as you know I like to test current releases of libraries that use rewrite-clj against the rewrite-clj development branch. When upgrading my tests to use zprint 1.2.2 I experienced a failure when running the zprint ClojureScript tests.
And I can reproduce the failure with zprint proper.
My environment
Steps
Result
More tests
If I downgrade to sprint v1.2.1 and rerun:
I get the same failure. Tests for v1.2.1 used to pass for me, so the failure seems to be triggered by the new version of planck.
Other Notes
The text was updated successfully, but these errors were encountered: