cognitect-labs / test-runner

A test runner for clojure.test
Eclipse Public License 2.0
287 stars 31 forks source link

Not finding any tests to run #20

Closed chrismurrph closed 4 years ago

chrismurrph commented 5 years ago
clj -Atest -d src/test

Running tests in #{"src/test"}

Testing user

Ran 0 tests containing 0 assertions.
0 failures, 0 errors.

I don't understand why it is saying "Testing user". Is this the user namespace? The alias from deps.edn looks like this:

{:test {:extra-paths ["src/test"]
        :extra-deps {com.cognitect/test-runner {:git/url "https://github.com/cognitect-labs/test-runner.git" :sha "209b64504cb3bd3b99ecfec7937b358a879f55c1"}}
        :main-opts ["-m" "cognitect.test-runner"]}}

src/test is a directory off the project root directory, under which there are many namespaces that have many deftests in them.

chrismurrph commented 5 years ago

Looking at the source, the issue is with the function ns-filter, so looking for only namespaces: #".*-test$". For me that was a hidden default understanding that I didn't have. I'll rename my test namespaces now.

chrismurrph commented 5 years ago

Would it be okay for this sentence in the README to be changed: This will scan your project's test directory for any tests defined using clojure.test and run them. To be similar to this: This will scan your project's test directory for clojure.test deftests (in namespaces ending with "-test") and then run them.

puredanger commented 4 years ago

There is a -r option to set the ns-filter regex btw, which is documented as Defaults to #".*-test$.