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

crash when collating html reports: Unexpected node test #150

Closed
4 tasks done
bluwave opened this issue Oct 7, 2019 · 18 comments
Closed
4 tasks done

crash when collating html reports: Unexpected node test #150

bluwave opened this issue Oct 7, 2019 · 18 comments

Comments

@bluwave
Copy link

bluwave commented Oct 7, 2019

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

Issue Description

multi_scan

fastlane sweep

appears to finish testing but get the error:

ERROR [2019-10-07 15:37:01.60]: [BUG] Unexpected node test: <:predicate>: <[[:eq, [:function, "normalize-space", []], [:literal, "testExample2"]], :parent, :node, :parent, :node, :parent, :node]>

see sample project https://github.com/bluwave/TestCenterBug

xcode 11.1, catalina

Complete output when running fastlane, including the stack trace and command used
ERROR [2019-10-07 15:37:01.60]: [BUG] Unexpected node test: <:predicate>: <[[:eq, [:function, "normalize-space", []], [:literal, "testExample2"]], :parent, :node, :parent, :node, :parent, :node]>
Traceback (most recent call last):
	50: from /usr/local/bin/fastlane:23:in `'
	49: from /usr/local/bin/fastlane:23:in `load'
	48: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/bin/fastlane:23:in `'
	47: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in `take_off'
	46: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
	45: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/commands_generator.rb:349:in `run'
	44: from /Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
	43: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
	42: from /Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
	41: from /Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
	40: from /Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
	39: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
	38: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
	37: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'
	36: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
	35: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
	34: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
	33: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/lane.rb:33:in `call'
	32: from Fastfile:39:in `block (2 levels) in parsing_binding'
	31: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
	30: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
	29: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/runner.rb:227:in `execute_action'
	28: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/runner.rb:227:in `chdir'
	27: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/runner.rb:235:in `block in execute_action'
	26: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
	25: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/runner.rb:256:in `block (2 levels) in execute_action'
	24: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/actions/multi_scan.rb:23:in `run'
	23: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:53:in `run'
	22: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:146:in `run_test_batches'
	21: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:164:in `collate_batched_reports'
	20: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:164:in `each'
	19: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:165:in `block in collate_batched_reports'
	18: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:204:in `collate_batched_reports_for_testable'
	17: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/report_collator.rb:22:in `collate'
	16: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/report_collator.rb:81:in `collate_html_reports'
	15: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/actions/collate_html_reports.rb:13:in `run'
	14: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/actions/collate_html_reports.rb:13:in `each'
	13: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/actions/collate_html_reports.rb:14:in `block in run'
	12: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/html_test_report.rb:28:in `collate_report'
	11: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/html_test_report.rb:28:in `each'
	10: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/html_test_report.rb:35:in `block in collate_report'
	 9: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/html_test_report.rb:192:in `collate_testsuite'
	 8: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/html_test_report.rb:192:in `each'
	 7: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/html_test_report.rb:193:in `block in collate_testsuite'
	 6: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/html_test_report.rb:146:in `testcase_with_title'
	 5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rexml/xpath.rb:39:in `first'
	 4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rexml/xpath_parser.rb:70:in `parse'
	 3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rexml/xpath_parser.rb:133:in `match'
	 2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rexml/xpath_parser.rb:183:in `expr'
	 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rexml/xpath_parser.rb:433:in `step'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rexml/xpath_parser.rb:565:in `node_test': [BUG] Unexpected node test: <:predicate>: <[[:eq, [:function, "normalize-space", []], [:literal, "testExample2"]], :parent, :node, :parent, :node, :parent, :node]> (RuntimeError)
	50: from /usr/local/bin/fastlane:23:in `'
	49: from /usr/local/bin/fastlane:23:in `load'
	48: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/bin/fastlane:23:in `'
	47: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in `take_off'
	46: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
	45: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/commands_generator.rb:349:in `run'
	44: from /Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
	43: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
	42: from /Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
	41: from /Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
	40: from /Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
	39: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
	38: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
	37: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'
	36: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
	35: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
	34: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
	33: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/lane.rb:33:in `call'
	32: from Fastfile:39:in `block (2 levels) in parsing_binding'
	31: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
	30: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
	29: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/runner.rb:227:in `execute_action'
	28: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/runner.rb:227:in `chdir'
	27: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/runner.rb:235:in `block in execute_action'
	26: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
	25: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.133.0/fastlane/lib/fastlane/runner.rb:256:in `block (2 levels) in execute_action'
	24: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/actions/multi_scan.rb:23:in `run'
	23: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:53:in `run'
	22: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:146:in `run_test_batches'
	21: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:164:in `collate_batched_reports'
	20: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:164:in `each'
	19: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:165:in `block in collate_batched_reports'
	18: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:204:in `collate_batched_reports_for_testable'
	17: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/report_collator.rb:22:in `collate'
	16: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/report_collator.rb:81:in `collate_html_reports'
	15: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/actions/collate_html_reports.rb:13:in `run'
	14: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/actions/collate_html_reports.rb:13:in `each'
	13: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/actions/collate_html_reports.rb:14:in `block in run'
	12: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/html_test_report.rb:28:in `collate_report'
	11: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/html_test_report.rb:28:in `each'
	10: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/html_test_report.rb:35:in `block in collate_report'
	 9: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/html_test_report.rb:192:in `collate_testsuite'
	 8: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/html_test_report.rb:192:in `each'
	 7: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/html_test_report.rb:193:in `block in collate_testsuite'
	 6: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/html_test_report.rb:146:in `testcase_with_title'
	 5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rexml/xpath.rb:39:in `first'
	 4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rexml/xpath_parser.rb:70:in `parse'
	 3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rexml/xpath_parser.rb:133:in `match'
	 2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rexml/xpath_parser.rb:183:in `expr'
	 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rexml/xpath_parser.rb:433:in `step'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rexml/xpath_parser.rb:565:in `node_test': [!] [BUG] Unexpected node test: <:predicate>: <[[:eq, [:function, "normalize-space", []], [:literal, "testExample2"]], :parent, :node, :parent, :node, :parent, :node]> (RuntimeError)

