This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-13
Channels
- # 100-days-of-code (5)
- # adventofcode (1)
- # announcements (8)
- # beginners (148)
- # boot (17)
- # calva (26)
- # cider (17)
- # cljdoc (2)
- # cljs-dev (55)
- # cljsjs (2)
- # clojure (198)
- # clojure-dev (11)
- # clojure-finland (1)
- # clojure-italy (23)
- # clojure-nl (6)
- # clojure-spec (44)
- # clojure-uk (148)
- # clojurescript (27)
- # clojutre (20)
- # core-logic (21)
- # cursive (12)
- # datascript (10)
- # datomic (33)
- # emacs (11)
- # figwheel-main (49)
- # fulcro (19)
- # graphql (2)
- # off-topic (48)
- # onyx (2)
- # other-languages (53)
- # pedestal (3)
- # reagent (75)
- # reitit (17)
- # rum (1)
- # slack-help (2)
- # specter (2)
- # sql (3)
- # tools-deps (24)
- # unrepl (4)
- # yada (1)
@tmarble couple of days back there was some discussion about CIDER in this channel. Still visible in the/my history
cool, I'll check that out... for the moment the CIDER stuff seems to be working fine (including auto tests), but I am having some trouble with testing
I've had success running fig:test from the https://rigsomelight.com/figwheel-main-template/
and, in particular, the compiler options in test.cljs.edn
are respected
as demonstrated by running "run" "-m" "figwheel.main" "-co" "test.cljs.edn" "-pc"
However, if I specify either :output-to
or :output-dir
then it hangs after printing
"Environment output being logged to:"
What's also strange is that.. in another (actual) project where I want to use figwheel-main for testing (a la "fig:test") the :output-to
is set to "/var/folders/....." even though I didn't specify :output-dir nor :output-to in test.cljs.edn???
And, perhaps because of the non-default :output-* behavior I mentioned above the test also hangs??
this seems relevant https://figwheel.org/docs/testing.html#custom-testing-with-extra-main-files
Indeed I've taken a lot of inspiration from that page... including writing a shell script for :launch-js which will pick the correct chrome executable path based on platform (e.g. Mac, Linux)... And I have a followup lein do shell script that will check if the headless chrome is still running after the test (and kill it if necessary)
I am trying to see what's in the new project that might be changing :ouput-* AND why the hang occurs
in the new project, with the problem, I am NOT changing output-to... BUT -pc shows that it HAS changed... I wonder if it might be some legacy figwheel sidecar stuff (which I have tried to remove)
however I do have a minimal test case using the figwheel-template.... SETTING :output-to and/or :output-dir causes the fig:test to hang... The symptom is that the environment log seems to be in an infinite loop printing >>> {"result":{"type":"undefined"}}
in doing the (non interactive development) "fig:test" we need -m RUNNER I will note, FWIW, that the meta data in test.cljs.end tells chrome to add the --repl arg (to create a JavaScript REPL), but I know this is different
I will! Sorry I'm in an all day workshop today, but I'll ping you when I get back online
Sorry it's taken so long to get back to you. I found that I wanted to to use a shell script in :launch-js so that I could avoid hard coding the path to Chrome (most developers use Macs, but the CI/CD pipeline uses Linux). I also found that using the shell script allowed me to keep the PID of Chrome so that I could ensure it was properly stopped after the test.
FWIW I did think about the possibility of keeping a reference to a Process created by ProcessBuilder so that figwheel-main could later call .destroy per. https://docs.oracle.com/javase/8/docs/api/java/lang/Process.html#destroy-- BUT it would involve a significant change to the this function is wrapped in a Lamba (hence the desire to discuss this with you): https://github.com/bhauman/figwheel-repl/blob/master/src/figwheel/repl.cljc#L1151
To test your theory.. I reverted my :launch-js to use the hard-coded path the Chrome on the Mac (again using the template application) and if the :output-dir :output-to options are set the tests still hang. 😞