Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

collate_junit_reports action fails on version 3.15.3 #335

Open
5 tasks done
jdoshi-indeed opened this issue Apr 9, 2021 · 8 comments
Open
5 tasks done

collate_junit_reports action fails on version 3.15.3 #335

jdoshi-indeed opened this issue Apr 9, 2021 · 8 comments

Comments

@jdoshi-indeed
Copy link

New Issue Checklist

  • Updated fastlane-plugin-test_center to the latest version
  • I read the README.md
  • I reviewed the example(s) for the action(s) I am using
  • I have removed any sensitive data such as passwords, authentication tokens, or anything else I do not want to world to see
  • I have reviewed the Discussions forum to see my question has already been addressed.

If you love this fastlane plugin, consider sponsoring it or asking your company to sponsor it. I would really appreciate any
gesture: https://github.com/sponsors/lyndsey-ferguson. 😍

Issue Description

I am using collate_junit_reports action. It still works on a very old version on my Jenkins environment but when I tried collating on my desktop with latest version it failed.

Complete output when running fastlane, including the stack trace and command used
[11:26:36]: ----------------------------------- [11:26:36]: --- Step: collate_junit_reports --- [11:26:36]: ----------------------------------- +------------------+---------------------+ | Lane Context | +------------------+---------------------+ | DEFAULT_PLATFORM | ios | | PLATFORM_NAME | ios | | LANE_NAME | ios collate_results | +------------------+---------------------+

+------+---------------------------------------------------------------+-------------+
| fastlane summary |
+------+---------------------------------------------------------------+-------------+
| Step | Action | Time (in s) |
+------+---------------------------------------------------------------+-------------+
| 1 | Verifying fastlane version | 0 |
| 2 | default_platform | 0 |
| 3 | trainer -p ./test_output/testresult2021.03.30-04.31.26.xcresu | 2 |
| 4 | trainer -p ./test_output/testresult2021.03.30-04.44.12.xcresu | 2 |
| 5 | trainer -p ./test_output/testresult2021.03.30-04.49.41.xcresu | 2 |
| 6 | trainer -p ./test_output/testresult.xcresult -o ./test_output | 2 |
| 💥 | collate_junit_reports | 0 |
+------+---------------------------------------------------------------+-------------+

[11:26:36]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane...

➡️ Undefined method `status' for nil:NilClass (NoMethodError)
fastlane/fastlane#17910 [open] 32 💬
2 weeks ago

➡️ update_project_provisioning.rb:74:in block (2 levels) in run': \e[31m[!] undefined method []' for nil:NilClass\e[0m (NoMethodError)
https://github.com/fastlane/fastlane/issues/18486 [open] 1 💬
a week ago

➡️ [Swift] undefined method `each' for nil:NilClass - Cannot Create Group Within FastlaneSwiftRunner Project
fastlane/fastlane#15184 [open] 56 💬
a week ago

and 323 more at: https://github.com/fastlane/fastlane/search?q=undefined%20method%20%60value%27%20for%20nil&type=Issues&utf8=✓

🔗 You can ⌘ + double-click on links to open them directly in your browser.
Traceback (most recent call last):
28: from /Users/jinesh/.rbenv/versions/2.6.3/bin/fastlane:23:in <main>' 27: from /Users/jinesh/.rbenv/versions/2.6.3/bin/fastlane:23:in load'
26: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/bin/fastlane:23:in <top (required)>' 25: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane/lib/fastlane/cli_tools_distributor.rb:122:in take_off'
24: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane/lib/fastlane/commands_generator.rb:41:in start' 23: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane/lib/fastlane/commands_generator.rb:352:in run'
22: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in run!' 21: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in run!'
20: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in run_active_command' 19: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in run'
18: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in call' 17: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane/lib/fastlane/commands_generator.rb:108:in block (2 levels) in run'
16: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane/lib/fastlane/command_line_handler.rb:36:in handle' 15: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane/lib/fastlane/lane_manager.rb:47:in cruise_lane'
14: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:45:in execute' 13: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:45:in chdir'
12: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:49:in block in execute' 11: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane/lib/fastlane/lane.rb:33:in call'
10: from Fastfile:650:in block (2 levels) in parsing_binding' 9: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane/lib/fastlane/fast_file.rb:159:in method_missing'
8: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:157:in trigger_action_by_name' 7: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:229:in execute_action'
6: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:229:in chdir' 5: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:255:in block in execute_action'
4: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in execute_action' 3: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:263:in block (2 levels) in execute_action'
2: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-plugin-test_center-3.15.3/lib/fastlane/plugin/test_center/actions/collate_junit_reports.rb:13:in run' 1: from /Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-plugin-test_center-3.15.3/lib/fastlane/plugin/test_center/actions/collate_junit_reports.rb:13:in map'
/Users/jinesh/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-plugin-test_center-3.15.3/lib/fastlane/plugin/test_center/actions/collate_junit_reports.rb:13:in block in run': [!] undefined method value' for nil:NilClass (NoMethodError)

Environment

🚫 fastlane environment 🚫

Stack

Key Value
OS 10.15.7
Ruby 2.6.3
Bundler? false
Git git version 2.24.3 (Apple Git-128)
Installation Source ~/.rbenv/versions/2.6.3/bin/fastlane
Host Mac OS X 10.15.7 (19H524)
Ruby Lib Dir ~/.rbenv/versions/2.6.3/lib
OpenSSL Version OpenSSL 1.1.1g 21 Apr 2020
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 12.4

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL
LANGUAGE
`./fastlane/Appfile`
app_identifier "com.abcdef.JobSearch" # The bundle identifier of your app
apple_id "ios-dev@abcdef.com" # Your Apple email address

team_id "zjdfldslds" # Developer Portal Team ID

# you can even provide different app identifiers, Apple IDs and team names per lane:
# More information: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Appfile.md

fastlane gems

Gem Version Update-Status
fastlane 2.179.0 🚫 Update available

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-test_center 3.15.3 ✅ Up-To-Date
Loaded gems
Gem Version
did_you_mean 1.3.0
slack-notifier 2.3.2
atomos 0.1.3
CFPropertyList 3.0.2
colored2 3.1.2
nanaimo 0.3.0
xcodeproj 1.19.0
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 2.0.0
unicode-display_width 1.7.0
terminal-table 1.8.0
plist 3.5.0
public_suffix 4.0.6
addressable 2.7.0
multipart-post 2.0.0
word_wrap 1.0.0
tty-screen 0.8.1
tty-cursor 0.7.1
tty-spinner 0.9.3
artifactory 3.0.15
babosa 1.0.4
colored 1.2
highline 1.7.10
commander-fastlane 4.4.6
excon 0.78.0
ruby2_keywords 0.0.2
faraday 1.1.0
unf_ext 0.0.7.7
unf 0.1.4
domain_name 0.5.20190701
http-cookie 1.0.3
faraday-cookie_jar 0.0.7
faraday_middleware 1.0.0
fastimage 2.2.0
gh_inspector 1.1.3
mini_magick 4.10.1
naturally 2.2.0
rubyzip 2.3.0
security 0.1.3
xcpretty-travis-formatter 1.0.0
dotenv 2.7.6
bundler 1.17.2
simctl 1.6.8
jwt 2.2.2
uber 0.1.0
declarative 0.0.20
declarative-option 0.1.0
representable 3.0.4
retriable 3.1.2
mini_mime 1.0.2
multi_json 1.15.0
signet 0.14.0
memoist 0.16.2
os 1.1.1
googleauth 0.14.0
httpclient 2.8.3
google-api-client 0.38.0
google-cloud-env 1.4.0
google-cloud-errors 1.0.1
google-cloud-core 1.5.0
rake 13.0.1
digest-crc 0.6.1
google-cloud-storage 1.29.1
emoji_regex 3.0.0
jmespath 1.4.0
aws-partitions 1.386.0
aws-eventstream 1.1.0
aws-sigv4 1.2.2
aws-sdk-core 3.109.1
aws-sdk-kms 1.39.0
aws-sdk-s3 1.83.1
claide 1.0.3
json 2.3.1
forwardable 1.2.0
logger 1.3.0
stringio 0.0.2
ipaddr 1.2.2
openssl 2.1.2
ostruct 0.1.0
strscan 1.0.0
date 2.0.0
fileutils 1.1.0
etc 1.0.1
io-console 0.4.7
zlib 1.0.0
rexml 3.1.9
psych 3.1.0
mutex_m 0.1.0
webrick 1.4.2
trainer 0.9.1
xctest_list 1.2.1
colorize 0.8.1
fastlane-plugin-test_center 3.15.3

generated on: 2021-04-09

encrypted.zip

@jdoshi-indeed
Copy link
Author

Just debugged across versions and I can confidently say that this has broken between version 3.14.2 and 3.14.3.

@jdoshi-indeed
Copy link
Author

@lyndsey-ferguson any plans to get to this?

@lyndsey-ferguson
Copy link
Owner

@jdoshi-indeed I don't think I'll have time to look into this until December. I have placed this at the top of the list in the kanban board for this project.

@jdoshi-indeed
Copy link
Author

@lyndsey-ferguson Could I help you? Of course I would need some guidance from you.

@lyndsey-ferguson
Copy link
Owner

Hello @jdoshi-indeed, yes I would appreciate any help and I can provide guidance. I do not think you even need a lot of experience in Ruby, just a little willpower to push through the obstacles of lack-of-knowledge.

You can use these fastlane instructions on debugging in the same way that you can in the plugin.
maybe I should add more instructions on how to debug this plugin until I get more time

You can see that it is crashing here:

fastlane-plugin-test_center-3.15.3/lib/fastlane/plugin/test_center/actions/collate_junit_reports.rb:13

Here's what I suggest (forgive me if I miss a step):

  1. clone this repo to your computer
  2. enter the repo and make a new branch git checkout -b issue-335-fix-collate-junit-reports-crash origin/master
  3. modify your project's Pluginfile to point to your local version of this repo like so:
    Pluginfile:
gem 'fastlane-plugin-test_center', :path => "<actual absolute path to your copy of the plugin>"
  1. Using the debug instructions, modify your project's Gemfile to include gem 'pry'.
  2. Run bundle install in your project's directory.
  3. Edit your local copy of test_center, <path to where you cloned test-center/lib/fastlane/plugin/test_center/actions/collate_junit_reports.rb. Line 12, add binding.pry.
  4. Run your fastlane. The breakpoint should stop the code before the collation. Examine what is going on and then dig around to how the collation got a Nil.

You can use this documentation to figure out how to use the debugging commands.

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.

@jdoshi-indeed
Copy link
Author

HI @lyndsey-ferguson , I compared the files across version 3.14.2 and 3.14.3. On line 13 in newer version code is looking for package name attribute I believe but sometimes, junit reports may not have one. I am not sure how to handle such case. Could you look into it?

Comparing_v3_14_2___v3_14_3_·_lyndsey-ferguson_fastlane-plugin-test_center

Thanks,
Jinesh

@lyndsey-ferguson
Copy link
Owner

Can you post an example of such a Junit XML file? You can see that the name attribute is referenced in other places such as line 19.

@jdoshi-indeed
Copy link
Author

Hi @lyndsey-ferguson ,

Please find sample xml attached.
sample_xml.zip

Thanks,
Jinesh

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

No branches or pull requests

2 participants