marick / lein-midje

Leiningen plugin for Midje
MIT License
77 stars 29 forks source link

lein midje --lazytest incompatible with lein-swank #10

Closed denlab closed 12 years ago

denlab commented 12 years ago

lein midje --lazytest is working but breaks lein-swank, details below.

$ lein version
Leiningen 1.6.2 on Java 1.6.0_26 Java HotSpot(TM) Client VM

$ ls ~/.lein/plugins/
lein-midje-1.0.7.jar  swank-clojure-1.3.3.jar

$ lein new lazytest-vs-swank
Created new project in: /home/denis/tmp/lazytest-vs-swank
Look over project.clj and start coding in lazytest_vs_swank/core.clj
$ cd lazytest-vs-swank/

$ lein swank
Copying 1 file to /home/denis/tmp/lazytest-vs-swank/lib
Connection opened on localhost port 4005.
$ '################################> cool lein-swank works!'

$ emacs project.clj 
$ cat project.clj 
(defproject lazytest-vs-swank "1.0.0-SNAPSHOT"
  :description "FIXME: write description"
  :dependencies [[org.clojure/clojure "1.3.0"]]
  :dev-dependencies [[midje "1.3.0-RC4"]])

$ lein swank
Copying 1 file to /home/denis/tmp/lazytest-vs-swank/lib
Copying 10 files to /home/denis/tmp/lazytest-vs-swank/lib/dev
Connection opened on localhost port 4005.
$ '################################> cool lein-swank still working!'

$ emacs project.clj 
$ cat project.clj 
(defproject lazytest-vs-swank "1.0.0-SNAPSHOT"
  :description "FIXME: write description"
  :dependencies [[org.clojure/clojure "1.3.0"]]
  :dev-dependencies [[midje "1.3.0-RC4"]])
$ em project.clj 
$ lein midje --lazytest
Copying 1 file to /home/denis/tmp/lazytest-vs-swank/lib
Copying 13 files to /home/denis/tmp/lazytest-vs-swank/lib/dev
#<ScheduledThreadPoolExecutor java.util.concurrent.ScheduledThreadPoolExecutor@60029d>

======================================================================
Reloading lazytest-vs-swank.test.core, lazytest-vs-swank.core
Running examples at #<Date Sun Dec 11 18:20:52 CET 2011>

Done.
$ '################################> cool lazytest is working!'

$'################################> But then: '

$ lein swank
Warning: *log-events* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *log-events* or change the name.
Warning: *log-output* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *log-output* or change the name.
Warning: *namespace-re* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *namespace-re* or change the name.
Warning: *current-connection* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *current-connection* or change the name.
Warning: *default-encoding* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *default-encoding* or change the name.
Warning: *pre-reply-hook* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *pre-reply-hook* or change the name.
Warning: *pre-reply-hook* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *pre-reply-hook* or change the name.
Warning: *thread-map-next-id* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *thread-map-next-id* or change the name.
Warning: *thread-map-next-id* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *thread-map-next-id* or change the name.
Warning: *thread-map* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *thread-map* or change the name.
Warning: *thread-map* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *thread-map* or change the name.
Warning: *mailboxes* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *mailboxes* or change the name.
Warning: *mailboxes* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *mailboxes* or change the name.
Warning: *protocol-version* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *protocol-version* or change the name.
Warning: *protocol-version* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *protocol-version* or change the name.
Warning: *current-package* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *current-package* or change the name.
Warning: *pending-continuations* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *pending-continuations* or change the name.
Warning: *sldb-stepping-p* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *sldb-stepping-p* or change the name.
Warning: *sldb-initial-frames* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *sldb-initial-frames* or change the name.
Warning: *sldb-level* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *sldb-level* or change the name.
Warning: *sldb-restarts* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *sldb-restarts* or change the name.
Warning: *debug-swank-clojure* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *debug-swank-clojure* or change the name.
Warning: *active-threads* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *active-threads* or change the name.
Warning: *active-threads* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *active-threads* or change the name.
Warning: *debug-quit-exception* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *debug-quit-exception* or change the name.
Warning: *debug-quit-exception* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *debug-quit-exception* or change the name.
Warning: *debug-continue-exception* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *debug-continue-exception* or change the name.
Warning: *debug-continue-exception* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *debug-continue-exception* or change the name.
Warning: *debug-abort-exception* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *debug-abort-exception* or change the name.
Warning: *debug-abort-exception* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *debug-abort-exception* or change the name.
Warning: *current-exception* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *current-exception* or change the name.
Warning: *current-env* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *current-env* or change the name.
Warning: *connections* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *connections* or change the name.
Warning: *connections* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *connections* or change the name.
Warning: *compiler-exception-location-re* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *compiler-exception-location-re* or change the name.
Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: print-doc in this context, compiling:(swank/commands/basic.clj:180)
    at clojure.lang.Compiler.analyze(Compiler.java:6235)
    at clojure.lang.Compiler.analyze(Compiler.java:6177)
    at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3452)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6411)
    at clojure.lang.Compiler.analyze(Compiler.java:6216)
    at clojure.lang.Compiler.analyze(Compiler.java:6177)
    at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5572)
    at clojure.lang.Compiler$TryExpr$Parser.parse(Compiler.java:2091)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6409)
    at clojure.lang.Compiler.analyze(Compiler.java:6216)
    at clojure.lang.Compiler.analyze(Compiler.java:6177)
    at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5572)
    at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:5873)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6409)
    at clojure.lang.Compiler.analyze(Compiler.java:6216)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6397)
    at clojure.lang.Compiler.analyze(Compiler.java:6216)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6397)
    at clojure.lang.Compiler.analyze(Compiler.java:6216)
    at clojure.lang.Compiler.analyze(Compiler.java:6177)
    at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5572)
    at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:5873)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6409)
    at clojure.lang.Compiler.analyze(Compiler.java:6216)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6397)
    at clojure.lang.Compiler.analyze(Compiler.java:6216)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6397)
    at clojure.lang.Compiler.analyze(Compiler.java:6216)
    at clojure.lang.Compiler.analyze(Compiler.java:6177)
    at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5572)
    at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5008)
    at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3629)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6407)
    at clojure.lang.Compiler.analyze(Compiler.java:6216)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6397)
    at clojure.lang.Compiler.analyze(Compiler.java:6216)
    at clojure.lang.Compiler.access$100(Compiler.java:37)
    at clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:492)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6409)
    at clojure.lang.Compiler.analyze(Compiler.java:6216)
    at clojure.lang.Compiler.analyze(Compiler.java:6177)
    at clojure.lang.Compiler.eval(Compiler.java:6469)
    at clojure.lang.Compiler.load(Compiler.java:6902)
    at clojure.lang.RT.loadResourceScript(RT.java:357)
    at clojure.lang.RT.loadResourceScript(RT.java:348)
    at clojure.lang.RT.load(RT.java:427)
    at clojure.lang.RT.load(RT.java:398)
    at clojure.core$load$fn__4610.invoke(core.clj:5386)
    at clojure.core$load.doInvoke(core.clj:5385)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5200)
    at clojure.core$load_lib.doInvoke(core.clj:5237)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:602)
    at clojure.core$load_libs.doInvoke(core.clj:5275)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:602)
    at clojure.core$require.doInvoke(core.clj:5352)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at swank.swank$eval35$loading__4505__auto____36.invoke(swank.clj:11)
    at swank.swank$eval35.invoke(swank.clj:11)
    at clojure.lang.Compiler.eval(Compiler.java:6465)
    at clojure.lang.Compiler.eval(Compiler.java:6455)
    at clojure.lang.Compiler.load(Compiler.java:6902)
    at clojure.lang.RT.loadResourceScript(RT.java:357)
    at clojure.lang.RT.loadResourceScript(RT.java:348)
    at clojure.lang.RT.load(RT.java:427)
    at clojure.lang.RT.load(RT.java:398)
    at clojure.core$load$fn__4610.invoke(core.clj:5386)
    at clojure.core$load.doInvoke(core.clj:5385)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5200)
    at clojure.core$load_lib.doInvoke(core.clj:5237)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:602)
    at clojure.core$load_libs.doInvoke(core.clj:5271)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:602)
    at clojure.core$require.doInvoke(core.clj:5352)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at user$eval27.invoke(NO_SOURCE_FILE:1)
    at clojure.lang.Compiler.eval(Compiler.java:6465)
    at clojure.lang.Compiler.eval(Compiler.java:6455)
    at clojure.lang.Compiler.eval(Compiler.java:6431)
    at clojure.core$eval.invoke(core.clj:2795)
    at clojure.main$eval_opt.invoke(main.clj:296)
    at clojure.main$initialize.invoke(main.clj:315)
    at clojure.main$null_opt.invoke(main.clj:348)
    at clojure.main$main.doInvoke(main.clj:426)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:405)
    at clojure.lang.AFn.applyToHelper(AFn.java:163)
    at clojure.lang.Var.applyTo(Var.java:518)
    at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve symbol: print-doc in this context
    at clojure.lang.Util.runtimeException(Util.java:156)
    at clojure.lang.Compiler.resolveIn(Compiler.java:6720)
    at clojure.lang.Compiler.resolve(Compiler.java:6664)
    at clojure.lang.Compiler.analyzeSymbol(Compiler.java:6625)
    at clojure.lang.Compiler.analyze(Compiler.java:6198)
    ... 93 more
