Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-6893

Fix flexmojos testing results reporting when running a maven2 build for flex projects

    • Icon: Patch Patch
    • Resolution: Fixed
    • Icon: Major Major
    • core, (1)
      maven-plugin
    • None
    • maven2 + flexmojos > 3.5.0 + flex unit testing libraries

      When running flex related test cases in a maven2 build hudson will not retrieve the test results because it will only listen to surefire:test mojo. Flexmojos will behave similarly with surefire:test (put the results to target/surefire-results folder in the proper format) but Hudson will not pick the results after a build.

      One fix is to unconditionally run surefire:test on the project but in this way when the build fails the surefire:test mojos will not be run and the tests will not be picked up.

      This patch fixed the list of mojos observed by hudson for a maven build to treat flexmojos-maven-plugin:test-run mojo the same way it will treat a surefire:test mojo execution.

      The behaviour is the expected one:
      on a successfull build the test results are picked
      on a failed build the test results are picked too.

          [JENKINS-6893] Fix flexmojos testing results reporting when running a maven2 build for flex projects

          mtoader added a comment -

          I have patched my hudson instance right now and it works beautifully but it's a drag to have to rebuild the plugin every time hudson does a release. I also don't have any idea how to push this into the main build right now .

          mtoader added a comment - I have patched my hudson instance right now and it works beautifully but it's a drag to have to rebuild the plugin every time hudson does a release. I also don't have any idea how to push this into the main build right now .

          neiltingley added a comment - - edited

          I patched the source, rebuilt maven-plugin and deployed the hpi. Do I need to do anything else ? Not seeing hudson recording the test results.

          neiltingley added a comment - - edited I patched the source, rebuilt maven-plugin and deployed the hpi. Do I need to do anything else ? Not seeing hudson recording the test results.

          mtoader added a comment -

          Make sure the maven plugin that hudson is using is yours.
          Look in the manage hudson/plugins page that your version of the plugin is similar to this: "1.367-SNAPSHOT (private-07/20/2010 02:53-mtoader)". If not then hudson is not using your build. You should have pinned your version of the plugin. For example in the folder /var/lib/hudson/plugins that i am using for the installation i have a file name maven-plugin.hpi.pinned and the maven-plugin.hpi is the actual output of the build from the patched source.

          In order for it to work you have to have a maven + flexmojos enabled project and you have to run the tests using the flex mojos plugin (this should work by default if the project is swc/swf type and the flexmojos plugin is running the show). You can also check your flex module build page and look at the executed mojos link and see if it looks something like this:

          org.apache.maven.plugins:maven-clean-plugin 2.2 clean default-clean 12 ms
          org.apache.maven.plugins:maven-resources-plugin 2.3 resources default-resources 2 ms
          org.sonatype.flexmojos:flexmojos-maven-plugin 3.7.1 compile-swc default-compile-swc 7.9 sec
          org.apache.maven.plugins:maven-resources-plugin 2.3 testResources default-testResources 65 ms
          org.sonatype.flexmojos:flexmojos-maven-plugin 3.7.1 test-compile default-test-compile 5.8 sec
          org.sonatype.flexmojos:flexmojos-maven-plugin 3.7.1 test-run default-test-run 12 sec
          org.apache.maven.plugins:maven-install-plugin 2.2 install default-install 94 ms

          you want to have this line in there:

          org.sonatype.flexmojos:flexmojos-maven-plugin 3.7.1 test-run default-test-run 12 sec

          If all this is working it should work.

          mtoader added a comment - Make sure the maven plugin that hudson is using is yours. Look in the manage hudson/plugins page that your version of the plugin is similar to this: "1.367-SNAPSHOT (private-07/20/2010 02:53-mtoader)". If not then hudson is not using your build. You should have pinned your version of the plugin. For example in the folder /var/lib/hudson/plugins that i am using for the installation i have a file name maven-plugin.hpi.pinned and the maven-plugin.hpi is the actual output of the build from the patched source. In order for it to work you have to have a maven + flexmojos enabled project and you have to run the tests using the flex mojos plugin (this should work by default if the project is swc/swf type and the flexmojos plugin is running the show). You can also check your flex module build page and look at the executed mojos link and see if it looks something like this: org.apache.maven.plugins:maven-clean-plugin 2.2 clean default-clean 12 ms org.apache.maven.plugins:maven-resources-plugin 2.3 resources default-resources 2 ms org.sonatype.flexmojos:flexmojos-maven-plugin 3.7.1 compile-swc default-compile-swc 7.9 sec org.apache.maven.plugins:maven-resources-plugin 2.3 testResources default-testResources 65 ms org.sonatype.flexmojos:flexmojos-maven-plugin 3.7.1 test-compile default-test-compile 5.8 sec org.sonatype.flexmojos:flexmojos-maven-plugin 3.7.1 test-run default-test-run 12 sec org.apache.maven.plugins:maven-install-plugin 2.2 install default-install 94 ms you want to have this line in there: org.sonatype.flexmojos:flexmojos-maven-plugin 3.7.1 test-run default-test-run 12 sec If all this is working it should work.

          neiltingley added a comment -

          Thanks. pinning the plugin worked!

          This is new to me so I will read up on it. I'd just uploaded the plugin previously, getting something wrong somewhere in the process.

          neiltingley added a comment - Thanks. pinning the plugin worked! This is new to me so I will read up on it. I'd just uploaded the plugin previously, getting something wrong somewhere in the process.

          mtoader added a comment -

          I'm glad it works.

          pinning is the way hudson will allow you to override "core" plugins.

          mtoader added a comment - I'm glad it works. pinning is the way hudson will allow you to override "core" plugins.

          neiltingley added a comment -

          Is this fix being released anytime soon. It works for me.

          neiltingley added a comment - Is this fix being released anytime soon. It works for me.

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/reporters/SurefireArchiver.java
          trunk/www/changelog.html
          http://jenkins-ci.org/commit/34029
          Log:
          [FIXED JENKINS-6893] integrated toward 1.373.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/reporters/SurefireArchiver.java trunk/www/changelog.html http://jenkins-ci.org/commit/34029 Log: [FIXED JENKINS-6893] integrated toward 1.373.

          dogfood added a comment -

          Integrated in hudson_main_trunk #203
          [FIXED JENKINS-6893] integrated toward 1.373.

          kohsuke :
          Files :

          • /trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/reporters/SurefireArchiver.java
          • /trunk/www/changelog.html

          dogfood added a comment - Integrated in hudson_main_trunk #203 [FIXED JENKINS-6893] integrated toward 1.373. kohsuke : Files : /trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/reporters/SurefireArchiver.java /trunk/www/changelog.html

          neiltingley added a comment -

          Thanks guys.

          neiltingley added a comment - Thanks guys.

          Adrian Price added a comment -

          See linked JENKINS-31258 for a generalised solution for any unknown test-capable Maven plug-in.

          Adrian Price added a comment - See linked JENKINS-31258 for a generalised solution for any unknown test-capable Maven plug-in.

            mtoader mtoader
            mtoader mtoader
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: