fastlane-plugin-retry_tests 1.1.7 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/fastlane/plugin/retry_tests.rb +2 -2
- data/lib/fastlane/plugin/retry_tests/actions/collate_junit_reports.rb +19 -24
- data/lib/fastlane/plugin/retry_tests/actions/multi_scan.rb +2 -5
- data/lib/fastlane/plugin/retry_tests/actions/suppress_tests.rb +0 -0
- data/lib/fastlane/plugin/retry_tests/actions/suppress_tests_from_junit.rb +0 -0
- data/lib/fastlane/plugin/retry_tests/actions/suppressed_tests.rb +0 -0
- data/lib/fastlane/plugin/retry_tests/actions/tests_from_junit.rb +0 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf787e00a75492f256a7eb024485674d9ee775ff
|
4
|
+
data.tar.gz: 1bf716ccf0f658b7ed844e2593919c9ce4666597
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc965c5d35156bdaf1705bd246d3790dc5a3a258d1d6a9193b02890febce64b3a8cf03abc792232bcbd2d8c429586e25c1d41ebdf674475f07d5a128572449c4
|
7
|
+
data.tar.gz: d4971ba07cb80886c04762c0dd9b908eb06822ce61446c7f9381a896f7b6ede87caea17d42e9d2b46c5ecc4d4702145617ecd2a361d5627378aa84dae5e7569e
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'fastlane/plugin/retry_tests/version'
|
2
2
|
|
3
3
|
module Fastlane
|
4
|
-
module
|
4
|
+
module TestCenter
|
5
5
|
# Return all .rb files inside the "actions" and "helper" directory
|
6
6
|
def self.all_classes
|
7
7
|
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
@@ -11,6 +11,6 @@ end
|
|
11
11
|
|
12
12
|
# By default we want to import all available actions and helpers
|
13
13
|
# A plugin can contain any number of actions and plugins
|
14
|
-
Fastlane::
|
14
|
+
Fastlane::TestCenter.all_classes.each do |current|
|
15
15
|
require current
|
16
16
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
#Adapted from the "fastlane-plugin-test_center" plugin
|
2
1
|
|
3
2
|
require 'nokogiri'
|
4
3
|
require 'nokogiri-plist'
|
@@ -12,12 +11,9 @@ module Fastlane
|
|
12
11
|
if report_filepaths.size == 1
|
13
12
|
FileUtils.cp(report_filepaths[0], params[:collated_report])
|
14
13
|
else
|
15
|
-
#Convert .plist reports to Nokogiri XML objects
|
16
14
|
target_report = File.open(report_filepaths.shift) {|f| Nokogiri::XML(f)}
|
17
15
|
file_name = params[:collated_report] + "/#{params[:scheme]}.test_result/1_Test/action_TestSummaries.plist"
|
18
16
|
reports = report_filepaths.map { |report_filepath| Nokogiri::XML(Nokogiri::PList(open(report_filepath)).to_plist_xml) }
|
19
|
-
|
20
|
-
#Merge .plist reports
|
21
17
|
reports.each do |retry_report|
|
22
18
|
mergeLists(target_report, retry_report, params)
|
23
19
|
end
|
@@ -26,15 +22,24 @@ module Fastlane
|
|
26
22
|
copy_log(params[:logs], params[:collated_report] + "/")
|
27
23
|
end
|
28
24
|
|
25
|
+
def self.clean_report(report)
|
26
|
+
report = report.gsub(/<(\w+): 0x(\w+)>/, '(\1: 0x\2)')
|
27
|
+
report = report.gsub(/<XCAccessibilityElement:\/>0x(\w+)/, '(XCAccessibilityElement): 0x\1')
|
28
|
+
report
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.copy_log(log_files, logs_folder)
|
32
|
+
target_log = log_files.shift
|
33
|
+
FileUtils.cp_r(target_log, logs_folder)
|
34
|
+
end
|
35
|
+
|
29
36
|
def self.mergeLists(target_report, retry_report, params)
|
30
37
|
retry_report = clean_report(retry_report)
|
38
|
+
UI.verbose("Merging retried results...")
|
31
39
|
Dir.mkdir(params[:collated_report]) unless File.exists?(params[:collated_report])
|
32
40
|
file_name = params[:collated_report] + "/action_TestSummaries.plist"
|
33
41
|
retried_tests = retry_report.xpath("//key[contains(.,'TestSummaryGUID')]/..")
|
34
|
-
|
35
42
|
current_node = retried_tests.shift
|
36
|
-
|
37
|
-
#Copy retried test results into the base report
|
38
43
|
while (current_node != nil)
|
39
44
|
testName = get_test_name(current_node)
|
40
45
|
matching_node = target_report.at_xpath("//string[contains(.,'#{testName}')]/..")
|
@@ -47,37 +52,28 @@ module Fastlane
|
|
47
52
|
end
|
48
53
|
end
|
49
54
|
|
50
|
-
def self.clean_report(report)
|
51
|
-
report = report.gsub(/<(\w+): 0x(\w+)>/, '(\1: 0x\2)')
|
52
|
-
report = report.gsub(/<XCAccessibilityElement:\/>0x(\w+)/, '(XCAccessibilityElement): 0x\1')
|
53
|
-
report
|
54
|
-
end
|
55
|
-
|
56
55
|
def self.merge_assets(asset_files, assets_folder)
|
57
|
-
|
56
|
+
UI.verbose ("Merging screenshot folders...")
|
58
57
|
Dir.mkdir(assets_folder) unless File.exists?(assets_folder)
|
59
58
|
asset_files.each do |folder|
|
60
59
|
FileUtils.cp_r(Dir[folder + '/*'], assets_folder)
|
61
60
|
end
|
62
61
|
end
|
63
62
|
|
64
|
-
def self.copy_log(log_files, logs_folder)
|
65
|
-
target_log = log_files.shift
|
66
|
-
FileUtils.cp_r(target_log, logs_folder)
|
67
|
-
end
|
68
|
-
|
69
63
|
def self.merge_logs(log_files, logs_folder)
|
70
64
|
UI.verbose("Merging console logs...")
|
71
|
-
all = ""
|
72
65
|
target_log = log_files.shift
|
73
66
|
log_files.each do |log|
|
74
|
-
|
67
|
+
to_append = File.read(log)
|
68
|
+
File.open(target_log, "a") do |handle|
|
69
|
+
handle.puts to_append
|
70
|
+
end
|
71
|
+
FileUtils.cp_r(target_log, logs_folder)
|
75
72
|
end
|
76
|
-
sh("cat #{all}> #{target_log}")
|
77
|
-
FileUtils.cp_r(target_log, logs_folder)
|
78
73
|
end
|
79
74
|
|
80
75
|
def self.write_report_to_file(report, file_name)
|
76
|
+
UI.verbose("Writing merged results to file...")
|
81
77
|
File.new(file_name, 'w')
|
82
78
|
File.open(file_name, 'w') do |f|
|
83
79
|
f.write(report.to_xml)
|
@@ -171,7 +167,6 @@ module Fastlane
|
|
171
167
|
end
|
172
168
|
|
173
169
|
def self.authors
|
174
|
-
#Adapted from the "fastlane-plugin-test_center" plugin by:
|
175
170
|
["lyndsey-ferguson/@lyndseydf"]
|
176
171
|
end
|
177
172
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
#Adapted from the "fastlane-plugin-test_center" plugin
|
2
|
-
|
3
1
|
module Fastlane
|
4
2
|
module Actions
|
5
3
|
require 'fastlane/actions/scan'
|
@@ -25,8 +23,7 @@ module Fastlane
|
|
25
23
|
config = FastlaneCore::Configuration.create(Fastlane::Actions::ScanAction.available_options, scan_options)
|
26
24
|
Fastlane::Actions::ScanAction.run(config)
|
27
25
|
rescue FastlaneCore::Interface::FastlaneTestFailure => e
|
28
|
-
|
29
|
-
#Retry for the specified number of times if there were failed tests
|
26
|
+
UI.verbose("Scan failed with #{e}")
|
30
27
|
if try_count < params[:try_count]
|
31
28
|
report_filepath = junit_report_filepath(scan_options)
|
32
29
|
failed_tests = other_action.tests_from_junit(junit: report_filepath)[:failed]
|
@@ -43,6 +40,7 @@ module Fastlane
|
|
43
40
|
asset_files = Dir.glob("#{folder}*/#{scan_options[:scheme]}.test_result/1_Test/Attachments")
|
44
41
|
log_files = Dir.glob("#{folder}*/#{scan_options[:scheme]}.test_result/1_Test/action.xcactivitylog")
|
45
42
|
#Merge all reports, screenshots, and logs if there were retried tests
|
43
|
+
|
46
44
|
if report_files.size > 1
|
47
45
|
other_action.collate_junit_reports(
|
48
46
|
scheme: scan_options[:scheme],
|
@@ -134,7 +132,6 @@ module Fastlane
|
|
134
132
|
end
|
135
133
|
|
136
134
|
def self.authors
|
137
|
-
#Adapted from the "fastlane-plugin-test_center" plugin by:
|
138
135
|
["lyndsey-ferguson/@lyndseydf"]
|
139
136
|
end
|
140
137
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-retry_tests
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gloria Chow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plist
|
@@ -217,5 +217,5 @@ rubyforge_project:
|
|
217
217
|
rubygems_version: 2.6.14
|
218
218
|
signing_key:
|
219
219
|
specification_version: 4
|
220
|
-
summary: Makes testing your iOS app easier
|
220
|
+
summary: Makes testing your iOS app easier.
|
221
221
|
test_files: []
|