So I'm trying to learn more about jenkins and I developed a shell script that execute the tests for my iOS project and generates a report. I set the script to exit as soon as failures are detected (Since this is the only way I know how to get the build to fail if the tests fail).
That's the reason why the reports were not being generated. Because I exit the script as soon as the tests failed. But I'm not familiar with how to get the build to fail, without exiting prior to the generation of the reports. What can I do to circumvent this? Here's my current shells script:
set -o pipefail && xcodebuild -project "Tests.xcodeproj"
-scheme "Testing"
-sdk "iphonesimulator12.2"
-destination "platform=iOS Simulator,OS=latest,name=iPhone 7"
test -only-testing:"UITests/UITests"
-resultBundlePath TestResults | xcpretty
xchtmlreport -r TestResults