Ah, you're right. Thanks for helping me understand.

Now, the runner and discoverer logic are separated.

Here's the function that calls the runner, passing in a finder:
https://github.com/evanescence/test2/blob/master/src/test2/run.clj
Here's the default runner, and how it uses the finder:
https://github.com/evanescence/test2/blob/master/src/test2/default/runner.clj


On Tue, Jun 11, 2013 at 5:12 PM, Michał Marczyk <michal.marc...@gmail.com>wrote:

> On 11 June 2013 14:42, Steven Degutis <sbdegu...@gmail.com> wrote:
> > Timothy, Brandon, Cedric, et al.:
> >
> > Separating out the Discoverer from the Runner in the SPEC is a bad idea.
> >
> > The main benefit mentioned so far for such a separation is so we can have
> > different definitions of what constitutes a test. For example,
> > test.generative can generate multiple tests from just one block of code.
>
> At least in this thread, the key benefit -- IMO -- was mentioned by
> Brandon (a few e-mails upthread from the one I'm replying to):
>
> On 11 June 2013 01:53, Brandon Bloom <brandon.d.bl...@gmail.com> wrote:
> > I
> > might want to just ask "What tests do I have?" without actually running
> > anyway. I may also want a different Executor, like a distributed/parallel
> > executor, while preserving the discovery logic.
>
> So, even if the discovery logic was completely fixed by the spec,
> there's still value in having it separated from the runner.
>
> (For example with clojure.test it's trivial to discover what tests are
> available without running any -- (->> 'test.ns ns-interns vals (filter
> (comp :test meta))). I imagine it'll probably be the case with any
> other framework, but if this effort is specifically about decoupling,
> why have every separate runner reimplement the same discovery logic?)
>
> Cheers,
> Michał
>
>
> >
> > But this creates the same incompatibility problem that we already have
> > between existing test suites. Instead, if we have a single definition of
> a
> > test, every definer is compatible with another.
> >
> > And the current definition is already flexible enough to let you generate
> > multiple tests based on one block of code, like test.generative does.
> >
> >
> > On Tue, Jun 11, 2013 at 1:57 AM, Cedric Greevey <cgree...@gmail.com>
> wrote:
> >>
> >> You pass not the Discoverer's results to the Runner, but the Discoverer
> >> itself, which the Runner then invokes at need, possibly more than once.
> >>
> >>
> >> On Tue, Jun 11, 2013 at 1:35 AM, Steven Degutis <sbdegu...@gmail.com>
> >> wrote:
> >>>
> >>> Originally we had Runner split into Discoverer and Runner, but I had to
> >>> combine them both in Runner again so that we can have an autorunner.
> >>>
> >>> Imagine that you've started your autorunner at the command line, and
> you
> >>> create a new test in your existing file and save it. The discoverer has
> >>> already done his role and found all existing tests and passed them to
> the
> >>> runner, so the runner can't see your new test, he only re-runs the
> tests
> >>> that existed when he first started.
> >>>
> >>> That's why I combined them again. So that he could re-discover all the
> >>> tests "matching some criteria" and run them.
> >>>
> >>> So how do you solve this problem while separating Discoverer from
> Runner?
> >>>
> >>>
> >>> On Mon, Jun 10, 2013 at 6:53 PM, Brandon Bloom
> >>> <brandon.d.bl...@gmail.com> wrote:
> >>>>
> >>>> There are currently 4 roles defined: Definer, Asserter, Runner, and
> >>>> Reporter.
> >>>>
> >>>> It looks like the "Runner" does finding, filtering, and execution. I
> >>>> think you could further break the Runner down into Discoverer and
> Executor.
> >>>> I might want to just ask "What tests do I have?" without actually
> running
> >>>> anyway. I may also want a different Executor, like a
> distributed/parallel
> >>>> executor, while preserving the discovery logic.
> >>>>
> >>>> On Saturday, June 8, 2013 11:14:42 AM UTC-4, Steven Degutis wrote:
> >>>>>
> >>>>> Test2 is a new testing lib for Clojure, where the power is its
> >>>>> simplicity, extensibility, and a SPEC much like Ring's.
> >>>>>
> >>>>> Github: https://github.com/evanescence/test2
> >>>>>
> >>>>> Some background: It came out of discussions with the smart folks in
> >>>>> #clojure, who were frustrated with the inflexibility of existing
> libs, and
> >>>>> intended this to be the spiritual successor to clojure.test. We
> wanted
> >>>>> something that was still simple like clojure.test, but could be
> extended
> >>>>> externally much more easily in case you wanted features found in
> >>>>> clojure.test, Midje, Speclj, or Expectations, or whatever else.
> >>>>>
> >>>>> This is a pre-ANN because it's more of a call for extensions. I've
> >>>>> written one last night, test2-autorunner, which took about an hour.
> This
> >>>>> should give some idea of how easy it is and how well-designed the
> SPEC was
> >>>>> by the smart folks of #clojure. There are some ideas at the bottom
> of the
> >>>>> wiki, but of course any extensions are encouraged.
> >>>>>
> >>>>> -Steven
> >>>>
> >>>> --
> >>>> --
> >>>> You received this message because you are subscribed to the Google
> >>>> Groups "Clojure" group.
> >>>> To post to this group, send email to clojure@googlegroups.com
> >>>> Note that posts from new members are moderated - please be patient
> with
> >>>> your first post.
> >>>> To unsubscribe from this group, send email to
> >>>> clojure+unsubscr...@googlegroups.com
> >>>> For more options, visit this group at
> >>>> http://groups.google.com/group/clojure?hl=en
> >>>> ---
> >>>> You received this message because you are subscribed to the Google
> >>>> Groups "Clojure" group.
> >>>> To unsubscribe from this group and stop receiving emails from it, send
> >>>> an email to clojure+unsubscr...@googlegroups.com.
> >>>> For more options, visit https://groups.google.com/groups/opt_out.
> >>>>
> >>>>
> >>>
> >>>
> >>> --
> >>> --
> >>> You received this message because you are subscribed to the Google
> >>> Groups "Clojure" group.
> >>> To post to this group, send email to clojure@googlegroups.com
> >>> Note that posts from new members are moderated - please be patient with
> >>> your first post.
> >>> To unsubscribe from this group, send email to
> >>> clojure+unsubscr...@googlegroups.com
> >>> For more options, visit this group at
> >>> http://groups.google.com/group/clojure?hl=en
> >>> ---
> >>> You received this message because you are subscribed to the Google
> Groups
> >>> "Clojure" group.
> >>> To unsubscribe from this group and stop receiving emails from it, send
> an
> >>> email to clojure+unsubscr...@googlegroups.com.
> >>> For more options, visit https://groups.google.com/groups/opt_out.
> >>>
> >>>
> >>
> >>
> >> --
> >> --
> >> You received this message because you are subscribed to the Google
> >> Groups "Clojure" group.
> >> To post to this group, send email to clojure@googlegroups.com
> >> Note that posts from new members are moderated - please be patient with
> >> your first post.
> >> To unsubscribe from this group, send email to
> >> clojure+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >> http://groups.google.com/group/clojure?hl=en
> >> ---
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Clojure" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an
> >> email to clojure+unsubscr...@googlegroups.com.
> >> For more options, visit https://groups.google.com/groups/opt_out.
> >>
> >>
> >
> >
> > --
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to clojure@googlegroups.com
> > Note that posts from new members are moderated - please be patient with
> your
> > first post.
> > To unsubscribe from this group, send email to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "Clojure" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to clojure+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to