-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for LazyTest? #48
Comments
I think I would much rather add support not by hacking it in like this, but by reworking test-runner to insert a test framework abstraction, and then implement that for both clojure.test and lazytest. For things like output reporting, that could then be pluggable as well, so as to open up support for clojure.test output reporters (see #5). Should also consider whether there are other frameworks to include. I know test.check has some bridges into clojure.test but maybe that's a good example of something that could be better integrated and more configurable - surfacing rep counts for example. This is probably some (but not a lot?) work to figure out, but I would much rather do that than to merge these changes in as is. We could collab on that if you want to, or you could just wait for me to define the abstraction and create the lazytest implementation, I don't know what your urgency or availability is in that regard. |
Thanks. Yes, I figured the current approach would be considered too "hacky" -- I'm not entirely happy with it either, if only because you end up with multiple passes over the nses: one for each test framework, and there's the issue of mapping options from the CLI to each framework ( Everything is a lot simpler when you're only dealing with one test framework. Since I'm now effectively maintaining two test runners that both support However, an "ideal" world would see |
Also open to working on clojure.test stuff, I know the recent ask at https://clojure.atlassian.net/browse/CLJ-2882 is probably in this vein. |
Yeah, some of the problems listed/referenced in that ticket were motivations for moving forward with LazyTest, I suspect. I would be interested in collaborating on |
I've been giving this some thought, and the common structure is something along these lines:
A protocol can be provided for those last three steps, and a fully-qualified symbol (FQS) for the create / initialize function would need to be provided to To handle alternative output formats, for The The default FQS for Thoughts? |
I think this is a good breakdown, I would be interested in seeing a structure like that. Curious if a 3rd data point (spec.test?, expectations?) would add or change anything. FQS stuff makes sense. You are thinking that multiple test runners run and choose their own subsets? Or that just one runner runs in an execution? |
The The protocol implementation would then do additional filtering, running of the actual tests, and restoring the state if needed. I would expect a LazyTest implementation of the protocol to run both Expectations is purely I haven't looked at |
Currently, Cognitect's
test-runner
supports any testing library that is compatible withclojure.test
, such as Expectations.LazyTest is a new testing library that is built from scratch to provide a more expressive style than either
clojure.test
or Expectations, and it addresses a lot of the criticisms that Sierra had about the implementation ofclojure.test
. However, since it doesn't use theclojure.test
"runner" functions, tooling has to choose to explicitly add support for it.I have a working fork of
test-runner
that relies onrequiring-resolve
(and therefore Clojure 1.10), to dynamically support LazyTest at runtime, if it is on the classpath. It matches most of thetest-runner
CLI options to equivalent ones in LazyTest, and will use LazyTest "runner" functions to run any LazyTest tests it finds, in addition to using theclojure.test
"runner" functions to run any standard tests it finds.It essentially makes two passes over the tests: the first for
clojure.test
tests, and the second for LazyTest tests.The text was updated successfully, but these errors were encountered: