GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-1221

Groovy tests in src/test/groovy ignored if no tests in src/test/java

    Details

    • Testcase included:
      yes
    • Number of attachments :
      1

      Description

      Steps to Reproduce

      1. Extract the attachment.
      2. Run mvn test

      -------------------------------------------------------
       T E S T S
      -------------------------------------------------------
      There are no tests to run.
      
      Results :
      
      Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
      

      3. See that src/test/groovy/com/kp/BuildInfoTest.groovy exists, and be confused

      Workaround

      Simply move src/test/groovy/com/kp/BuildInfoTest.groovy to src/test/java/com/kp/BuildInfoTest.groovy

      (The test will fail, but that's irrelevant for this. It just points out the fact that the test actually ran.)

        Activity

        Hide
        Andrew Eisenberg added a comment -

        A workaround — rename src/main/groovy to src/main/java and things work fine.

        Show
        Andrew Eisenberg added a comment - A workaround — rename src/main/groovy to src/main/java and things work fine.
        Hide
        Marc von Renteln added a comment -

        Thanks for your fast reply. I will use the workaround. My intention was to show this problem with other plugins...

        Show
        Marc von Renteln added a comment - Thanks for your fast reply. I will use the workaround. My intention was to show this problem with other plugins...
        Hide
        Andrew Eisenberg added a comment -

        The problem is in groovy-mojo-tools. The class GroovyMojoDescriptorExtractor, line 71. It is adding src/main/groovy a second time even if it already exists. There is a section:

                //
                // FIXME: Shouldn't need to hard-code this...
                //
                sourceRoots.add("src/main/groovy");
        

        And the comment is correct. This shouldn't be hardcoded. At the very least, the check should see if src/main/groovy is already on the path and if so, not add it a second time.

        As you said, you don't know who maintains this plugin. I would recommend forking the plugin for now and seeing if you can get this to work. Anyway, this bug is different from the bug originally reported in this issue, so if you have any more problems, please raise a new issue.

        Show
        Andrew Eisenberg added a comment - The problem is in groovy-mojo-tools . The class GroovyMojoDescriptorExtractor, line 71. It is adding src/main/groovy a second time even if it already exists. There is a section: // // FIXME: Shouldn't need to hard-code this ... // sourceRoots.add( "src/main/groovy" ); And the comment is correct. This shouldn't be hardcoded. At the very least, the check should see if src/main/groovy is already on the path and if so, not add it a second time. As you said, you don't know who maintains this plugin. I would recommend forking the plugin for now and seeing if you can get this to work. Anyway, this bug is different from the bug originally reported in this issue, so if you have any more problems, please raise a new issue.
        Hide
        Marc von Renteln added a comment -

        OK, thanks! I will fork the plugin and see what I can do there.

        Show
        Marc von Renteln added a comment - OK, thanks! I will fork the plugin and see what I can do there.
        Hide
        Andrew Eisenberg added a comment -

        I've done just about all I can do here. I will update the documentation to describe the various ways of setting up your source folders.

        The 2.6.0-01 version has been released.

        Show
        Andrew Eisenberg added a comment - I've done just about all I can do here. I will update the documentation to describe the various ways of setting up your source folders. The 2.6.0-01 version has been released.

          People

          • Assignee:
            Andrew Eisenberg
            Reporter:
            The Alchemist
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: