[GRADLE-2111] Provide first-class support for JUnit @Category Created: 21/Feb/12  Updated: 19/Mar/13  Resolved: 19/Mar/13

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 1.6-rc-1

Type: Improvement
Reporter: Chris Beams Assignee: René Gröschke (Inactive)
Resolution: Fixed Votes: 14


Use case:

In the Spring Framework, we have many 'timed tests' designed to ensure that certain CPU-intensive areas of the framework perform well. However, depending on clock speed and number of CPUs/cores, these tests may fail on certain machines, resulting in a false negative results. We would like to mark these tests with JUnit's @Category annotation, e.g. where the category is "performance", or "timed" and run these once daily on a CI server with a known-good baseline configuration.

In order to do this most effectively, we'd like to see support at the Gradle DSL level allowing us to include/exclude a given @Category (or categories) much in the same way that one can include/exclude paths currently within the test

{ ... }


Comment by Diwaker Gupta [ 08/Sep/12 ]

This is a blocker for us to adopt Gradle. Any estimates on timeline or roadmap will be much appreciated!

Comment by Martin Stockhammer [ 01/Feb/13 ]

Yes, it would be great, if this feature could be implemented.

Comment by Adam Murdoch [ 02/Feb/13 ]

We would like to support this, but unfortunately it's not high on the priority list for us at the moment. Perhaps someone would like to help out with adding this feature? If so, let us know on the dev mailing list.

Comment by Chuck May [ 05/Mar/13 ]

Definitely something I would love as well.

Comment by Andrei Dulvac [ 06/Mar/13 ]

Any updates on whether/ when this will be dealt with?

Comment by Jeff Yemin [ 11/Mar/13 ]

How many votes do we need to make it a high priority?

Comment by Uladzimir Mihura [ 12/Mar/13 ]


For anyone want's to test - you can grab repo from my fork and build it with:

gradle clean install -Pgradle_installPath=/path_to_be_installed


       includeGrous 'org.foo.Functional', 'org.foo.Acceptance'
       excludeGroups 'org.foo.Slow'

Logic of group algebra:

Please review it.


Comment by Jeff Yemin [ 12/Mar/13 ]

Thank you Uladzmir for implementing this. I hope it gets accepted.

Generated at Wed Jun 30 12:13:05 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.