Grails
  1. Grails
  2. GRAILS-8263

Provide an option for "grails test-app" to run all tests of the project and the in-place-plugins and merge the test-results

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0-RC1
    • Fix Version/s: None
    • Labels:
    • Environment:
      kubuntu 11.10, grails 2.0.0.RC1, jvm 1.6.24

      Description

      It would be nice to have an option for
      grails test-app
      to include the tests of dependent in-place-plugins in the test-run.

      What would make it even better is if the developer is presented with merged test-results.

      For now on CI there are several grails build tasks necessary to build a multi-module project.

      Plugins should be consistent and tested, so pulling up all tests into the project-level is not a good solution. Test should lay along to the code they test.

        Activity

        Hide
        Nicolas Noullet added a comment -

        I found a workaround to tackle this issue by copying tests from the plugins to the main project:
        1) when compiling tests, I copy test classes from the plugin to the main project,
        2) when tests end, I delete the tests in the main project (in the example below, I delete all the tests).

        Here is the _Events.groovy content to hook the right events (for a given foo in-place plugin and integration tests):

        eventTestCompileStart = {testType ->
        println "Copying tests from the plugin to the project (test type: " + testType.name + ')';
        ant.copy(todir: "$

        {basedir}/test/integration") { fileset(dir: "$fooPluginDir/test/integration") }
        }

        eventTestPhasesEnd = {
        println "Deleting tests from the project"
        ant.delete(){fileset(dir: "${basedir}

        /test/integration")}
        }

        Show
        Nicolas Noullet added a comment - I found a workaround to tackle this issue by copying tests from the plugins to the main project: 1) when compiling tests, I copy test classes from the plugin to the main project, 2) when tests end, I delete the tests in the main project (in the example below, I delete all the tests). Here is the _Events.groovy content to hook the right events (for a given foo in-place plugin and integration tests): eventTestCompileStart = {testType -> println "Copying tests from the plugin to the project (test type: " + testType.name + ')'; ant.copy(todir: "$ {basedir}/test/integration") { fileset(dir: "$fooPluginDir/test/integration") } } eventTestPhasesEnd = { println "Deleting tests from the project" ant.delete(){fileset(dir: "${basedir} /test/integration")} }
        Hide
        Nicolas Noullet added a comment -

        I noticed that eventTestPhasesStart is more relevant than eventTestCompileStart for this hack.

        Show
        Nicolas Noullet added a comment - I noticed that eventTestPhasesStart is more relevant than eventTestCompileStart for this hack.

          People

          • Assignee:
            Unassigned
            Reporter:
            Konstantinos Kostarellis
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Last Reviewed:

              Development