fastlane-plugin-test_center 3.2.1 → 3.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 01072b26dc483882f807f087b095f47b7f282f52
4
- data.tar.gz: e4373343152c326ae60899501e1e54b022c30b33
3
+ metadata.gz: 22efb0b52e8b86d46ccf45368b8a64c852bf0013
4
+ data.tar.gz: 4c2d24379cb74a8124e657b47b8c5509b8122d06
5
5
  SHA512:
6
- metadata.gz: 796e68e32c29601fcd85a6dbf563072db653fb33676e261a3a33273c6fe501acf015e5a13682443a0b6a5c4fb064417b235a70f7ef7c386bf2c027808ecfb26f
7
- data.tar.gz: f7f629e9f40551b69220032df107abb0e3e2d73e072396a8ba2135c09c825f7ac8a67b3206585ce4c2e5d42ca055ba4c4cb2d5b98f403778c94709e347d90158
6
+ metadata.gz: 5db959306a7c4cb9ee3275df348be062fde1e8d32d1af2335ed0c8565dc8ec697065938fac884319c7db35c68e532f4f6e60c301b6cd6f9badf0071a12f7c0a5
7
+ data.tar.gz: 4577b7f03dc5e61fe468eea90718ad577f3b3a39c54730c014bc080298f4e2ece9c9ee92756c00f323978d2ea08ad4c6e7ef617eac18f80e9f810f69670d17d4
@@ -45,7 +45,7 @@ module Fastlane
45
45
  testcases.each do |testcase|
46
46
  testresult = testcase.parent.parent
47
47
  target_testresult = testcase_from_testsuite(target_testsuite, testcase.text)
48
- collate_testresults(target_testresult, testresult)
48
+ collate_testresults(target_testsuite, target_testresult, testresult)
49
49
  end
50
50
  else
51
51
  testable = testsuite.parent
@@ -53,12 +53,12 @@ module Fastlane
53
53
  end
54
54
  end
55
55
 
56
- def self.collate_testresults(target_testresult, testresult)
56
+ def self.collate_testresults(target_testsuite, target_testresult, testresult)
57
57
  if target_testresult
58
58
  collate_testresult_details(target_testresult, testresult)
59
59
  target_testresult.parent.replace_child(target_testresult, testresult)
60
60
  else
61
- target_testresult << testresult
61
+ target_testsuite << testresult
62
62
  end
63
63
  end
64
64
 
@@ -97,8 +97,14 @@ module Fastlane
97
97
  "contains(@class, 'failing')]"
98
98
 
99
99
  test_failures = REXML::XPath.match(report, failing_tests_xpath)
100
- REXML::XPath.first(report, ".//*[@id='test-count']/span").text = tests.size
101
- REXML::XPath.first(report, ".//*[@id='fail-count']/span").text = test_failures.size
100
+ test_count = REXML::XPath.first(report, ".//*[@id='test-count']/span")
101
+ if test_count
102
+ test_count.text = tests.size
103
+ end
104
+ fail_count = REXML::XPath.first(report, ".//*[@id='fail-count']/span")
105
+ if fail_count
106
+ fail_count.text = test_failures.size
107
+ end
102
108
  end
103
109
 
104
110
  def self.details_for_testresult(testresult)
@@ -43,7 +43,7 @@ module Fastlane
43
43
  passing_testcount = 0
44
44
  failed_tests = []
45
45
  failure_details = {}
46
- report_files = Dir.glob("#{scan_options[:output_directory]}/**/*#{reportnamer.junit_filextension}").map do |relative_filepath|
46
+ report_files = Dir.glob("#{scan_options[:output_directory]}/**/#{reportnamer.junit_fileglob}").map do |relative_filepath|
47
47
  File.absolute_path(relative_filepath)
48
48
  end
49
49
  report_files.each do |report_file|
@@ -54,7 +54,7 @@ module Fastlane
54
54
  end
55
55
 
56
56
  if reportnamer.includes_html?
57
- report_files += Dir.glob("#{scan_options[:output_directory]}/**/*#{reportnamer.html_filextension}").map do |relative_filepath|
57
+ report_files += Dir.glob("#{scan_options[:output_directory]}/**/#{reportnamer.html_fileglob}").map do |relative_filepath|
58
58
  File.absolute_path(relative_filepath)
59
59
  end
60
60
  end
@@ -99,7 +99,7 @@ module Fastlane
99
99
  end
100
100
 
101
101
  def self.details
102
- "Use this action to run your tests if you have fragile tests that fail" \
102
+ "Use this action to run your tests if you have fragile tests that fail " \
103
103
  "sporadically, if you have a huge number of tests that should be " \
104
104
  "batched, or have multiple test targets and need meaningful junit reports."
105
105
  end
@@ -185,7 +185,7 @@ module Fastlane
185
185
  if passed_test_count > 0 && failed_test_count > passed_test_count / 2
186
186
  UI.abort_with_message!("Too many tests are failing")
187
187
  end
188
- UI.message("😊 everything is fine, let\'s continue try #{try_attempt + 1} for batch #{batch}")
188
+ UI.message("\u{1f60a} everything is fine, let\'s continue try #{try_attempt + 1} for batch #{batch}")
189
189
  }
190
190
  )'
191
191
  ]
@@ -92,7 +92,7 @@ module TestCenter
92
92
  end
93
93
 
94
94
  def collate_reports(output_directory, reportnamer)
95
- report_files = Dir.glob("#{output_directory}/*#{reportnamer.junit_filextension}").map do |relative_filepath|
95
+ report_files = Dir.glob("#{output_directory}/#{reportnamer.junit_fileglob}").map do |relative_filepath|
96
96
  File.absolute_path(relative_filepath)
97
97
  end
98
98
  if report_files.size > 1
@@ -105,11 +105,11 @@ module TestCenter
105
105
  )
106
106
  Fastlane::Actions::CollateJunitReportsAction.run(config)
107
107
  end
108
- retried_junit_reportfiles = Dir.glob("#{output_directory}/**/*-[1-9]*#{reportnamer.junit_filextension}")
108
+ retried_junit_reportfiles = Dir.glob("#{output_directory}/#{reportnamer.junit_numbered_fileglob}")
109
109
  FileUtils.rm_f(retried_junit_reportfiles)
110
110
 
111
111
  if reportnamer.includes_html?
112
- report_files = Dir.glob("#{output_directory}/*#{reportnamer.html_filextension}").map do |relative_filepath|
112
+ report_files = Dir.glob("#{output_directory}/#{reportnamer.html_fileglob}").map do |relative_filepath|
113
113
  File.absolute_path(relative_filepath)
114
114
  end
115
115
  if report_files.size > 1
@@ -122,7 +122,7 @@ module TestCenter
122
122
  )
123
123
  Fastlane::Actions::CollateHtmlReportsAction.run(config)
124
124
  end
125
- retried_html_reportfiles = Dir.glob("#{output_directory}/**/*-[1-9]*#{reportnamer.html_filextension}")
125
+ retried_html_reportfiles = Dir.glob("#{output_directory}/#{reportnamer.html_numbered_fileglob}")
126
126
  FileUtils.rm_f(retried_html_reportfiles)
127
127
  end
128
128
  end
@@ -64,8 +64,14 @@ module TestCenter
64
64
  File.extname(junit_reportname)
65
65
  end
66
66
 
67
- # --- HTML ---
68
- # TODO: what to do when there are no html output types?
67
+ def junit_fileglob
68
+ "#{File.basename(junit_reportname, '.*')}*#{junit_filextension}"
69
+ end
70
+
71
+ def junit_numbered_fileglob
72
+ "#{File.basename(junit_reportname, '.*')}-[1-9]*#{junit_filextension}"
73
+ end
74
+
69
75
  def includes_html?
70
76
  @output_types.split(',').find_index('html') != nil
71
77
  end
@@ -84,6 +90,14 @@ module TestCenter
84
90
  File.extname(html_reportname)
85
91
  end
86
92
 
93
+ def html_fileglob
94
+ "#{File.basename(html_reportname, '.*')}*#{html_filextension}"
95
+ end
96
+
97
+ def html_numbered_fileglob
98
+ "#{File.basename(html_reportname, '.*')}-[1-9]*#{html_filextension}"
99
+ end
100
+
87
101
  def increment
88
102
  @report_count += 1
89
103
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module TestCenter
3
- VERSION = "3.2.1"
3
+ VERSION = "3.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-test_center
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lyndsey Ferguson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-16 00:00:00.000000000 Z
11
+ date: 2018-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plist