Environment

✅ fastlane environment ✅

Stack

Key Value
OS 10.15
Ruby 2.6.3
Bundler? false
Git git version 2.21.0 (Apple Git-122)
Installation Source /usr/local/bin/fastlane
Host Mac OS X 10.15 (19A582a)
Ruby Lib Dir /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
OpenSSL Version LibreSSL 2.8.3
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 11.1

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL
LANGUAGE

fastlane files:

`./fastlane/Fastfile`
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:ios)

platform :ios do

  lane :test_old do
    run_tests(project: "Test_Center_Bug.xcodeproj", devices: ["iPhone 8"], scheme: "Test_Center_Bug")
  end


  lane :sweep do
    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(
      project: "Test_Center_Bug.xcodeproj",
      try_count: 3,
      fail_build: false,
      scheme: 'Test_Center_Bug',
      testrun_completed_block: test_run_block,
      parallel_testrun_count: 4, 
      devices: ["iPhone 8 (13.1)"],
    )
    unless result[:failed_testcount].zero?
      UI.message("There are #{result[:failed_testcount]} legitimate failing tests")
    end
  end

end
`./fastlane/Appfile`
# app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app
# apple_id("[[APPLE_ID]]") # Your Apple email address


# For more information about the Appfile, see:
#     https://docs.fastlane.tools/advanced/#appfile

fastlane gems

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

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-test_center 3.8.5 ✅ Up-To-Date
Loaded gems
Gem Version
did_you_mean 1.3.0
slack-notifier 2.3.2
atomos 0.1.3
claide 1.0.3
colored2 3.1.2
nanaimo 0.2.6
xcodeproj 1.12.0
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 2.0.0
unicode-display_width 1.6.0
terminal-table 1.8.0
plist 3.5.0
public_suffix 2.0.5
addressable 2.7.0
multipart-post 2.0.0
word_wrap 1.0.0
tty-screen 0.7.0
tty-cursor 0.7.0
tty-spinner 0.9.1
babosa 1.0.3
colored 1.2
highline 1.7.10
commander-fastlane 4.4.6
excon 0.67.0
faraday 0.15.4
faraday_middleware 0.13.1
unf_ext 0.0.7.6
unf 0.1.4
domain_name 0.5.20190701
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
fastimage 2.1.7
gh_inspector 1.1.3
mini_magick 4.9.5
multi_xml 0.6.0
rubyzip 1.3.0
security 0.1.3
xcpretty-travis-formatter 1.0.0
dotenv 2.7.5
bundler 2.0.2
naturally 2.2.0
simctl 1.6.6
jwt 2.1.0
uber 0.1.0
declarative 0.0.10
declarative-option 0.1.0
representable 3.0.4
retriable 3.1.2
mime-types-data 3.2019.0904
mime-types 3.3
multi_json 1.13.1
signet 0.11.0
memoist 0.16.0
os 1.0.1
googleauth 0.6.7
httpclient 2.8.3
google-api-client 0.23.9
google-cloud-env 1.2.1
google-cloud-core 1.3.1
digest-crc 0.4.1
google-cloud-storage 1.16.0
emoji_regex 1.0.1
CFPropertyList 3.0.1
json 2.2.0
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
libxml-ruby 3.1.0
rexml 3.1.9
psych 3.1.0
mutex_m 0.1.0
xctest_list 1.1.8
colorize 0.8.1
fastlane-plugin-test_center 3.8.5

generated on: 2019-10-07

@lyndsey-ferguson lyndsey-ferguson changed the title Unexpected node test crash when collating html reports: Unexpected node test Oct 7, 2019
@lyndsey-ferguson
Copy link
Owner

I believe that this is a problem with REXML. See this Issue. I may be able to work around this, but can you try with Ruby 2.4.1?

@bluwave
Copy link
Author

bluwave commented Oct 8, 2019

Yeah, it worked on ruby 2.4.2. I'm trying to get this working on bitrise, i'll see if i can figure out how to use a different version of ruby.

@lyndsey-ferguson
Copy link
Owner

lyndsey-ferguson commented Oct 8, 2019

@bluwave hopefully you can find a way. I don't have a lot of time to work on this right now. It could be tricky.

My initial gut reaction is that the XPath call that I am making returns a nil internally and then it crashes. My thought of a workaround entails breaking the Xpath up into smaller paths to search with valid return nodes.

@lyndsey-ferguson
Copy link
Owner

I am open to Pull Requests if you want to attempt a fix. I believe that my use of normalize-space() here could be broken up (and other uses in that file of the same xpath function).

@lyndsey-ferguson
Copy link
Owner

@bluwave 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-150-crash-with-html-collation-ruby-2.6.x"

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.

@bluwave
Copy link
Author

bluwave commented Oct 12, 2019

Thanks for the quick fix. It did not work. I have attached the output.
lastOutput.txt

@lyndsey-ferguson
Copy link
Owner

I don't think that run of fastlane is using my branch: you should not see normalize-space() in the stackcrawl nor should you see the 3.8.5 version of the plugin in the path of ruby files being used. It should be in the form of a Git commit SHA.

Can you remove your Gemfile.lock file and re-run the instructions above?

@bluwave
Copy link
Author

bluwave commented Oct 13, 2019

My apologies. After retrying this and making sure it had the right branch, it worked 🎉.

@moatazeldebsy
Copy link

moatazeldebsy commented Oct 16, 2019

@lyndsey-ferguson I did the steps and the problem solved but the collate report issue happen again that all folders from workers removed and I got only one folder in the test results folder, it was working normally before changed the plugin file, can anyone help me in this

