weavejester / eftest

Fast and pretty Clojure test runner
424 stars 40 forks source link

Bonus error from eftest #66

Closed elzibubble closed 5 years ago

elzibubble commented 5 years ago

I'm getting an error when I run lein eftest that I don't see from just lein test. I've set :eftest {:multithread? false}, any ideas for what else this could be please? This project uses clojure.spec.alpha, it's possible I made a mistake in my spec which is the ultimate root cause. In this case - well done eftest for finding it when lein test didn't, but please can you be more helpful about where the issue was? My code doesn't appear in the stack trace at all. I can't absolutely rule out test ordering issues but I'd be Very Surprised. Our tests just aren't that complicated, there aren't any atoms or use of @.

φ tempest 189.3 *=% lein eftest                                                                                                                                                                                                                                                                                                                                                                           ~/w/ccm/library/ccm-spec 13:06:22

ERROR in ccm.plaza-test/current-gen-test (FutureTask.java:122)           
Uncaught exception, not in assertion.

java.util.concurrent.ExecutionException: Syntax error compiling at (clojure/test/check/clojure_test.cljc:95:1).
clojure.lang.Compiler$CompilerException: Syntax error compiling at (clojure/test/check/clojure_test.cljc:95:1).
    data: #:clojure.error{:phase :compile-syntax-check,
                          :line 95,
                          :column 1,
                          :source "clojure/test/check/clojure_test.cljc"}
           java.lang.ClassCastException: eftest.runner$synchronize$fn__2824 cannot be cast to clojure.lang.MultiFn
                           clojure.core/get-method                 core.clj: 1817
          clojure.test.check.clojure-test/eval6223        clojure_test.cljc:   95
                                               ...                               
                              clojure.core/load/fn                 core.clj: 6126
                                 clojure.core/load                 core.clj: 6125
                                 clojure.core/load                 core.clj: 6109
                                               ...                               
                             clojure.core/load-one                 core.clj: 5908
                          clojure.core/load-lib/fn                 core.clj: 5948
                             clojure.core/load-lib                 core.clj: 5947
                             clojure.core/load-lib                 core.clj: 5928
                                               ...                               
                                clojure.core/apply                 core.clj:  667
                            clojure.core/load-libs                 core.clj: 5985
                            clojure.core/load-libs                 core.clj: 5969
                                               ...                               
                                clojure.core/apply                 core.clj:  667
                              clojure.core/require                 core.clj: 6007 (repeats 2 times)
                                               ...                               
       clojure.test.check/eval6186/loading--auto--               check.cljc:   10
                       clojure.test.check/eval6186               check.cljc:   10
                                               ...                               
                              clojure.core/load/fn                 core.clj: 6126
                                 clojure.core/load                 core.clj: 6125
                                 clojure.core/load                 core.clj: 6109
                                               ...                               
                             clojure.core/load-one                 core.clj: 5908
                          clojure.core/load-lib/fn                 core.clj: 5948
                             clojure.core/load-lib                 core.clj: 5947
                             clojure.core/load-lib                 core.clj: 5928
                                               ...                               
                                clojure.core/apply                 core.clj:  667
                            clojure.core/load-libs                 core.clj: 5985
                            clojure.core/load-libs                 core.clj: 5969
                                               ...                               
                                clojure.core/apply                 core.clj:  667
                              clojure.core/require                 core.clj: 6007 (repeats 2 times)
                                               ...                               
                   clojure.spec.gen.alpha/dynaload                alpha.clj:   19
                         clojure.spec.gen.alpha/fn                alpha.clj:   26
                                               ...                               
                                clojure.core/deref                 core.clj: 2320
                clojure.spec.gen.alpha/quick-check                alpha.clj:   29
                clojure.spec.gen.alpha/quick-check                alpha.clj:   27
                                               ...                               
                                clojure.core/apply                 core.clj:  669
               clojure.spec.test.alpha/quick-check                alpha.clj:  309
                   clojure.spec.test.alpha/check-1                alpha.clj:  335
                  clojure.spec.test.alpha/check/fn                alpha.clj:  411
                           clojure.core/pmap/fn/fn                 core.clj: 7022
               clojure.core/binding-conveyor-fn/fn                 core.clj: 2030
                                               ...                               
               java.util.concurrent.FutureTask.run          FutureTask.java:  266
 java.util.concurrent.ThreadPoolExecutor.runWorker  ThreadPoolExecutor.java: 1149
java.util.concurrent.ThreadPoolExecutor$Worker.run  ThreadPoolExecutor.java:  624
                              java.lang.Thread.run              Thread.java:  748

39/39   100% [==================================================]  ETA: 00:00

Ran 39 tests in 0.252 seconds
172 assertions, 0 failures, 1 error.
Tests failed.
φ tempest 189.3 *=% lein test                                                                                                                                                                                                                                                                                                                                                                             ~/w/ccm/library/ccm-spec 13:06:30

Testing ccm.plaza-test
Success!

Ran 39 tests containing 172 assertions.
0 failures, 0 errors.
weavejester commented 5 years ago

Can you provide a list of the dependencies you're using? Are you using the latest version of test.check?

elzibubble commented 5 years ago

org.clojure/test.check "0.9.0" seems to still be latest.

Updating org.clojure/spec.alpha to "0.2.176" didn't obviously change behaviour at all.

φ tempest 189.3=% lein deps :tree                                                                                                                                                                                                                                                                                                                                                                         ~/w/ccm/library/ccm-spec 13:39:32
Possibly confusing dependencies found:
[org.clojure/spec.alpha "0.1.143"]
 overrides
[org.clojure/clojure "1.10.0"] -> [org.clojure/spec.alpha "0.2.176"]

Consider using these exclusions:
[org.clojure/clojure "1.10.0" :exclusions [org.clojure/spec.alpha]]

 [cljfmt "0.6.4" :scope "test"]
   [com.googlecode.java-diff-utils/diffutils "1.3.0" :scope "test"]
   [org.clojure/tools.cli "0.3.7" :scope "test"]
   [org.clojure/tools.reader "1.2.2" :scope "test"]
   [rewrite-clj "0.6.0" :scope "test"]
   [rewrite-cljs "0.4.4" :scope "test"]
     [org.clojure/clojurescript "1.7.228" :scope "test" :exclusions [[org.apache.ant/ant]]]
       [com.google.javascript/closure-compiler "v20151216" :scope "test"]
       [org.clojure/data.json "0.2.6" :scope "test"]
       [org.clojure/google-closure-library "0.0-20151016-61277aea" :scope "test"]
         [org.clojure/google-closure-library-third-party "0.0-20151016-61277aea" :scope "test"]
       [org.mozilla/rhino "1.7R5" :scope "test"]
 [clojure-complete "0.2.5" :exclusions [[org.clojure/clojure]]]
 [clojurewerkz/money "1.10.0"]
   [org.joda/joda-money "0.10.0"]
 [io.aviso/pretty "0.1.34" :scope "test"]
 [nrepl "0.5.3" :exclusions [[org.clojure/clojure]]]
   [nrepl/bencode "1.0.0"]
 [org.clojure/clojure "1.10.0"]
   [org.clojure/core.specs.alpha "0.2.44"]
 [org.clojure/spec.alpha "0.1.143"]
 [org.clojure/test.check "0.9.0"]
 [pjstadig/humane-test-output "0.8.3" :scope "test"]
φ tempest 189.3=% lein deps :plugin-tree                                                                                                                                                                                                                                                                                                                                                                  ~/w/ccm/library/ccm-spec 13:39:45
 [lein-cljfmt "0.6.4"]
   [cljfmt "0.6.4"]
     [com.googlecode.java-diff-utils/diffutils "1.3.0"]
     [org.clojure/clojure "1.8.0"]
     [org.clojure/tools.cli "0.3.7"]
     [org.clojure/tools.reader "1.2.2"]
     [rewrite-clj "0.6.0"]
     [rewrite-cljs "0.4.4"]
       [org.clojure/clojurescript "1.7.228" :exclusions [[org.apache.ant/ant]]]
         [com.google.javascript/closure-compiler "v20151216"]
         [org.clojure/data.json "0.2.6"]
         [org.clojure/google-closure-library "0.0-20151016-61277aea"]
           [org.clojure/google-closure-library-third-party "0.0-20151016-61277aea"]
         [org.mozilla/rhino "1.7R5"]
 [lein-eftest "0.5.7"]
 [lein-try "0.4.3"]
 [org.clojars.lxsli/lein-test-out "0.3.2"]
   [org.clojure/tools.namespace "0.2.3"]
weavejester commented 5 years ago

Try updating test.check to 0.10.0-alpha3.

elzibubble commented 5 years ago

Huh, that fixed it!

weavejester commented 5 years ago

test.check tries to inject some methods into the report var, assuming that it's a multimethod, which isn't always true as it can be dynamically overridden. The alpha version of test.check fixes that issue.

elzibubble commented 5 years ago

Closing as I guess this is a test.check issue