cemerick / clojurescript.test

A maximal port of `clojure.test` to ClojureScript. DEPRECATED
165 stars 32 forks source link

Reporting is broken for async tests? #82

Closed chadharrington closed 9 years ago

chadharrington commented 9 years ago

When running async clojurescript tests, we always get this output (0 tests, 0 assertions), even though the tests are actually running:

Running ClojureScript test: unit-tests

Testing farbetter.mealy-test 

Ran 0 tests containing 0 assertions.
Waiting on 6 asynchronous tests to complete.

Testing farbetter.mealy-test (async)

You can see this behavior by cloning our mealy repostitory and running lein testcljs.

$ git clone git@github.com:farbetter/mealy.git
$ cd mealy
$ lein testcljs

Once we realized that the tests were actually running (they show errors correctly if they fail), we learned to just ignore the 0 tests / 0 assertions line. However, it seems like this could be fixed, yes?

Thanks for your efforts on this and many other projects.

cemerick commented 9 years ago

The 0/0 output is referring to synchronous tests. Do you not get a final summary after the async tests finish?

Test output changed with 0.3.2 (via #66); are you using it?

chadharrington commented 9 years ago

We are using 0.3.2, with the same results. It's good to know that 0/0 is for synchronous tests. Perhaps the output could say "Ran 0 synchronous test containing 0 assertions."

We still don't see the report from the async tests. Here is the full output from my terminal:

~/src/farbetter/mealy $ lein testcljs
Rewriting src/cljx to target/generated/src/clj (clj) with features #{clj} and 0 transformations.
Rewriting src/cljx to target/generated/src/cljs (cljs) with features #{cljs} and 1 transformations.
Rewriting test/cljx to target/generated/test/clj (clj) with features #{clj} and 0 transformations.
Rewriting test/cljx to target/generated/test/cljs (cljs) with features #{cljs} and 1 transformations.
Compiling ClojureScript.
Compiling "target/main.js" from ["target/generated/src/cljs"]...
Successfully compiled "target/main.js" in 17.007 seconds.
Compiling "target/unit-test.js" from ["target/generated/src/cljs" "target/generated/test/cljs"]...
Successfully compiled "target/unit-test.js" in 25.389 seconds.
Compiling ClojureScript.
Running ClojureScript test: unit-tests

Testing farbetter.mealy-test 

Ran 0 tests containing 0 assertions.
Testing complete: 0 failures, 0 errors.
Waiting on 6 asynchronous tests to complete.

Testing farbetter.mealy-test (async)
~/src/farbetter/mealy $ 

Feel free to clone the repo to see if you can replicate. Thanks.

cemerick commented 9 years ago

I've disambiguated the first test result summary. However, I think the non-reporting of async tests is actually due to a recent core.async change that ended up being incompatible with the test runner script for phantom and slimer.

A fix is available in 0.3.3-SNAPSHOT. Let me know if it improves the situation.

FYI, the test reporting output should look like so:

https://travis-ci.org/cemerick/clojurescript.test/jobs/43879687#L489-L518

chadharrington commented 9 years ago

0.3.3-SNAPSHOT works! Thanks!

cemerick commented 9 years ago

Great, thanks for testing. Proper release coming shortly.