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

Add ability to get test results for a given Maven execution

XMLWordPrintable

      The problem is that our Jenkins file is using parallel() and executes several maven builds (using withMaven).

      We then have some custom logic after each maven execution to analyze failing tests. The problem is that they accumulate in "currentBuild" and we cannot find the tests related to the maven execution that just happened.

      FYI the way we retrieve failing tests is:

      AbstractTestResultAction testResultAction = currentBuild.rawBuild.getAction(AbstractTestResultAction.class)
      def failedTests = testResultAction.getResult().getFailedTests()
      

      See also https://groups.google.com/forum/?nomobile=true#!topic/jenkinsci-users/dDDPC486JWE

      I've tried to put some logic to save failing tests before and after each maven execution but it cannot work because of "parallel" (all maven executions starting in parallel save an empty state of failing tests and as soon as one of them gets a failing test, they'll all report it failing and send duplicate emails):

      So right now we're stuck and missing a way to get the test result for a single maven execution.

      Thanks

            Unassigned Unassigned
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: