jakemcc / test-refresh

Refreshes and reruns clojure.tests in your project.
393 stars 28 forks source link

java.lang.AssertionError: Assert failed: (vector? (:dependencies project [])) when running lein test-refresh #51

Closed johanhaleby closed 8 years ago

johanhaleby commented 8 years ago

I'm using Leiningen 2.6.1 and lein-test-refresh 0.14.0 but running: lein test-refresh on my project yields:

Exception in thread "main" java.lang.AssertionError: Assert failed: (vector? (:dependencies project []))
    at leinjacker.deps$add_if_missing.invokeStatic(deps.clj:43)
    at leinjacker.deps$add_if_missing.invoke(deps.clj:43)
    at leiningen.test_refresh$add_deps.invokeStatic(test_refresh.clj:10)
    at leiningen.test_refresh$add_deps.invoke(test_refresh.clj:8)
    at leiningen.test_refresh$test_refresh.invokeStatic(test_refresh.clj:51)
    at leiningen.test_refresh$test_refresh.doInvoke(test_refresh.clj:39)
    at clojure.lang.RestFn.invoke(RestFn.java:410)
    at clojure.lang.Var.invoke(Var.java:379)
    at clojure.lang.AFn.applyToHelper(AFn.java:154)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.core$apply.invokeStatic(core.clj:648)
    at clojure.core$apply.invoke(core.clj:641)
    at leiningen.core.main$partial_task$fn__5829.doInvoke(main.clj:272)
    at clojure.lang.RestFn.invoke(RestFn.java:410)
    at clojure.lang.AFn.applyToHelper(AFn.java:154)
    at clojure.lang.RestFn.applyTo(RestFn.java:132)
    at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invokeStatic(core.clj:648)
    at clojure.core$apply.invoke(core.clj:641)
    at leiningen.core.main$apply_task.invokeStatic(main.clj:322)
    at leiningen.core.main$apply_task.invoke(main.clj:308)
    at leiningen.core.main$resolve_and_apply.invokeStatic(main.clj:328)
    at leiningen.core.main$resolve_and_apply.invoke(main.clj:324)
    at leiningen.core.main$_main$fn__5895.invoke(main.clj:401)
    at leiningen.core.main$_main.invokeStatic(main.clj:394)
    at leiningen.core.main$_main.doInvoke(main.clj:391)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.lang.Var.invoke(Var.java:379)
    at clojure.lang.AFn.applyToHelper(AFn.java:154)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.core$apply.invokeStatic(core.clj:646)
    at clojure.main$main_opt.invokeStatic(main.clj:314)
    at clojure.main$main_opt.invoke(main.clj:310)
    at clojure.main$main.invokeStatic(main.clj:421)
    at clojure.main$main.doInvoke(main.clj:384)
    at clojure.lang.RestFn.invoke(RestFn.java:436)
    at clojure.lang.Var.invoke(Var.java:388)
    at clojure.lang.AFn.applyToHelper(AFn.java:160)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.main.main(main.java:37)

Just running lein test works fine.

johanhaleby commented 8 years ago

I've also tried it with version Leiningen 2.5.3, same result

jakemcc commented 8 years ago

The error makes me think there is something off with the dependencies vector in the project.clj. what does your project.clj look like?

On Mon, Mar 7, 2016, 00:45 Johan Haleby notifications@github.com wrote:

I've also tried it with version Leiningen 2.5.3

— Reply to this email directly or view it on GitHub https://github.com/jakemcc/lein-test-refresh/issues/51#issuecomment-193126321 .

johanhaleby commented 8 years ago

Thanks for your response. My project.clj looks like this:

(defproject fake-http "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url  "http://www.eclipse.org/legal/epl-v10.html"}
  :min-lein-version "2.0.0"
  :dependencies [[com.squareup.okhttp3/mockwebserver "3.2.0"]]
  :profiles {:dev {:dependencies [[org.clojure/clojure "1.8.0"]
                                  [speclj "3.3.0"]
                                  [cheshire "5.5.0"]
                                  [clj-http-lite "0.3.0"]]}}
  :plugins [[codox "0.6.3"]
            [speclj "3.3.0"]])
jakemcc commented 8 years ago

Used your project.clj to look into the problem. The issue is codox "0.6.3" is depending on an old version of leinjacker that has incorrect assertions in it.

If you change [codox "0.6.3"] to [lein-codox "0.9.4"] then it starts using leinjacker 0.4.2 which has correct assertions for project.clj shape.

I haven't really explored it before but I'm unsure how test-refresh is going to interact with speclj. Speclj is a fairly different testing library than clojure.test.

johanhaleby commented 8 years ago

Thanks a lot for your help, I can confirm that it works. I'm migrating away from speclj so it was just a mistake that it was still laying around in project.clj.