kaocha

Official support channel: https://clojureverse.org/c/projects/kaocha
plexus 2020-04-23T07:34:10.162300Z

that's one option... could you share what the above looks like with the :debug reporter?

plexus 2020-04-23T07:35:45.163Z

or in particular with this version of it, it currently doesn't print ::printed-expression, and I'd like to know if it gets that or not

(defn debug [m]
  (t/with-test-out
    (prn (cond-> (select-keys m [:type
                                 :file
                                 :line
                                 :var
                                 :ns
                                 :expected
                                 :actual
                                 :message
                                 :kaocha/testable
                                 :debug
                                 ::printed-expression])
           (:kaocha/testable m)
           (update :kaocha/testable select-keys [:kaocha.testable/id :kaocha.testable/type])))))

rgm 2020-04-28T03:57:44.170Z

So I used this debug reporter (not the one on master) and got this with a focus-meta on the particular test … running both the clj and cljs units (cljs in node):

rgm 2020-04-28T03:58:01.170200Z

rgm 2020-04-28T04:06:59.170600Z

Realistically, just pre-preparing the failure string with the 2-arity of clojure.test/is also works, since that does do my defined string conversion while it’s still a deftype and not some transit-ish thing.

rgm 2020-04-28T04:07:20.171Z

not as pretty in cljs, though. Let me know if there are any other experiments you want me to try.

plexus 2020-04-28T10:54:06.171200Z

hmmm it's surprising to me that those :fail messages don't have a :kaocha.report/printed-expression key. This would normally contain the complete message to be output, but generated on the cljs side. I'll have to look into that. In general providing and api for and documenting how people can add their own print handlers for clj/cljs would be very handy, I confuse myself right now when looking into that.

plexus 2020-04-23T07:37:43.163300Z

if you are able to use latest master that would also work

danielcompton 2020-04-23T18:55:35.163500Z

When I run the tests I get this error:

danielcompton 2020-04-23T18:55:45.164Z

$ bin/run_feature version_filter
cat: features/version_filter/args: No such file or directory
[E]
Randomized with --seed 1996770488

ERROR in unit (ns.clj:13)
Exception: <http://java.io|java.io>.FileNotFoundException: Could not locate kaocha/api_test__init.class, kaocha/api_test.clj or kaocha/api_test.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
 at clojure.lang.RT.load (RT.java:462)
    ...
    kaocha.ns$required_ns.invokeStatic (ns.clj:13)
    kaocha.ns$required_ns.invoke (ns.clj:11)
    kaocha.type.ns$eval3366$fn__3367.invoke (ns.clj:29)
    ...
    kaocha.testable$load.invokeStatic (testable.clj:77)
    kaocha.testable$load.invoke (testable.clj:64)
    ...
    kaocha.testable$load_testables.invokeStatic (testable.clj:142)
    kaocha.testable$load_testables.invoke (testable.clj:134)
    kaocha.load$load_test_namespaces.invokeStatic (load.clj:49)
    kaocha.load$load_test_namespaces.doInvoke (load.clj:37)
    ...
    kaocha.type.clojure.test$eval4784$fn__4785.invoke (test.clj:16)
    ...
    kaocha.testable$load.invokeStatic (testable.clj:77)
    kaocha.testable$load.invoke (testable.clj:64)
    ...
    kaocha.testable$load_testables.invokeStatic (testable.clj:142)
    kaocha.testable$load_testables.invoke (testable.clj:134)
    kaocha.api$test_plan.invokeStatic (api.clj:41)
    kaocha.api$test_plan.invoke (api.clj:34)
    kaocha.api$run$fn__3073.invoke (api.clj:85)
    ...
    kaocha.api$run.invokeStatic (api.clj:83)
    kaocha.api$run.invoke (api.clj:71)
    kaocha.runner$run.invokeStatic (runner.clj:129)
    kaocha.runner$run.invoke (runner.clj:71)
    kaocha.runner$_main_STAR_.invokeStatic (runner.clj:162)
    kaocha.runner$_main_STAR_.doInvoke (runner.clj:141)
    ...
    kaocha.runner$_main.invokeStatic (runner.clj:173)
    kaocha.runner$_main.doInvoke (runner.clj:171)
    ...
1 tests, 1 assertions, 1 errors, 0 failures.

plexus 2020-04-25T09:16:58.168Z

sorry Daniel, that script is vestigial. We used to have a different kind of feature tests before we used cucumber, that's what this script was for. Now you just use kaocha, e.g. bin/kaocha --focus :plugins.version-filter