Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict between scheme and test_without_building options for scan #20540

Closed
4 tasks done
elitalon opened this issue Aug 9, 2022 · 3 comments
Closed
4 tasks done

Conflict between scheme and test_without_building options for scan #20540

elitalon opened this issue Aug 9, 2022 · 3 comments

Comments

@elitalon
Copy link

elitalon commented Aug 9, 2022

New Issue Checklist

Issue Description

Running scan with the test_without_building option set to true makes fastlane prompt for a missing scheme option:

[11:11:53]: ------------------
[11:11:53]: --- Step: scan ---
[11:11:53]: ------------------
Select Scheme: 
1. <redacted>
2. <redacted>
3. <redacted>
4. <redacted>
5. <redacted>
6. <redacted>
7. <redacted>
?

But when I set a value for the scheme option, then xcodebuild complains that such option is incompatible with -xctestrun:

[11:14:58]: $ set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace <redacted> -scheme <redacted> -derivedDataPath <redacted> -disableAutomaticPackageResolution -destination 'platform=iOS Simulator,id=DBCDD114-FD91-48EB-8825-F0B9801F5923' -testPlan <redacted> -testProductsPath <redacted> -retry-tests-on-failure -test-iterations 2 test-without-building | tee <redacted> | xcbeautify
[11:14:58]: ▸ Loading...
[11:15:00]: ▸ xcodebuild: error: Cannot use -xctestrun with -project, -workspace or -scheme options.
xcodebuild: error: Cannot use -xctestrun with -project, -workspace or -scheme options.
[11:15:00]: Exit status: 78

Manually running the xcodebuild command above but omitting the workspace and scheme arguments works as expected.

Upon closer inspection of how scan options are built, I noticed that project_path_array will only contain workspace and scheme if the package_path option is nil.

So if I run scan without setting scheme and setting package_path to an empty string it works as expected:

# scan complains about a missing scheme option
scan(
  test_without_building: true,
  derived_data_path: "…")

# xcodebuild complains about incompatible scheme option
scan(
  scheme: <redacted>,
  test_without_building: true,
  derived_data_path: "…")

# works as expected: scan doesn't prompt for a scheme and
# xcodebuild doesn't complain about an incompatible scheme argument
scan(
  package_path: "",
  test_without_building: true,
  derived_data_path: "…")

I think scan shouldn't require a scheme option when test_without_building is set to true.

Command executed
scan(
  scheme: <redacted>,
  device: simulator,
  output_types: "junit",
  output_files: <redacted>,
  test_without_building: true,
  xcargs: "-testProductsPath #{<redacted>.xctestproducts}",
  prelaunch_simulator: true,
  skip_package_dependencies_resolution: true,
  disable_package_automatic_updates: true,
  derived_data_path: <redacted>,
  number_of_retries: 1)
Complete output when running fastlane, including the stack trace and command used

Note: unit_test is a lane in Fastfile wrapping a call to scan with the options from the previous section.

$ bundle exec fastlane unit_test os:"15.5"
[11:35:29]: ------------------
[11:35:29]: --- Step: scan ---
[11:35:29]: ------------------
[11:35:29]: Skipped Swift Package Manager dependencies resolution.
[11:35:29]: $ xcodebuild -showBuildSettings -workspace <redacted> -scheme <redacted> -derivedDataPath <redacted> -disableAutomaticPackageResolution
2022-08-09 11:35:29.662 xcodebuild[19338:217438] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-08-09 11:35:29.662 xcodebuild[19338:217438] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
{ platform:iOS Simulator, id:31EA3E77-FA33-4591-AA76-990AB677BBBF, OS:13.7, name:iPhone 11 }
{ platform:iOS Simulator, id:DBCDD114-FD91-48EB-8825-F0B9801F5923, OS:15.5, name:iPhone 13 mini }
{ platform:iOS Simulator, id:35C8A2EF-1F7B-406B-91EC-E6661856AD7A, OS:15.5, name:iPhone SE (1st generation) }
{ platform:iOS Simulator, id:1493BB25-5FA7-4AD3-AA29-97555AA9F5A6, OS:14.5, name:iPhone X }
{ platform:iOS Simulator, id:D980CAB9-DACC-4563-B5D0-FD8FF41028CF, OS:12.4, name:iPhone Xʀ }

