Xcode 8 Jenkins JUnit error: test report no report files found

Viewed 1323

I'm new to Jenkins and am trying to setup CI for my iOS app. I've created a unit test target in the project and have configured Jenkins to properly build and run my unit tests, but the build fails when trying to actually output the rest results xml file and I'm not sure what I'm doing wrong. I borrowed a lot of ideas presented from these sources:

https://www.raywenderlich.com/22816/beginning-automated-testing-with-xcode-part-22 http://www.sailmaker.co.uk/blog/2013/04/02/advanced-jenkins-for-ios-and-mac/

My actual console log after a build looks like this:

=== BUILD TARGET run_to_it OF PROJECT run_to_it WITH CONFIGURATION Debug ===

Check dependencies

=== BUILD TARGET run_to_itTests OF PROJECT run_to_it WITH CONFIGURATION Debug ===

Check dependencies

** BUILD SUCCEEDED **

Recording test results
ERROR: Step ‘Publish JUnit test result report’ failed: No test report files were found. Configuration error?
Finished: FAILURE

My build step execute shell looks like this :

export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer/

security unlock-keychain -p ${KEYCHAIN_PASSWORD} ${KEYCHAIN_PATH}
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k ${KEYCHAIN_PASSWORD} ${KEYCHAIN_PATH}
xcrun xcodebuild clean build CODE_SIGN_IDENTITY="${CODE_SIGNING_IDENTITY}" PROVISIONING_PROFILE=${PROVISIONING_PROFILE} OTHER_CODE_SIGN_FLAGS="--keychain ${KEYCHAIN_PATH}"


xcodebuild -target run_to_itTests -configuration Debug -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO TEST_AFTER_BUILD=YES GCC_TREAT_WARNINGS_AS_ERRORS=NO WANT_IOS_SIM=YES OBJROOT="${WORKSPACE}"/tmp/objs build | /usr/local/bin/ocunit2junit

My post build step for where the test reports are to be placed looks like this: enter image description here

I've ensured I've installed the necessary plugins as well as installing the ocunit2junit gem in the /usr/local/bin directory as well as having installed the JUnit plugin in Jenkins.

enter image description hereenter image description here

I'm not 100% sure if any xml file is being generated at all as I've looked through every folder in the Jenkins workspace and see no such xml file anywhere. I'm not sure if I need to explicitly specify this file to be created in any of the build steps or if it is handled by default. I've looked far and wide on the internet and I've not been able to conclusively figure out the problem.

For context: My Jenkins server is running on my Mac at the moment. I have a Jenkins user with a workspace on my local machine. I'm also running macOS Sierra and I'm not sure if there could be any permissions issues with the test-reports folder. I see that the folder is being created but no xml file is ever placed inside of it.

If I remove the Publish JUnit test report result then my project will build successfully.

1 Answers
Related