$

It looks like an incompatibility between lazytest and clojure 1.3.0 that don't appears when doing lein midje or lein midje --lazytest but is triggered by the usage of lein-swank

By the way the new colors are pretty cool, and lazytest very comfortable

AlexBaranosky commented 12 years ago

I tried to reproduce this by starting up lein midje --lazytest waiting for it to say "Done." then starting up lein swank but it didn't fail. It there some step I missed? What are the minimal steps to reproduce this on your end?

denlab commented 12 years ago

It works fine with clojure 1.2.1:

(defproject tst "1.0.0-SNAPSHOT"
  :description "FIXME: write description"
  :dependencies [[org.clojure/clojure "1.2.1"]]
  :dev-dependencies [[midje                "1.3.0-RC4"]
   [com.intelie/lazytest "1.0.0-SNAPSHOT"]])

But breaks with clojure 1.3.0:

(defproject tst "1.0.0-SNAPSHOT"
  :description "FIXME: write description"
  :dependencies [[org.clojure/clojure "1.3.0"]]
  :dev-dependencies [[midje                "1.3.0-RC4"]
   [com.intelie/lazytest "1.0.0-SNAPSHOT"]])

more specifically I did 2 tests on two different env (and varying only the clojure version):

    |   clj |    lein | midje     | lein-midje | swank | lazy+swank  |
    |-------+---------+-----------+------------+-------+-------------|
    | 1.2.1 | 1.6.1.1 | 1.3.0-RC4 |      1.0.7 | 1.3.1 | OK          |
    | 1.3.0 | 1.6.1.1 | 1.3.0-RC4 |      1.0.7 | 1.3.1 | **breaks!** |
    |-------+---------+-----------+------------+-------+-------------|
    | 1.2.1 |   1.6.2 | 1.3.0-RC4 |      1.0.7 | 1.3.3 | OK          |
    | 1.3.0 |   1.6.2 | 1.3.0-RC4 |      1.0.7 | 1.3.3 | **breaks!** |

So the workaround for now, is to use Clojure 1.2.1 instead of 1.3.0

marick commented 12 years ago

I tried reproducing these steps with this configuration:


(defproject lazytest-vs-swank "1.0.0-SNAPSHOT"
  :description "FIXME: write description"
  :dependencies [[org.clojure/clojure "1.3.0"]]
  :dev-dependencies [[midje "1.3.1"]
                     [com.intelie/lazytest "1.0.0-SNAPSHOT" :exclusions [swank-clojure]]
                     ])

and


996 $ ls ~/.lein/plugins/
lein-midje-1.0.7.jar        lein-noir-1.0.0.jar     lein-noir-1.1.0-SNAPSHOT.jar    swank-clojure-1.3.3.jar

... which looks the same as yours (except that I listed lazytest and used a later version of Midje). I didn't get the same failure as you did in the second lein swank. (It seemed to work, though I didn't try connecting from my emacs.)

Are you still seeing this problem?

denlab commented 12 years ago

I don't have any problem since midje-1.3.1

Should we close this issue?

Thanks!

marick commented 12 years ago

Happy to close an issue!

denlab commented 12 years ago

small victory!