Grails
  1. Grails
  2. GRAILS-7346

Grails 1.4-M1 gradle build can no longer run a single test

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: 1.4-M1
    • Fix Version/s: 1.4-M1
    • Component/s: None
    • Labels:
      None

      Description

      In the upgrade from gradle .9 to 1.0 it looks like the ability to run a single test has been deleted (or the documentation for how to do it needs to be updated).

      The grails documentation for Dev setup talks about how to do this: http://grails.org/GrailsDevEnvironment

      In checking out the 1.3.7 tag, I'm able to successfully run this command:

      ./gradlew testSingleMappingDsl
      

      It runs successfully and finishes testing fairly quickly without running the full suite of tests:

      % ./gradlew testSingleMappingDsl
      :compileJava UP-TO-DATE
      :compileGroovy UP-TO-DATE
      :processResources UP-TO-DATE
      :classes UP-TO-DATE
      :coreJar UP-TO-DATE
      :compileTestJava UP-TO-DATE
      :compileTestGroovy UP-TO-DATE
      :processTestResources UP-TO-DATE
      :testClasses UP-TO-DATE
      :testSingleMappingDsl
      Application context shutting down...
      Application context shutdown.
      
      BUILD SUCCESSFUL
      
      Total time: 27.33 secs
      

      In the current master for 1.4 (595f0e6c1a9a99bfdcb4752807efe0c7d541a860), running a single test doesn't work:

      % ./gradlew testSingleMappingDsl
      
      FAILURE: Could not determine which tasks to execute.
      
      * What went wrong:
      Task 'testSingleMappingDsl' not found in root project 'grails-core'.
      
      * Try:
      Run gradlew tasks to get a list of available tasks.
      
      BUILD FAILED
      
      Total time: 4.441 secs
      

        Activity

        Hide
        Jeff Scott Brown added a comment -

        We have removed our own testSingle* support in favor of the -Dtest.single=TestName support provided by Gradle out of the box.

        Show
        Jeff Scott Brown added a comment - We have removed our own testSingle* support in favor of the -Dtest.single=TestName support provided by Gradle out of the box.
        Hide
        Ted Naleid added a comment -

        Thanks, I had trouble getting it to work, but it turns out that you can't use just the "test" target, you need to scope it to the test suite that the test exists in.

        So this doesn't work:

        ./gradlew -Dtest.single=MappingDslTes test
        

        but this does:

        ./gradlew -Dtest.single=MappingDslTest grails-test-suite-persistence:test
        

        I've updated the documentation on http://grails.org/GrailsDevEnvironment to reflect this change.

        Show
        Ted Naleid added a comment - Thanks, I had trouble getting it to work, but it turns out that you can't use just the "test" target, you need to scope it to the test suite that the test exists in. So this doesn't work: ./gradlew -Dtest.single=MappingDslTes test but this does: ./gradlew -Dtest.single=MappingDslTest grails-test-suite-persistence:test I've updated the documentation on http://grails.org/GrailsDevEnvironment to reflect this change.

          People

          • Assignee:
            Jeff Scott Brown
            Reporter:
            Ted Naleid
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development