• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • blueocean-plugin
    • None

      I have a pipeline Jenkinsfile like this:

      pipeline {
        agent any
      
        stages {
          stage('Build') {
            steps {
              sh 'mvn clean install'
            }
          }
        }
      
        post {
          always {
            echo 'Publish TestNG result'
            step([$class: 'Publisher'])
          }
        }
      }
      

      In Jenkins view I can see TestNG Results but in Blueocean view no test results be showed.

          [JENKINS-54876] Blueocean doesn't show TestNG Results

          Magnus Brange added a comment -

          I had the same problem but I just found out that I can publish the junit xml reports instead of testngs' report.xml.

          I'm still running tests with TestNG, but TestNG generates junit xml reports as well.

           

          For me they are located in target/surefire-reports/junitreports/*.xml.

          So instead of

          step([$class: 'Publisher',
            reportFilenamePattern: 'target/surefire-reports/testng-results.xml'
          ])

          I execute

          junit 'target/surefire-reports/junitreports/*.xml'
          

          in my post step. (And that was the only change I did)

          Magnus Brange added a comment - I had the same problem but I just found out that I can publish the junit xml reports instead of testngs' report.xml. I'm still running tests with TestNG, but TestNG generates junit xml reports as well.   For me they are located in target/surefire-reports/junitreports/*.xml. So instead of step([$class: 'Publisher' , reportFilenamePattern: 'target/surefire-reports/testng-results.xml' ]) I execute junit 'target/surefire-reports/junitreports/*.xml' in my post step. (And that was the only change I did)

            Unassigned Unassigned
            chanjarster Daniel Qian
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: