Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.2
    • Fix Version/s: 1.1-beta1
    • Component/s: Configuration
    • Labels:
      None
    • Patch Submitted:
      Yes

      Description

      I want to reopen the improvement idea of having TestApp.groovy look after cleaning its test/reports directory.

      This is in issue GRAILS-1212 and a few others.

      I know that the Clean.groovy has this sort of task, but I want it removed from the Clean.groovy.

      My justification for this move is that Clean command is to grand and contains logic that really belongs to TestApp command. The proof that the logic is in the wrong place is that the task contains a hardcoded path:

      Ant.delete(dir:"$

      {basedir}/test/reports", failonerror:false)

      The TestApp.groovy has a variable defined as

      testDir = "${basedir}

      /test/reports"

      And thus I would like the following in the TestApp.groovy

      Ant.delete(includeEmptyDirs:false, failonerror:false) {
      fileset(dir:"$

      {testDir}

      ", includes:"*/*")
      }

        Activity

        Hide
        Trevor Hawrysh added a comment -

        Further thoughts and comments on this issue.

        This issue came to light when we added our grails project to our cruisecontrol server for continuous build.

        Our main build loop is:

        grails clean
        cvs update working_dir
        grails customScriptStuff
        grails test-app
        grails -Dgrails.env=DEV war
        grails -Dgrails.env=QA war
        grails -Dgrails.env=PROD war
        cvs tag working_dir

        Then when the build loop completes cruisecontrol collects the war artifacts and the test results. But the way Clean.groovy is today, the grails war command depends on compile, which depends on clean.

        The test results were gone until I changed Clean.groovy and TestApp.groovy as mentioned above.

        However, a new issue was discovered. Since the clean of the test results does not happen till the test-app part of the build loop, we had test results when the build actually failed running some of our customScript commands.

        I would like to see Clean.groovy to have two new things:
        1. Not have any specific clean tasks in it, but rather delegate a command to each of the other scripts like TestApp.groovy, Package.groovy, etc
        2. an option like -all to execute the clean in the other scripts.

        I would then have the build loop as:

        grails clean -all (This would delegate to other scripts and clean up temp resources)
        cvs update working_dir
        grails customScriptStuff
        grails test-app (clean is not required as the "Big" clean is complete)
        grails -Dgrails.env=DEV war
        grails -Dgrails.env=QA war
        grails -Dgrails.env=PROD war
        cvs tag working_dir

        Then the TestApp.groovy should call it's own clean when the command test-app is called on its own.

        Show
        Trevor Hawrysh added a comment - Further thoughts and comments on this issue. This issue came to light when we added our grails project to our cruisecontrol server for continuous build. Our main build loop is: grails clean cvs update working_dir grails customScriptStuff grails test-app grails -Dgrails.env=DEV war grails -Dgrails.env=QA war grails -Dgrails.env=PROD war cvs tag working_dir Then when the build loop completes cruisecontrol collects the war artifacts and the test results. But the way Clean.groovy is today, the grails war command depends on compile, which depends on clean. The test results were gone until I changed Clean.groovy and TestApp.groovy as mentioned above. However, a new issue was discovered. Since the clean of the test results does not happen till the test-app part of the build loop, we had test results when the build actually failed running some of our customScript commands. I would like to see Clean.groovy to have two new things: 1. Not have any specific clean tasks in it, but rather delegate a command to each of the other scripts like TestApp.groovy, Package.groovy, etc 2. an option like -all to execute the clean in the other scripts. I would then have the build loop as: grails clean -all (This would delegate to other scripts and clean up temp resources) cvs update working_dir grails customScriptStuff grails test-app (clean is not required as the "Big" clean is complete) grails -Dgrails.env=DEV war grails -Dgrails.env=QA war grails -Dgrails.env=PROD war cvs tag working_dir Then the TestApp.groovy should call it's own clean when the command test-app is called on its own.
        Hide
        Peter Ledbrook added a comment -

        Here's what happens with 1.1 now:

        1. "grails test-app" deletes the test reports directory before running the tests. No other clean is performed.
        2. "grails war" only deletes the old WAR file - it no longer forces a recompilation.
        3. The "_GrailsClean" script has both "clean" and "cleanAll" targets (the latter includes the test reports).
        4. "compile" does not depend on "clean".

        There have actually been quite a few changes, but I believe the above covers what you need. If you have any questions, just add them as a comment to the issue. We can re-open if that proves necessary.

        Show
        Peter Ledbrook added a comment - Here's what happens with 1.1 now: 1. "grails test-app" deletes the test reports directory before running the tests. No other clean is performed. 2. "grails war" only deletes the old WAR file - it no longer forces a recompilation. 3. The "_GrailsClean" script has both "clean" and "cleanAll" targets (the latter includes the test reports). 4. "compile" does not depend on "clean". There have actually been quite a few changes, but I believe the above covers what you need. If you have any questions, just add them as a comment to the issue. We can re-open if that proves necessary.
        Hide
        Graeme Rocher added a comment -

        Bulk closing bunch of resolved issues

        Show
        Graeme Rocher added a comment - Bulk closing bunch of resolved issues

          People

          • Assignee:
            Peter Ledbrook
            Reporter:
            Trevor Hawrysh
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 30 minutes
              30m
              Remaining:
              Remaining Estimate - 30 minutes
              30m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development