@moatazeldebsy
Copy link

@lyndsey-ferguson Please, can you merge the Open PRs? because they will solve our current problems

@lyndsey-ferguson
Copy link
Owner

@moatazeldebsy when you write merge the open PRs, are you referring just to this one:#153? The others are not related and not ready yet. I was hoping to put them all in the same release.

With regards to your comment about all folders being removed, that is the intended result if you leave collate_reports option as true.

@moatazeldebsy
Copy link

moatazeldebsy commented Oct 16, 2019

Thank you for replying , I mean All PRs, because we have different problems, we use the latest version of the Plugin and the result folders are not deleted so for example if we run on 6 devices we got 6 folders and we generate report from these folders , but we have this exception in this issue that Fastlane always failed because the error with Ruby version, I follow your steps to change the version in plugin file with the branch and the error solved but we the collate remove all the folders and give us only one folder , I add option to disable collate but the results are not accurate because all folder for the 1st run and 2 attempts are exciting and multiscan collect all of them in the summary for example if we have 25 test and run them again in retry action the results will be 50 . Because I found that all PRs are related to our issues

@lyndsey-ferguson
Copy link
Owner

Well, first this is the only PR that is ready. The other two that are open are not ready.

The PR only fixes the issue where collating html files fails for Ruby v2.6+ (which looks like you are facing). From what you describe, you are experiencing this issue only. Correct?

Are you facing problems with Xcode 11 and test_result bundles not collating correctly?

Are you facing problems with older xctestrun files with the OnlyTestIdentifiers key?

@moatazeldebsy
Copy link

Yes with the latest version of the plugin we have this error:

RuntimeError: [!] [BUG] Unexpected node test: <:predicate>: <[[:and, [:function, "contains", [[:function, "concat", [[:literal, " "], [:attribute, :qname, "", "class"], [:literal, " "]]], [:literal, " test "]]], [:function, "contains", [[:function, "concat", [[:literal, " "], [:attribute, :qname, "", "class"], [:literal, " "]]], [:literal, " failing "]]]]]>
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rexml/xpath_parser.rb:565:in `node_test'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rexml/xpath_parser.rb:433:in `step'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rexml/xpath_parser.rb:183:in `expr'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rexml/xpath_parser.rb:133:in `match'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rexml/xpath_parser.rb:70:in `parse'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rexml/xpath.rb:78:in `match'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/html_test_report.rb:92:in `update_fail_count'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/html_test_report.rb:40:in `collate_report'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/actions/collate_html_reports.rb:14:in `block in run'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/actions/collate_html_reports.rb:13:in `each'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/actions/collate_html_reports.rb:13:in `run'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/report_collator.rb:81:in `collate_html_reports'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/report_collator.rb:22:in `collate'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:204:in `collate_batched_reports_for_testable'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:165:in `block in collate_batched_reports'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:164:in `each'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:164:in `collate_batched_reports'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:146:in `run_test_batches'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb:53:in `run'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-plugin-test_center-3.8.5/lib/fastlane/plugin/test_center/actions/multi_scan.rb:23:in `run'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/runner.rb:256:in `block (2 levels) in execute_action'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/runner.rb:235:in `block in execute_action'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/runner.rb:227:in `chdir'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/runner.rb:227:in `execute_action'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/fast_file.rb:154:in `method_missing'
  Fastfile:1024:in `block (2 levels) in parsing_binding'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/lane.rb:33:in `call'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/runner.rb:204:in `try_switch_to_lane'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/runner.rb:146:in `trigger_action_by_name'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/fast_file.rb:154:in `method_missing'
  Fastfile:954:in `block (2 levels) in parsing_binding'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/lane.rb:33:in `call'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/runner.rb:45:in `chdir'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/runner.rb:45:in `execute'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
  /Users/vagrant/.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'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/commands_generator.rb:333:in `run'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in `take_off'
  /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.128.1/bin/fastlane:23:in `<top (required)>'
  /Users/vagrant/.rbenv/versions/2.6.3/bin/fastlane:23:in `load'
  /Users/vagrant/.rbenv/versions/2.6.3/bin/fastlane:23:in `<top (required)>'
[14:40:17]: Deleting iPhone Xʀ Clone 1 TestCenter::Helper::MultiScanManager::SimulatorHelper<70234578172980>
[14:40:30]: Deleting iPhone Xʀ Clone 2 TestCenter::Helper::MultiScanManager::SimulatorHelper<70234578172980>
[14:40:39]: Deleting iPhone Xʀ Clone 3 TestCenter::Helper::MultiScanManager::SimulatorHelper<70234578172980>
[14:40:48]: Deleting iPhone Xʀ Clone 4 TestCenter::Helper::MultiScanManager::SimulatorHelper<70234578172980>
[14:40:56]: Deleting iPhone Xʀ Clone 5 TestCenter::Helper::MultiScanManager::SimulatorHelper<70234578172980>
[14:41:04]: Deleting iPhone Xʀ Clone 6 TestCenter::Helper::MultiScanManager::SimulatorHelper<70234578172980>

and the we have all the test results folders for the 6 devices , but after I changed the Fastlane PluginFile and add the branch the problem solved but the collate is not working correctly all folders deleted with screenshots and logs files , and if I add collate_reports:false all the folders exsit but contains the re-run folders and the multiscan summary displayed the results including all of these folders for example if we have 25 tests and we re-run 5 test cases 3 times the final number of test cases will be 40 test cases. And the results issue was working before

@lyndsey-ferguson
Copy link
Owner

Please be patient, but I am having difficulty understanding. Here is what I think you are saying:

  1. With the released version of the plugin, you see the crash:
RuntimeError: [!] [BUG] Unexpected node test: <:predicate>: <[[:and, [:function, "contains", [[:function, "concat", [[:literal, " "], [:attribute, :qname, "", "class"], [:literal, " "]]], [:literal, " test "]]], [:function, "contains", [[:function, "concat", [[:literal, " "], [:attribute, :qname, "", "class"], [:literal, " "]]], [:literal, " failing "]]]]]>
  1. You see that this is fixed when you follow the instructions on using the fix for this Issue crash when collating html reports: Unexpected node test #150. Is that correct?

  2. You are seeing a new issue that for the collated test_result bundles, the collation fails and you lose your screenshots and log files?

I find it difficult when there are no newlines in a large paragraph. Could you make sure you create new paragraphs when responding? That may help me understand faster 😄 .

Thank you for your patience and involvement!

@moatazeldebsy
Copy link

Ok Sorry for that, I will make it simple :

1- We are using version fastlane-plugin-test_center (3.8.6) but we have this problem #150 and collate_test_result_bundles is working normally and we have a folder for each device ex: we run on 6 devices, So we have 6 folders including screenshots, logs, and all files

2- We updated the Pluginfile with this instructions and the problem with ruby 2.6+ solved but collate_test_result_bundles is not working correctly and removed all folder

3- We try to solve the collate issue by adding collate_reports:false in the lane, the folders exist but with the re-run folders, and when we generate report from these folders we got the wrong number of test cases because of multiscan calculate the re-run tests in the total for ex: if we have 25 tests and we re-run 5 test cases 3 times the final number of test cases will be 40 test cases

4- We have also this issue Multiscan runs all the disabled tests in the scheme because we disabled test cases in the scheme but we found it in the run.

Hope that is clear now :)

@lyndsey-ferguson
Copy link
Owner

Thank you!! That helps. The good news is that I should be able to merge the first two issues, I'm still waiting for tests for the disabled tests PR.

@lyndsey-ferguson
Copy link
Owner

Fixed in v3.8.7

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

3 participants