You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a lane or action has an exit code, fastlane always returns an exit code of 1. In the attached example, the unit tests fail with an exit code of 65, but theres seemingly no way to get this.
This would be useful for the CI to retry unit test crashes, but not unit test failures. Here is a sample project you can use to test this behaviour.
Similarly, if I use bundle exec fastlane scan standalone, it still only returns an exit code of 1.
Command executed
$ bundle exec fastlane tests
$ echo $?
Complete output when running fastlane, including the stack trace and command used
[08:24:03]: Disabling 'Slide to Type' iPhone SE (3rd generation)
[08:24:03]: $ /usr/libexec/PlistBuddy -c "Add :KeyboardContinuousPathEnabled bool false" /Users/paulwilliamson/Library/Developer/CoreSimulator/Devices/989E3E15-B699-43D1-A2CA-074D9929AF4C/data/Library/Preferences/com.apple.keyboard.ContinuousPath.plist >/dev/null 2>&1
[08:24:03]: $ set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme ExitCodes -project ./ExitCodes.xcodeproj -derivedDataPath /Users/paulwilliamson/Library/Developer/Xcode/DerivedData/ExitCodes-gjkhbfdttfztyigikgndojlrqkwb -destination 'platform=iOS Simulator,id=989E3E15-B699-43D1-A2CA-074D9929AF4C' build test | tee '/Users/paulwilliamson/Library/Logs/scan/ExitCodes-ExitCodes.log' | xcbeautify
[08:24:03]: ▸ Loading...
[08:24:04]: ▸ --- xcodebuild: WARNING: Using the first of multiple matching destinations:
[08:24:04]: ▸ { platform:iOS Simulator, id:989E3E15-B699-43D1-A2CA-074D9929AF4C, OS:17.4, name:iPhone SE (3rd generation) }
[08:24:04]: ▸ { platform:iOS Simulator, id:989E3E15-B699-43D1-A2CA-074D9929AF4C, OS:17.4, name:iPhone SE (3rd generation) }
[08:24:12]: ▸ [ExitCodes] Processing empty-ExitCodes.plist
[08:24:12]: ▸ Signing ExitCodes.app (in target 'ExitCodes' from project 'ExitCodes')
[08:24:12]: ▸ Build Succeeded
[08:24:12]: ▸ --- xcodebuild: WARNING: Using the first of multiple matching destinations:
[08:24:12]: ▸ { platform:iOS Simulator, id:989E3E15-B699-43D1-A2CA-074D9929AF4C, OS:17.4, name:iPhone SE (3rd generation) }
[08:24:12]: ▸ { platform:iOS Simulator, id:989E3E15-B699-43D1-A2CA-074D9929AF4C, OS:17.4, name:iPhone SE (3rd generation) }
[08:24:13]: ▸ [ExitCodes] Processing empty-ExitCodes.plist
[08:24:13]: ▸ [ExitCodesTests] Processing empty-ExitCodesTests.plist
[08:24:13]: ▸ Signing ExitCodesTests.xctest (in target 'ExitCodesTests' from project 'ExitCodes')
[08:24:13]: ▸ Signing ExitCodes.app (in target 'ExitCodes' from project 'ExitCodes')
[08:24:35]: ▸ Test Suite ExitCodesTests started on 'Clone 1 of iPhone SE (3rd generation) - ExitCodes (39378)'
[08:24:35]: ▸ ✖ test_failingTest on 'Clone 1 of iPhone SE (3rd generation) - ExitCodes (39378)' (0.094 seconds)
[08:24:52]: ▸ 2024-04-10 08:24:52.731 xcodebuild[39129:3815875] [MT] IDETestOperationsObserverDebug: 39.339 elapsed -- Testing started completed.
[08:24:52]: ▸ 2024-04-10 08:24:52.731 xcodebuild[39129:3815875] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
[08:24:52]: ▸ 2024-04-10 08:24:52.731 xcodebuild[39129:3815875] [MT] IDETestOperationsObserverDebug: 39.339 sec, +39.339 sec -- end
[08:24:54]: ▸ Failing tests:
[08:24:54]: ▸ ExitCodesTests.test_failingTest()
[08:24:54]: ▸ ** TEST FAILED **
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:989E3E15-B699-43D1-A2CA-074D9929AF4C, OS:17.4, name:iPhone SE (3rd generation) }
{ platform:iOS Simulator, id:989E3E15-B699-43D1-A2CA-074D9929AF4C, OS:17.4, name:iPhone SE (3rd generation) }
[ExitCodes] Processing empty-ExitCodes.plist
Signing ExitCodes.app (in target 'ExitCodes' from project 'ExitCodes')
Build Succeeded
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:989E3E15-B699-43D1-A2CA-074D9929AF4C, OS:17.4, name:iPhone SE (3rd generation) }
{ platform:iOS Simulator, id:989E3E15-B699-43D1-A2CA-074D9929AF4C, OS:17.4, name:iPhone SE (3rd generation) }
[ExitCodes] Processing empty-ExitCodes.plist
[ExitCodesTests] Processing empty-ExitCodesTests.plist
Signing ExitCodesTests.xctest (in target 'ExitCodesTests' from project 'ExitCodes')
Signing ExitCodes.app (in target 'ExitCodes' from project 'ExitCodes')
Test Suite ExitCodesTests started on 'Clone 1 of iPhone SE (3rd generation) - ExitCodes (39378)'
✖ test_failingTest on 'Clone 1 of iPhone SE (3rd generation) - ExitCodes (39378)' (0.094 seconds)
2024-04-10 08:24:52.731 xcodebuild[39129:3815875] [MT] IDETestOperationsObserverDebug: 39.339 elapsed -- Testing started completed.
2024-04-10 08:24:52.731 xcodebuild[39129:3815875] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
2024-04-10 08:24:52.731 xcodebuild[39129:3815875] [MT] IDETestOperationsObserverDebug: 39.339 sec, +39.339 sec -- end
Failing tests:
ExitCodesTests.test_failingTest()
** TEST FAILED **
[08:24:57]: Exit status: 65
[08:24:57]: Skipping HTML... only available with xcodebuild_formatter: 'xcpretty' right now
[08:24:57]: Your 'xcodebuild_formatter' doesn't support these 'output_types'. Change your 'output_types' to prevent these warnings from showing...
+------------------------+
| Test Results |
+--------------------+---+
| Number of tests | 1 |
| Number of failures | 1 |
+--------------------+---+
To get the raw exit code from Fastlane, you can use the following command in your terminal or shell script:
fastlane [lane_name] --raw
Replace [lane_name] with the name of the lane you want to run. The --raw option tells Fastlane to print only the raw exit code without any additional output or formatting. Palm Beach County Property Appraiser
For example, if you want to run a lane named deploy and get the raw exit code, you would use:
fastlane deploy --raw
This command will execute the deploy lane in your Fastfile and print the raw exit code to the terminal. You can then use this exit code in your scripts or workflows as needed.
New Issue Checklist
Issue Description
When a lane or action has an exit code, fastlane always returns an exit code of 1. In the attached example, the unit tests fail with an exit code of
65
, but theres seemingly no way to get this.This would be useful for the CI to retry unit test crashes, but not unit test failures. Here is a sample project you can use to test this behaviour.
Similarly, if I use
bundle exec fastlane scan
standalone, it still only returns an exit code of 1.Command executed
Complete output when running fastlane, including the stack trace and command used
Environment
The text was updated successfully, but these errors were encountered: