On 13 Nov 2013, at 7:36 am, Szczepan Faber <szczepan.fa...@gradleware.com> 
wrote:

> Heya,
> 
> I'm keen on solving this use case: developer in a large app has tons of long 
> running tests. He wants to run only a *single* test from the command line 
> (e.g. we currently support *all* tests from a *single* test class via 
> test.single).
> 
> There's also a pull request: https://github.com/gradle/gradle/pull/193 that 
> shows that the community is also keen on getting it sorted out.
> 
> How do we want approach this?
> 
> 1. Make the test.includes / test.excludes more robust and support some kind 
> of notation like "SomeTest#someMethod". This is kind of awkward because Test 
> extends PatternFilterable that clearly defines what are includes and excludes 
> (they are not test methods, they are ant file patterns). On the plus side, 
> this would work with our existing means of specifying includes/excludes 
> (existing DSL, existing test.single property)
> 
> 2. Add some new API for this, for example:
> 
> test.selection.include ...
> 
> It might be good to put the test selection api behind some new DSL 
> layer/object (e.g. 'selection') because it can potentially grow: 
> include/exclude tests by some custom criteria, e.g. test class hierarchy, 
> etc. BTW. for the latter we have use cases in our own codebase (cross version 
> tests now are picked up by naming convention but it would be nicer if they 
> were picked up by parent class, etc.).
> 
> If we go down this path, we need to add command line support for it and 
> perhaps consider deprecation of the existing include / exclude.
> 
> Do we have some other options? Thoughts?

I’d go with option #2. The current includes and excludes are really intended to 
specify where to look for tests. Option 2 adds another filter over this to 
specify some criteria to use for selecting tests (beyond where they physically 
live).

I’d also add command-line support and deprecate the system property.


--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com



Reply via email to