Gradle
  1. Gradle
  2. GRADLE-2111

Provide first-class support for JUnit @Category

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6-rc-1

      Description

      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

      { ... }

      closure.

        Activity

        Hide
        Diwaker Gupta
        added a comment -

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

        Show
        Diwaker Gupta
        added a comment - This is a blocker for us to adopt Gradle. Any estimates on timeline or roadmap will be much appreciated!
        Hide
        Martin Stockhammer
        added a comment -

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

        Show
        Martin Stockhammer
        added a comment - Yes, it would be great, if this feature could be implemented.
        Hide
        Adam Murdoch
        added a comment -

        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.

        Show
        Adam Murdoch
        added a comment - 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.
        Hide
        Chuck May
        added a comment -

        Definitely something I would love as well.

        Show
        Chuck May
        added a comment - Definitely something I would love as well.
        Hide
        Andrei Dulvac
        added a comment -

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

        Show
        Andrei Dulvac
        added a comment - Any updates on whether/ when this will be dealt with?
        Hide
        Jeff Yemin
        added a comment -

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

        Show
        Jeff Yemin
        added a comment - How many votes do we need to make it a high priority?
        Hide
        Uladzimir Mihura
        added a comment - - edited

        https://github.com/gradle/gradle/pull/140

        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
        

        Configuration:

        test{
           useJUnit(){
               includeGrous 'org.foo.Functional', 'org.foo.Acceptance'
               excludeGroups 'org.foo.Slow'
           }
        }
        

        Logic of group algebra:
        https://github.com/gradle/gradle/pull/140/files#L1R134

        Please review it.

        -vova

        Show
        Uladzimir Mihura
        added a comment - - edited https://github.com/gradle/gradle/pull/140 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 Configuration: test{ useJUnit(){ includeGrous 'org.foo.Functional', 'org.foo.Acceptance' excludeGroups 'org.foo.Slow' } } Logic of group algebra: https://github.com/gradle/gradle/pull/140/files#L1R134 Please review it. -vova
        Hide
        Jeff Yemin
        added a comment -

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

        Show
        Jeff Yemin
        added a comment - Thank you Uladzmir for implementing this. I hope it gets accepted.

          People

          • Assignee:
            René Gröschke
            Reporter:
            Chris Beams
          • Votes:
            14 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: