Charlie,

The XML generated by GoogleTest is not compatible with JUnit.
You need to use the XUnit plugin to parse the GoogleTest format XML.

See:
https://plugins.jenkins.io/xunit
https://wiki.jenkins.io/display/JENKINS/xUnit+Plugin
https://jenkins.io/blog/2016/10/31/xunit-reporting/
https://jenkins.io/doc/pipeline/steps/xunit/

--
Craig



On Wed, Jan 9, 2019 at 7:37 PM Charlie Cheng <charliecheng2...@gmail.com>
wrote:

> Hello, I want to known why the Junit can't find the gtest report.
>
> everytime I check the directory, and I am sure that the gtest report is
> exist, below is my Jenkinsfile:
>
>        stage('Test') {
>             steps {
>                 sh 'echo mkdir dir output'
>                 sh 'mkdir -p ${WORKSPACE}/output'
>
>                 dir('build')
>                 {
>                     sh 'echo excute gtest'
>                     sh './test/gtestdemo
> --gtest_output="xml:${WORKSPACE}/output/gtestresult.xml" || true'
>                 }
>             }
>        }
>
>
>     post {
>         always {
>             sh 'ls -al ${WORKSPACE}/output'
>             junit "${WORKSPACE}/output/*.xml"
>         }
>     }
>
> and the error is below:
>
> + ls -al
> /var/jenkins_home/workspace/292-senitesdemo_master-EMNQTWWS2F3TDC35EHB6YDNKGG7KREEDIZ37IZ3MSUXD25A2G6VA/output/
> total 4
> drwxr-xr-x  4 root root  128 Jan  9 11:58 .
> drwxr-xr-x 11 root root  352 Jan  9 11:58 ..
> -rw-r--r--  1 root root 1062 Jan  9 11:58 gtestresult.xml
> drwxr-xr-x  4 root root  128 Jan  9 11:58 logs
>
> Recording test results
> No test report files were found. Configuration error?
>
> so confuse, anyone can help?
>
> by the way, this is the correct way to use gtest in jenkins?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/449bf1f7-7039-49af-aef1-63738e8220d1%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/449bf1f7-7039-49af-aef1-63738e8220d1%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAG%3DrPVcPmzcraGh_AYTZUCXb0wofTMwN_Fw9bXbaBszpWxGLDw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to