+------------------------------------------------+------------------------------------------------------------------------------------+
| Summary for scan 2.208.0 |
+------------------------------------------------+------------------------------------------------------------------------------------+
| scheme | <redacted> |
| device | iPhone 13 mini (15.5) |
| output_types | junit |
| output_files | <redacted>.junit |
| test_without_building | true |
| xcargs | -testPlan '<redacted>' -testProductsPath <redacted> |
| prelaunch_simulator | true |
| skip_package_dependencies_resolution | true |
| disable_package_automatic_updates | true |
| derived_data_path | <redacted> |
| number_of_retries | 1 |
| workspace | <redacted> |
| skip_detect_devices | false |
| ensure_devices_found | false |
| force_quit_simulator | false |
| reset_simulator | false |
| disable_slide_to_type | true |
| reinstall_app | false |
| clean | false |
| open_report | false |
| output_directory | ./fastlane/test_output |
| buildlog_path | ~/Library/Logs/scan |
| include_simulator_logs | false |
| xcodebuild_formatter | xcbeautify |
| output_remove_retry_attempts | false |
| should_zip_build_products | false |
| output_xctestrun | false |
| result_bundle | false |
| use_clang_report_name | false |
| disable_concurrent_testing | false |
| skip_build | false |
| slack_use_webhook_configured_username_and_icon | false |
| slack_username | fastlane |
| slack_icon_url | https://fastlane.tools/assets/img/fastlane_icon.png |
| skip_slack | false |
| slack_only_on_failure | false |
| xcodebuild_command | env NSUnbufferedIO=YES xcodebuild |
| use_system_scm | false |
| fail_build | true |
| xcode_path | /Applications/Xcode.app |
+------------------------------------------------+------------------------------------------------------------------------------------+

[11:35:46]: Disabling 'Slide to Type' iPhone 13 mini
[11:35:46]: $ /usr/libexec/PlistBuddy -c "Add :KeyboardContinuousPathEnabled bool false" /<redacted>/Library/Developer/CoreSimulator/Devices/DBCDD114-FD91-48EB-8825-F0B9801F5923/data/Library/Preferences/com.apple.keyboard.ContinuousPath.plist >/dev/null 2>&1
[11:35:46]: Booting iPhone 13 mini
[11:35:47]: $ set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace <redacted> -scheme <redacted> -derivedDataPath <redacted> -disableAutomaticPackageResolution -destination 'platform=iOS Simulator,id=DBCDD114-FD91-48EB-8825-F0B9801F5923' -testPlan '<redacted>' -testProductsPath <redacted> -retry-tests-on-failure -test-iterations 2 test-without-building | tee '/<redacted>/Library/Logs/scan/<redacted>.log' | xcbeautify
[11:35:47]: ▸ Loading...
[11:35:48]: ▸ 2022-08-09 11:35:48.663 xcodebuild[19425:218094] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
[11:35:48]: ▸ 2022-08-09 11:35:48.665 xcodebuild[19425:218094] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
[11:35:49]: ▸ xcodebuild: error: Cannot use -xctestrun with -project, -workspace or -scheme options.
2022-08-09 11:35:48.663 xcodebuild[19425:218094] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-08-09 11:35:48.665 xcodebuild[19425:218094] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
xcodebuild: error: Cannot use -xctestrun with -project, -workspace or -scheme options.
[11:35:49]: Exit status: 78
+------------------------------+-------------------------------------------------------------+
| Lane Context |
+------------------------------+-------------------------------------------------------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | ios |
| LANE_NAME | ios unit_test |
| SCAN_GENERATED_XCRESULT_PATH | |
| SCAN_DERIVED_DATA_PATH | /<redacted>/Library/Developer/Xcode/DerivedData/<redacted> |
| SCAN_GENERATED_PLIST_FILES | [] |
| SCAN_GENERATED_PLIST_FILE | |
+------------------------------+-------------------------------------------------------------+
[11:35:51]: Error building/testing the application. See the log above.

Environment

✅ fastlane environment ✅

Stack

Key Value
OS 12.5
Ruby 3.1.2
Bundler? true
Git git version 2.37.1
Installation Source ~/.rbenv/versions/3.1.2/bin/fastlane
Host macOS 12.5 (21G72)
Ruby Lib Dir ~/.rbenv/versions/3.1.2/lib
OpenSSL Version OpenSSL 1.1.1n 15 Mar 2022
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 13.4
Swift Version 5.6.1

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL en_US.UTF-8
LANGUAGE

fastlane gems

Gem Version Update-Status
fastlane 2.208.0 ✅ Up-To-Date

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-appcenter 2.0.0 ✅ Up-To-Date
fastlane-plugin-badge 1.5.0 ✅ Up-To-Date
fastlane-plugin-changelog 0.16.0 ✅ Up-To-Date
fastlane-plugin-versioning 0.5.1 ✅ Up-To-Date
Loaded gems
Gem Version
error_highlight 0.3.0
did_you_mean 1.6.1
bundler 2.2.32
pathname 0.2.0
rake 13.0.6
rexml 3.2.5
CFPropertyList 3.0.5
public_suffix 4.0.7
addressable 2.8.0
artifactory 3.0.15
atomos 0.1.3
aws-eventstream 1.2.0
aws-partitions 1.615.0
aws-sigv4 1.5.1
jmespath 1.6.1
aws-sdk-core 3.131.6
aws-sdk-kms 1.58.0
aws-sdk-s3 1.114.0
babosa 1.0.4
fastimage 2.2.6
colored 1.2
highline 2.0.3
commander 4.6.0
dotenv 2.8.1
emoji_regex 3.2.3
excon 0.92.4
faraday-em_http 1.0.0
faraday-em_synchrony 1.0.0
faraday-excon 1.1.0
faraday-httpclient 1.0.1
multipart-post 2.0.0
faraday-multipart 1.0.4
faraday-net_http 1.0.1
faraday-net_http_persistent 1.2.0
faraday-patron 1.0.0
faraday-rack 1.0.0
faraday-retry 1.0.3
ruby2_keywords 0.0.5
faraday 1.10.1
unf_ext 0.0.8.2
unf 0.1.4
domain_name 0.5.20190701
http-cookie 1.0.5
faraday-cookie_jar 0.0.7
faraday_middleware 1.2.0
gh_inspector 1.1.3
jwt 2.4.1
memoist 0.16.2
multi_json 1.15.0
os 1.1.4
signet 0.17.0
googleauth 1.2.0
httpclient 2.8.3
mini_mime 1.1.2
declarative 0.0.20
trailblazer-option 0.1.2
uber 0.1.0
representable 3.2.0
retriable 3.1.2
webrick 1.7.0
google-apis-core 0.7.0
google-apis-androidpublisher_v3 0.25.0
google-apis-playcustomapp_v1 0.10.0
digest-crc 0.6.4
google-apis-iamcredentials_v1 0.13.0
google-apis-storage_v1 0.17.0
google-cloud-env 1.6.0
google-cloud-errors 1.2.0
google-cloud-core 1.6.0
google-cloud-storage 1.38.0
json 2.6.2
mini_magick 4.11.0
naturally 2.2.1
optparse 0.1.1
plist 3.6.0
rubyzip 2.3.2
security 0.1.3
simctl 1.6.8
terminal-notifier 2.0.0
unicode-display_width 1.8.0
terminal-table 1.8.0
tty-screen 0.8.1
tty-cursor 0.7.1
tty-spinner 0.9.3
word_wrap 1.0.0
claide 1.1.0
colored2 3.1.2
nanaimo 0.3.0
xcodeproj 1.22.0
rouge 2.0.7
xcpretty 0.3.0
xcpretty-travis-formatter 1.0.1
badge 0.13.0
cork 0.3.0
nap 1.1.0
open4 1.3.4
claide-plugins 0.9.2
faraday-http-cache 2.4.0
rchardet 1.8.0
git 1.11.0
kramdown 2.4.0
kramdown-parser-gfm 1.1.0
no_proxy_fix 0.1.2
sawyer 0.9.2
octokit 4.25.1
danger 8.6.1
thor 0.20.3
danger-swiftlint 0.30.2
slack-notifier 2.4.0
xcresult 0.2.1
xcov 1.8.1
danger-xcov 0.5.0
fastlane-plugin-appcenter 2.0.0
fastlane-plugin-badge 1.5.0
fastlane-plugin-changelog 0.16.0
fastlane-plugin-versioning 0.5.1

generated on: 2022-08-09

@Palmieri78759
Copy link

Palmieri78759 commented Aug 9, 2022

Looking for the same issue. Bumped into your thread. Thanks for creating it. Looking forward for solution. mycenturahealth

@fastlane-bot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest fastlane version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

Friendly reminder: contributions are always welcome! Check out CONTRIBUTING.md for more information on how to help with fastlane and feel free to tackle this issue yourself 💪

This issue will be auto-closed if there is no reply within 1 month.

@fastlane-bot
Copy link

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants