Closed jineshqa closed 5 years ago
This works fine for Xcode 10?
Yes it does. Also, take a look at this as well.
@jineshqa do you have a theory that they are somehow related? This issue that you created seems to indicate that there is a problem collating test result bundles. The issue that you reference fastlane/fastlane#15138 indicates that there is a crash after uploading to testflight.
I saw that you commented in the issue. According to the stack trace of the crash, these are not related issues.
As this fails in both Xcode 10 and Xcode 11, this is probably not related to the versions. I haven't changed anything in the collation of test result bundles of v3.8.4 vs. v.3.8.x.
You must have something in your project that is catching an edge case that I have not encountered before. I need either the test result bundles to see why the collation fails, or a sample project that you can submit freely that exhibits the problem.
Hey Lyndsey,
This does not fail on xcode 10.
Thanks, Jinesh
Okay. Can you provide the test result bundles?
Oh, and another question, if you remove the request to create test_result bundles, does it still crash?
I am not sure I can try.
Also, will get you sample project.
I am not sure I can try.
This is didn't help.
Also, will get you sample project.
Sample project is located here
Test output is attached. test_outout.zip
@lyndsey-ferguson is above info good enough.
@jineshqa yes, I was able to fix the crash. I have a PR open.
Can you modify your Pluginfile
per my instructions below, run bundle install
, and then run your fastlane again (with the --verbose
flag)?
Pluginfile:
gem 'fastlane-plugin-test_center', :git => "https://github.com/lyndsey-ferguson/fastlane-plugin-test_center.git", :branch => "issue-145-crash-when-collating-test-bundles"
If there are still problems, please let me know and attach the console output as a text file to this issue (makes it easier for me to review). If it works, please let me know.
However, I do not believe that collation now works. The test summaries no longer exist and the tests failures and passes are no longer listed.
It looks like there is a new format: https://github.com/fastlane-community/trainer/issues/32
Ok, this looks like a lot of work.
I'm going to change this issue to a Feature Request to support Xcode 11 format.
Actually, I can issue a fix for now until test_result bundles can be collated with the new format.
@jineshqa try running the branch I suggested above with multi_scan. It will use version 2 of the test result bundle path
This should have everything you need.
Please try again.
Delete your Gemfile.lock file, make sure that you have modified your Pluginfile
per my instructions below, run bundle install
, and then run your fastlane again (with the --verbose
flag).
Pluginfile:
gem 'fastlane-plugin-test_center', :git => "https://github.com/lyndsey-ferguson/fastlane-plugin-test_center.git", :branch => "issue-145-crash-when-collating-test-bundles"
If there are still problems, please let me know and attach the complete console output as a text file to this issue (makes it easier for me to review). If it works, please let me know.
Monday Oct 7th EOD, promise.
@jineshqa I got your console.log from the closed issue. To answer the question, no, there is an edge-case that I overlooked. Thanks for providing the log, super helpful.
@jineshqa @szymon-kazmierczak I believe (:pray:) that I have fixed the issue.
Can you modify your Pluginfile
per my instructions below, (if you already have, please delete your Gemfile.lock
file), run bundle install
, and then run your fastlane again (with the --verbose
flag)?
Pluginfile:
gem 'fastlane-plugin-test_center', :git => "https://github.com/lyndsey-ferguson/fastlane-plugin-test_center.git", :branch => "issue-145-crash-when-collating-test-bundles"
If there are still problems, please let me know and attach the console output as a text file to this issue (makes it easier for me to review). If it works, please let me know.
@jineshqa @szymon-kazmierczak any update?
I still see the error. I followed your instructions to the dot. Below is my fastlane env output if it helps.
My plugin file looks like this,
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!
gem 'fastlane-plugin-test_center', :git => "https://github.com/lyndsey-ferguson/fastlane-plugin-test_center.git", :branch => "issue-145-crash-when-collating-test-bundles"
For some reason, it is failing to pre-delete xcresult files. When xcodebuild
tries to create a new one, it fails because it already exists.
Can you remove your Gemfile.lock
file, bundle install, and then re-run your lane with the --verbose
flag?
I've added more logging
There you go captain. @lyndsey-ferguson
@lyndsey-ferguson seems to be working for me! Btw, with multiscan parallel support my test run went down from 1 hour 20 minutes to 26 minutes with only 3 simulators 😂 Amazing work on the plugin 🤘
@szymon-kazmierczak thank you for testing and confirming the fix. I truly appreciate that you shared the good news and the joy 😄.
Now I just have to figure out what is going on with @jineshqa 's system.
@jineshqa can you please remove your Gemfile.lock
, modify your Pluginfile
per my instructions below, run bundle install
, and confirm that the revision SHA for the fastlane-plugin-test_center
is add995823a105d1b4b257a33fc7efaf92fa79f78
?
The section in the Gemfile.lock
file for the plugin should look like this:
GIT
remote: https://github.com/lyndsey-ferguson/fastlane-plugin-test_center.git
revision: add995823a105d1b4b257a33fc7efaf92fa79f78
branch: issue-145-crash-when-collating-test-bundles
specs:
fastlane-plugin-test_center (3.8.5)
colorize
json
plist
xcodeproj
xctest_list (>= 1.1.8)
Once you've confirmed that the Gemfile.lock
is pointing to the correct source, run your fastlane again (with the --verbose
flag).
Pluginfile:
gem 'fastlane-plugin-test_center', :git => "https://github.com/lyndsey-ferguson/fastlane-plugin-test_center.git", :branch => "issue-145-crash-when-collating-test-bundles"
If there are still problems, please let me know and attach the console output as a text file to this issue (makes it easier for me to review). If it works, please let me know.
Gemlock file screenshot
Pluginfile
gem 'fastlane-plugin-test_center', :git => "https://github.com/lyndsey-ferguson/fastlane-plugin-test_center.git", :branch => "issue-145-crash-when-collating-test-bundles"
Bundle list output
Console log console_verbose.txt
@jineshqa, the logs indicate that it was not run with the latest changes. For example, in the logs I see this:
[0;32;49m[worker 2] [0mDEBUG [2019-10-14 10:17:32.10]: Deleting xcresults:
[0;32;49m[worker 2] [0mDEBUG [2019-10-14 10:17:32.10]: Restarting Simulator D7EF0888
Where on my local, I see this:
[worker 1] DEBUG [2019-10-14 14:01:37.48]: About to check if we are using Xcdoe 11
[worker 1] DEBUG [2019-10-14 14:01:37.48]: Also looking in '/Users/lyndsey.ferguson/repo/fastlane-plugin-test_center/fastlane/test_output/AtomicBoyTests-batch-1' for xcresult bundles
[worker 1] DEBUG [2019-10-14 14:01:37.48]: Deleting xcresults:
[worker 1] DEBUG [2019-10-14 14:01:37.48]: /Users/lyndsey.ferguson/repo/fastlane-plugin-test_center/fastlane/test_output/AtomicBoyTests-batch-1/AtomicBoy.test_result.xcresult
[worker 1] DEBUG [2019-10-14 14:01:37.49]: Restarting Simulator EF4C5F39
The difference above tells me that what you are running is not using the latest code.
Is this running on CI and your bundle install was performed locally? CI must have the same Gemfile.lock
and Pluginfile
in order to get those changes.
@lyndsey-ferguson I am running it on local and I do bundle install manually. What you are suggesting is that somehow I am not running the latest code from the branch that you told me to add in plugin file? If yes, kindly tell me how to make sure that I am running the latest. I checked the SHA and it's same as you mentioned. Also, I uninstalled the fastlane-plugin-test_center gem before I ran bundle install just to be sure. What else should I be doing?
Let's put a breakpoint in to see if it is the same code. I will assume that you have not done debugging of Ruby code before, so please be patient and follow these instructions (and thank you for your participation!!):
gem 'pry-byebug'
to your Gemfile
bundle install
Fastfile
add this to the top: require 'pry-byebug'
Fastfile
, above the line where you call multi_scan
add byebug
.parallel_testrun_count
(otherwise your code will lock up waiting for you to respond to the debug console in another process that you do not have access to).--verbose
flagbyebug
debug session.xcresults
by typing:
b ::TestCenter::Helper::MultiScanManager::RetryingScanHelper#delete_xcresults
c
to continue
For example, it will look like this:
[35, 44] in /Users/lyndsey.ferguson/repo/fastlane-plugin-test_center/lib/fastlane/plugin/test_center/helper/multi_scan_manager/retrying_scan_helper.rb
35: `xcrun simctl boot #{udid} 2>/dev/null`
36: end
37: end
38: end
39:
=> 40: def delete_xcresults
41: derived_data_path = File.expand_path(@options[:derived_data_path] || Scan.config[:derived_data_path])
42: xcresults = Dir.glob("#{derived_data_path}/Logs/Test/*.xcresult")
43: FastlaneCore::UI.verbose("About to check if we are using Xcdoe 11")
44: if FastlaneCore::Helper.xcode_at_least?('11.0.0')
c
to continue if your code looks like the above. Once a test-run completes, it will stop here again. Press n
to follow the code to see what is going on here. If it does not stop here, we'll figure out what to do next.Please be sure to include the file path as I did. I want to make sure it is using the correct gem.
One other thing, you do not have to uninstall the gem. But you do need to remove the Gemfile.lock
file. Also, and this is important, are you running fastlane
with the bundle exec
command? It makes sure that the gems that are being used are the ones you specified in your Gemfile
.
Very important
i.e.:
bundle exec fastlane <your_lane_name_here> --verbose
@lyndsey-ferguson Apologies for the delay. I am dealing with a stupid setup issue.
INFO [2019-10-15 16:26:51.12]: ▸ Loading...
INFO [2019-10-15 16:26:51.38]: ▸ Ignoring byebug-11.0.1 because its extensions are not built. Try: gem pristine byebug --version 11.0.1
INFO [2019-10-15 16:26:51.64]: ▸ Could not find byebug-11.0.1 in any of the sources
INFO [2019-10-15 16:26:51.64]: ▸ Run `bundle install` to install missing gems.
Even though byebug is installed.
~ bundle list | grep 'byebug'
* byebug (11.0.1)
* pry-byebug (3.7.0)
Any idea?
How are you calling it? This is what I would do if I were you:
pry-byebug
gem to your Gemfile.bundle exec fastlane your_lane_name --verbose
This is when you've put the require 'pry-byebug'
in your Fastfile
right?
If you ran gem install pry-byebug
that may not install it in the right place for when you run bundle exec fastlane ...
.
That is exactly what I am trying to do but when I execute bundle exec fastlane sweep --verbose
command fails with the below error.
INFO [2019-10-15 16:26:51.12]: ▸ Loading...
INFO [2019-10-15 16:26:51.38]: ▸ Ignoring byebug-11.0.1 because its extensions are not built. Try: gem pristine byebug --version 11.0.1
INFO [2019-10-15 16:26:51.64]: ▸ Could not find byebug-11.0.1 in any of the sources
INFO [2019-10-15 16:26:51.64]: ▸ Run `bundle install` to install missing gems.```
Ah, did you already gem pristine byebug --version 11.0.1
?
Otherwise I would gem cleanup byebug; gem cleanup pry-byebug
Now my entire ruby installation is messed up. The default one on the OS.
What did you do? I cannot imagine that running those commands would cause the problem.
Unless, you ran other commands with sudo
. That would be very dangerous.
I highly recommend using a virtual version manager such as rbenv. That way you will not break your system Ruby and you can install any version of Ruby that you want.
New Issue Checklist
fastlane-plugin-test_center
to the latest versionIssue Description
I am trying to run tests using multi_scan, at the end of parallel test run collate actions fail. Please see the output for more details.
Complete output when running fastlane, including the stack trace and command used
Environment