fastlane-plugin-test_center to the latest version
I am running multi_scan on my project with the same arguments I was using in scan and I am getting a ruby error that looks related to the only_testing argument I am passing in.
/Users/myuser/.rvm/gems/ruby-2.5.1/gems/fastlane-plugin-test_center-3.5.7/lib/fastlane/plugin/test_center/helper/test_collector.rb:45:in `only_testing_to_testables_tests': [!] undefined method `sort' for "UITestTarget/UITestClass":String (NoMethodError)
##### Complete output when running fastlane, including the stack trace and command used
[08:48:57]: ------------------------
[08:48:57]: --- Step: multi_scan ---
[08:48:57]: ------------------------
+----------------------+----------------------+
| Summary for multi_scan (test_center v3.5.7) |
+----------------------+----------------------+
| try_count | 3 |
| fail_build | false |
+----------------------+----------------------+
[08:48:57]: $ xcodebuild -showBuildSettings -workspace /Users/me/git/repo/MyWorkspace.xcworkspace -scheme MyTestScheme -configuration DEBUG
[08:49:00]: Command timed out after 3 seconds on try 1 of 4, trying again with a 6 second timeout...
[08:49:02]: $ xcodebuild -showBuildSettings -workspace /Users/me/git/repo/MyWorkspace.xcworkspace -scheme MyTestScheme -configuration DEBUG
+----------------------------+-------------------------------------------------------------------------------+
| Summary for scan 2.105.2 |
+----------------------------+-------------------------------------------------------------------------------+
| clean | true |
| workspace | /Users/me/git/repo/MyWorkspace.xcworkspace |
| scheme | MyTestScheme |
| device | iPhone 8 |
| output_directory | /Users/me/artifactsZ/artifacts/tests |
| only_testing | ["MyTestScheme/MyTestClass"] |
| include_simulator_logs | true |
| result_bundle | true |
| derived_data_path | /Users/me/artifactsZ/DerivedData |
| configuration | DEBUG |
| xcargs | ORG_NAME='feedsdk-cs4b' |
| fail_build | false |
| build_for_testing | true |
| skip_detect_devices | false |
| skip_build | false |
| output_types | html,junit |
| buildlog_path | ~/Library/Logs/scan |
| disable_concurrent_testing | false |
| should_zip_build_products | false |
| open_report | false |
| skip_slack | false |
| slack_only_on_failure | false |
| use_clang_report_name | false |
| xcode_path | /Applications/Xcode/10.0/Xcode.app |
+----------------------------+-------------------------------------------------------------------------------+
[08:49:04]: $ set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace /Users/me/git/repo/MyWorkspace.xcworkspace -scheme MyTestScheme -configuration DEBUG -destination 'platform=iOS Simulator,id=685E7851-3B75-416E-B8D8-8906797C5B0D' -derivedDataPath '/Users/me/artifactsZ/DerivedData' -resultBundlePath '/Users/me/artifactsZ/artifacts/tests/MyTestScheme.test_result' ORG_NAME='feedsdk-cs4b' -only-testing:MyTestScheme/MyTestClass clean build-for-testing | tee '/Users/me/Library/Logs/scan/FeedSDKSampleApp-MyTestScheme.log' | xcpretty --report html --output '/Users/me/artifactsZ/artifacts/tests/report.html' --report junit --output '/Users/me/artifactsZ/artifacts/tests/report.junit' --report junit --output '/var/folders/t4/j7prc3m93276n3bd2vbxf4fs8k4yv1/T/junit_report20181002-67829-13wwgxx'
[08:49:04]: ▸ Loading...
[08:49:06]: ▸ Clean Succeeded
[08:49:09]: ▸ Processing Info.plist
... Lots of compile commands in between from xcodebuild
[09:12:08]: ▸ Test build Succeeded
+--------------------+---+
| Test Results |
+--------------------+---+
| Number of tests | 0 |
| Number of failures | 0 |
+--------------------+---+
[09:12:08]: ------------------------------
[09:12:08]: --- Collecting system logs ---
[09:12:08]: ------------------------------
[09:12:08]: $ xcrun simctl spawn 685E7851-3B75-416E-B8D8-8906797C5B0D log collect --output /Users/me/artifactsZ/artifacts/tests/system_logs-iPhone\ 8_iOS_12.0.logarchive 2>/dev/null
[09:12:09]: Exit status: 74
+----------------------------+------------------------------------------+
| Lane Context |
+----------------------------+------------------------------------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | |
| LANE_NAME | sweep |
| SCAN_DERIVED_DATA_PATH | /Users/me/artifactsZ/DerivedData |
| SCAN_GENERATED_PLIST_FILES | [] |
| SCAN_GENERATED_PLIST_FILE | |
+----------------------------+------------------------------------------+
+------+---------------------------------------------------------------+-------------+
| fastlane summary |
+------+---------------------------------------------------------------+-------------+
| Step | Action | Time (in s) |
+------+---------------------------------------------------------------+-------------+
| 1 | Verifying fastlane version | 0 |
| 2 | default_platform | 0 |
| 3 | rm -rf /Users/me/artifactsZ/DerivedData || echo "Dele | 1 |
| 4 | rm -rf /Users/me/artifactsZ/artifacts/tests || echo " | 0 |
| 💥 | multi_scan | 1391 |
+------+---------------------------------------------------------------+-------------+
[09:12:09]: fastlane finished with errors
Looking for related GitHub issues on fastlane/fastlane...
Found no similar issues. To create a new issue, please visit:
https://github.com/fastlane/fastlane/issues/new
Run `fastlane env` to append the fastlane environment to your issue
Traceback (most recent call last):
31: from /Users/me/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:24:in `'
30: from /Users/me/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:24:in `eval'
29: from /Users/me/.rvm/gems/ruby-2.5.1/bin/fastlane:23:in `'
28: from /Users/me/.rvm/gems/ruby-2.5.1/bin/fastlane:23:in `load'
27: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/bin/fastlane:20:in `'
26: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane/lib/fastlane/cli_tools_distributor.rb:108:in `take_off'
25: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
24: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane/lib/fastlane/commands_generator.rb:333:in `run'
23: from /Users/me/.rvm/gems/ruby-2.5.1/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
22: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
21: from /Users/me/.rvm/gems/ruby-2.5.1/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
20: from /Users/me/.rvm/gems/ruby-2.5.1/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
19: from /Users/me/.rvm/gems/ruby-2.5.1/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
18: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
17: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
16: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'
15: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane/lib/fastlane/runner.rb:45:in `execute'
14: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane/lib/fastlane/runner.rb:45:in `chdir'
13: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
12: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane/lib/fastlane/lane.rb:33:in `call'
11: from Fastfile:294:in `block in parsing_binding'
10: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane/lib/fastlane/fast_file.rb:149:in `method_missing'
9: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
8: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane/lib/fastlane/runner.rb:227:in `execute_action'
7: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane/lib/fastlane/runner.rb:227:in `chdir'
6: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane/lib/fastlane/runner.rb:232:in `block in execute_action'
5: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
4: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-2.105.2/fastlane/lib/fastlane/runner.rb:253:in `block (2 levels) in execute_action'
3: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-plugin-test_center-3.5.7/lib/fastlane/plugin/test_center/actions/multi_scan.rb:23:in `run'
2: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-plugin-test_center-3.5.7/lib/fastlane/plugin/test_center/helper/correcting_scan_helper.rb:39:in `scan'
1: from /Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-plugin-test_center-3.5.7/lib/fastlane/plugin/test_center/helper/test_collector.rb:35:in `testables'
/Users/me/.rvm/gems/ruby-2.5.1/gems/fastlane-plugin-test_center-3.5.7/lib/fastlane/plugin/test_center/helper/test_collector.rb:45:in `only_testing_to_testables_tests': [!] undefined method `sort' for "MyTestScheme/MyTestClass":String (NoMethodError)
| Key | Value |
| --------------------------- | ------------------------------------------------------ |
| OS | 10.13.6 |
| Ruby | 2.5.1 |
| Bundler? | true |
| Git | git version 2.17.1 (Apple Git-112) |
| Installation Source | ~/.rvm/gems/ruby-2.5.1/bin/fastlane |
| Host | Mac OS X 10.13.6 (17G65) |
| Ruby Lib Dir | ~/.rvm/rubies/ruby-2.5.1/lib |
| OpenSSL Version | OpenSSL 1.1.1 11 Sep 2018 |
| Is contained | false |
| Is homebrew | false |
| Is installed via Fabric.app | false |
| Xcode Path | /Applications/Xcode/10.0/Xcode.app/Contents/Developer/ |
| Xcode Version | 10.0 |
| Variable | Value | |
| -------- | ----------- | - |
| LANG | en_US.UTF-8 | ✅ |
| LC_ALL | | |
| LANGUAGE | | |
./fastlane/Fastfile
lane :sweep do |options|
scheme_to_test = options[:scheme_to_test]
UI.important("scheme_to_test: #{scheme_to_test}")
base_derived_data_path = options[:derived_data_path]
UI.important("base_derived_data_path: #{base_derived_data_path}")
delete_dir(base_derived_data_path)
output_directory = options[:output_directory]
UI.important("output_directory: #{output_directory}")
delete_dir(output_directory)
test_to_run = options[:test_to_run]
UI.important("test_to_run: #{test_to_run}")
device_to_test = options[:device]
UI.important("device: #{device_to_test}")
workspace_to_test = options[:workspace]
UI.important("workspace: #{workspace_to_test}")
test_run_block = lambda do |testrun_info|
failed_test_count = testrun_info[:failed].size
if failed_test_count > 0
UI.important('The run of tests would finish with failures due to fragile tests here.')
try_attempt = testrun_info[:try_count]
if try_attempt < 3
UI.header('Since we are using :multi_scan, we can re-run just those failing tests!')
end
end
end
result = multi_scan(
clean: true,
workspace: File.absolute_path("../" + workspace_to_test),
scheme: scheme_to_test,
device: device_to_test,
output_types: "junit",
output_files: "report.junit",
output_directory: output_directory,
only_testing: test_to_run,
include_simulator_logs: true,
result_bundle: true,
derived_data_path: base_derived_data_path,
configuration:"Debug",
xcargs: "ORG_NAME='myCustomVar'",
try_count: 3,
fail_build: false,
testrun_completed_block: test_run_block
)
unless result[:failed_testcount].zero?
UI.message("There are #{result[:failed_testcount]} legitimate failing tests")
end
end
### fastlane gems
| Gem | Version | Update-Status |
| -------- | ------- | ------------- |
| fastlane | 2.105.2 | ✅ Up-To-Date |
### Loaded fastlane plugins:
| Plugin | Version | Update-Status |
| ---------------------------------------------- | ------- | ------------- |
| fastlane-plugin-setup_fragile_tests_for_rescan | 2.1.1 | ✅ Up-To-Date |
| fastlane-plugin-merge_junit_report | 0.5.0 | ✅ Up-To-Date |
| fastlane-plugin-test_center | 3.5.7 | ✅ Up-To-Date |
Okay. The error is that I am expecting an array of strings and you are passing in a string for the :only_testing option. scan coerces that to an array, and multi_scan does not yet.
Can you confirm by changing:
only_testing: test_to_run,
to
only_testing: [test_to_run],
When calling multi_scan?
I'm sure that is it. I'll close this issue for now and re-open if it is still a problem. Not sure how I missed that in the docs, thank you!
Oh, no, I want this open. It is a real problem: I just gave you a work-around until I fix it.
The workaround did resolve my issue. Thank you!
If I run from the command line like the following
> bundle exec fastlane run multi_scan device:"iPhone X" only_testing:"UI Tests/SmokeUITests/testFeature1" scheme:"UI Tests" workspace:"TEST.xcworkspace"
I still got the error mentioned above. May I ask is there any workaround for this? Thanks.
Hm. I do not run it from the command line, but would this work?
only_testing:"[UI Tests/SmokeUITests/testFeature1]"
Further research shows that this may not work. You could set up a Scanfile that has the tests (you can create that file programmatically).
OR you could open up a PR to fix this. I can provide guidance, I do not think it would be too complicated.
I would like to open a PR to fix this. :) Some hints would be very appreciated!
Fixed in 3.8.0.parallelizing.beta.8. I will close this issue once that is official released.
Fixed in v3.8.0