[rspec-users] Spec run heuristics (Re: Cucover: coverage-aware 'lazy' cucumber runs)

Ben Mabey ben at benmabey.com
Mon Apr 13 11:39:14 EDT 2009

Kero van Gelder wrote:
>> That would be very cool, you have lots of good ideas there.  Being able  
>> to plug in your own file-change strategy would be killer.  Another cool  
>> idea I ran across the other idea is being able to specify in your  
>> examples that which ones are "focussed".  Meaning, autotest will only  
>> run the focussed ones and not bother running the entire suite. Once you  
>> have solved the problem at hand you remove the focussed tag and the  
>> whole suite is then ran.  This idea, *which is already implemented*,  
>> comes from Micronaut[1].  The idea is very similar to Cucumber's and  
>> RSpec's[2] tagging feature (yet to come for rspec).  The cool thing  
>> about micronaunt is that they have tied it into autotest.  Ideally, we  
>> could be able to tell autotest, or whatever program, to only run tests  
>> that are tagged a certain way-- and then you could override that with  
>> the "focused" tag.  So, we can add that to our list of cool things to  
>> have. :)
> Are you saying you want multiple tags and let autotest do logic on them?
>  - run everything "focus and current_feature"
>  - run everything "current_feature or related_to_it"
> Or are you saying you should explicitely specified which test went wrong
> (would it be nice if autotest just ran all your recently failed features
> first and the rest later; compared to the last failure only, as it is
> supposed to do now, afaik; perhaps after running previously failed
> features, it can run newest features first, finally followed by the other
> features).
The way micronaut currently works is that when you tag an example or 
example group as "focussed" autotest will only run those.  So you are 
overriding it's default behaviour and not running the entire suite.

> Or are you saying it's going to be separate from tags completely?
> I'm feeling my first idea will run out of hand (adding complexity,
> while not solving a specific need), the third sounds bad from a
> technical Point of view. The second one comes from the observation
> that "focussing" is a process, not a property. You state
>   "you remove the focussed tag"
> yourself. "important" could be a property, if you don't remove it.

Yeah, it is a process and that is what I like about it.  When working on 
a large suite it is impractical to run the entire suite in conjunction 
with autotest.  So, you end up running them by hand.  I really like 
using autotest though and so by providing this feature one can still use 
autotest in there workflow/process when working on new functionality in 
a large project.

I haven't used it too much, but it seems like a really useful thing to 
have.  Having autotest act on multiple tags may get too complicated, but 
I think the "focussed" tag is pretty straightforward.


> Bye,
> Kero.
> ___
> How can I change the world if I can't even change myself?
>   -- Faithless, Salva Mea
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list