My program uses a custom testing framework but saves test results to an XML file following JUnit XML formatting as described here: JUnit XML format specification that Hudson supports. Jenkins is able to parse the file as expected, using the xunit plugin, and to display informative test results. However, it only sees the file when I do a manual build and a git add/commit of the test results file. What do I need to do so that Jenkins will "see" a result file that is created during the execution of the pipeline?
Here is my Jenkinsfile:
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'xcodebuild -scheme UnitTestRunner -configuration debug'
}
}
stage('Test') {
steps {
sh 'xcodebuild -scheme UnitTestRunner -configuration debug || true'
junit '**/TestResults.xml'
}
}
}
}