我的程序使用自定義測試框架,但將測試結果保存到遵循JUnit XML格式的XML文件中,如下所述:JUnit XML format specification that Hudson supports。詹金斯能夠使用xunit插件解析文件,並顯示信息豐富的測試結果。但是,當我執行手動構建和測試結果文件的git添加/提交時,它只會看到該文件。我需要做什麼才能讓Jenkins「看到」在執行流水線期間創建的結果文件?編寫測試結果xml文件,由Jenkins讀取
這裏是我的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'
}
}
}
}