This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-06
Channels
- # aleph (13)
- # announcements (1)
- # babashka (89)
- # beginners (23)
- # calva (14)
- # circleci (7)
- # clj-kondo (39)
- # clj-on-windows (1)
- # cljdoc (5)
- # cljsrn (29)
- # clojure (98)
- # clojure-art (3)
- # clojure-conj (5)
- # clojure-europe (14)
- # clojure-nl (1)
- # clojure-norway (9)
- # clojurescript (18)
- # clr (39)
- # code-art (3)
- # community-development (3)
- # cursive (3)
- # emacs (11)
- # events (1)
- # fulcro (12)
- # graalvm-mobile (16)
- # graphql (3)
- # gratitude (1)
- # honeysql (19)
- # java (7)
- # joyride (23)
- # lsp (22)
- # malli (2)
- # missionary (25)
- # off-topic (15)
- # polylith (15)
- # rdf (5)
- # reagent (9)
- # reitit (3)
- # scittle (3)
- # shadow-cljs (37)
- # slack-help (2)
- # sql (10)
Apropos Add e2e testing there ^: It is a bit mind-boggling that we are using Joyride to test Joyride. What we do is that we run VS Code and then run this:
vscode.commands.executeCommand("joyride.runCode", "(require '[integration-test.runner :as runner]) (runner/run-all-tests)");
It has the added benefit that a lot of Joyride needs to work in order for it to run the tests. So there's an extra layer of smoke testing there. It would have stopped an incident we had a while ago where we released a non-functioning Joyride version.I think it's a nice approach. One potential issue: how do we know for sure that the SCI cljs.test version works and doesn't accidentally mark everything as succesful or forgets to run certain tests? :) Maybe there should be at least some checks on the outside as well after the tests are run? In babashka I do this as follows: test the bb clojure.test version using the host's clojure test and test evaluation of individual things the same way. Then I run several library tests in babashka like we do above with joyride. But at least I've got a layered approach that ensures every layer works
What would such tests look like? We could maybe wrap some known mix of succeeding/failing tests some way that would fail the tests if the result tally of these is wrong...
we could maybe also just check the expected stdout, or write to a log file in the tests
To use the host's cljs.test (shadow) we will need to factor the joyride.sci
code such that it does not rely in vscode
, I think.
> we could maybe also just check the expected stdout, or write to a log file in the tests This is where I was going with my first reply above.
I think it would be good to check: • The number of tests that have been run Maybe other stuff?
But write some special tests for this, maybe as simple as one succeeding and one failing, just to see that we don't ”accidentally mark everything as succesful”.
or maybe do this in some tests: add something to a global state and then at the end of the test suite, we verify in the integration test runner that the global state thing is as expected
I have trust that assertions work, so if we can just assert that "at least x assertions" have been made, it's good
Cool. I've added an issue about this now: https://github.com/BetterThanTomorrow/joyride/issues/138
We already keep a counter of successes and failures in an atom, a slight change to where we report back on the test run success of failure should do it. Like so:
(defmethod cljs.test/report [:cljs.test/default :end-run-tests] [m]
(old-end-run-tests m)
(let [{:keys [running pass fail error]} @db/!state
passed-minimum-threshold 20]
(println "Runner: tests run, results:" (select-keys @db/!state [:pass :fail :error]))
(if (or (> 0 (+ fail error))
(< pass passed-minimum-threshold))
(p/reject! running true)
(p/resolve! running true))))
Cool. I've added an issue about this now: https://github.com/BetterThanTomorrow/joyride/issues/138
Dear Joyriders: New release - https://github.com/BetterThanTomorrow/joyride/releases/tag/v0.0.30 • https://github.com/BetterThanTomorrow/joyride/issues/132 • Fix: https://github.com/BetterThanTomorrow/joyride/issues/134`js/require`https://github.com/BetterThanTomorrow/joyride/issues/134 • Dev internals: https://github.com/BetterThanTomorrow/joyride/issues/136 • Dev internals: https://github.com/BetterThanTomorrow/joyride/issues/138`cljs.test`https://github.com/BetterThanTomorrow/joyride/issues/138 • Fix: https://github.com/BetterThanTomorrow/joyride/issues/139`my_lib.cljs`https://github.com/BetterThanTomorrow/joyride/issues/139`scripts`https://github.com/BetterThanTomorrow/joyride/issues/139`src`https://github.com/BetterThanTomorrow/joyride/issues/139 Main user change here is that now people can write their Joyride scripts in JavaScript, which might not be the choice for most of us here, but anyway.