Closed jcf closed 7 years ago
Thanks! It looks good. I think we can shorten the commit message on the third commit, however. Something like:
Change run-tests to return a summary map
The summary map contains keys for :duration, :error, :fail, :pass and
:test. This makes it possible to programmatically determine whether a
test run succeeded or failed.
I've changed the commit message to your terser version.
Hey James,
Hope this finds you well.
I was hoping to add some tests but it's tricky testing the tests, as I'm sure you're aware. I thought about adding a nested Leiningen project and shelling out to make sure we do the right thing, but with the progress bar and additional complexity…
This PR returns the hash-map of test summary info so we can programmatically do things. The commit below describes what's going on. Oh, and I snuck a small documentation fix in that I thought you'd be cool with. If you'd prefer it in a separate PR please cherry pick it out.
All the best old friend,
Other James
Previously running tests via
eftest.runner/run-tests
would returnnil
making it impossible to know if we have a green/red build. This change returns a map of information similar to that of clojure.test itself (with an additional:duration
key-value pair that describes how long our tests took to run).This change makes it possible to use eftest's
run-tests
programmatically, which allows us to use eftest in CI and other systems where we may need to forward the success or failure of a given test run to some external system.The return value of a test run now looks something like this:
This new return value means you can something like this:
Note the use of
Math/max
. You can't use a status code larger than 255!Fixes #3.