Even though I have the fail_build setting set to false, occasionally if xcodebuild returns an exit status of 65, trainer will fail.
A snippet from the log
** TEST FAILED **
[09:13:18]: Exit status: 65
+--------------------+-----+
| Test Results |
+--------------------+-----+
| Number of tests | 202 |
| Number of failures | 1 |
+--------------------+-----+
[09:13:18]: ---------------------
[09:13:18]: --- Step: trainer ---
[09:13:18]: ---------------------
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Summary for trainer 0.8.0 |
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| output_directory | ./fastlane/test_output |
| extension | .junit |
| fail_build | false |
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
[09:13:18]: `Helper.gem_path` is deprecated. Use the `ROOT` constant from the appropriate tool module instead.
Successfully generated './fastlane/test_output/TestSummaries.junit'
+----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Lane Context |
+----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | ios |
| LANE_NAME | ios pr |
| BUILD_NUMBER | 81.289 |
| SCAN_DERIVED_DATA_PATH | /Users/jenkins/Library/Developer/Xcode/DerivedData/REDACTED-euytkosnmedfedgjjjodqbkwmzhe |
| SCAN_GENERATED_PLIST_FILES | ["/Users/jenkins/Library/Developer/Xcode/DerivedData/REDACTED-euytkosnmedfedgjjjodqbkwmzhe/Logs/Test/Run-REDACTED-2018.09.07_09-09-41--0400.xcresult/TestSummaries.plist"] |
| SCAN_GENERATED_PLIST_FILE | /Users/jenkins/Library/Developer/Xcode/DerivedData/REDACTED-euytkosnmedfedgjjjodqbkwmzhe/Logs/Test/Run-REDACTED-2018.09.07_09-09-41--0400.xcresult/TestSummaries.plist |
+----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
[09:13:18]: Unit tests failed
+------+-----------------------------------------+-------------+
| fastlane summary |
+------+-----------------------------------------+-------------+
| Step | Action | Time (in s) |
+------+-----------------------------------------+-------------+
| 1 | default_platform | 0 |
| 2 | Verifying fastlane version | 0 |
| 3 | default_platform | 0 |
| 4 | import_from_git | 0 |
| 5 | xcversion | 1 |
| 6 | cocoapods | 15 |
| 7 | Switch to ios incrementBuildNumber lane | 0 |
| 8 | increment_build_number | 2 |
| 9 | Switch to ios runTestsWithCoverage lane | 0 |
| 10 | reset_simulator_contents | 20 |
| 11 | swiftlint | 1 |
| 12 | scan | 237 |
| 💥 | trainer | 0 |
+------+-----------------------------------------+-------------+
[09:13:18]: fastlane finished with errors
[!] Unit tests failed
Looking at the code, I’m not sure how the “Unit tests failed” message appears when fail_build is set to false. Here’s what the relevant portion of my Fastfile looks like:
scan(
scheme: ENV["SCAN_SCHEME"],
workspace: ENV["SCAN_WORKSPACE"],
configuration: 'Debug',
output_types: '',
device: ENV["DEVICE"] || 'iPhone 8 (12.0)',
code_coverage: true,
fail_build: false
)
trainer(
output_directory: './fastlane/test_output',
extension: '.junit',
fail_build: false
)
Even though I have the
fail_buildsetting set tofalse, occasionally if xcodebuild returns an exit status of 65, trainer will fail.A snippet from the log
Looking at the code, I’m not sure how the “Unit tests failed” message appears when
fail_buildis set tofalse. Here’s what the relevant portion of myFastfilelooks like: