-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFastfile
41 lines (32 loc) · 1.21 KB
/
Fastfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
lane :test do |options|
base_derived_data_path = options[:derived_data_path]
test_reports = []
begin
retry_count ||= 0
# Putting output and derived data of each run into its own directory
output_directory_for_this_run = "#{base_derived_data_path}/run#{retry_count}"
options[:derived_data_path] = output_directory_for_this_run
options[:output_directory] = output_directory_for_this_run
scan(options)
last_report_file_path = "#{options[:output_directory]}/#{options[:custom_report_file_name]}"
test_reports << last_report_file_path
merge_junit_report(input_files: test_reports)
rescue => e
UI.important("failure noted: #{e}")
last_report_file_path = "#{options[:output_directory]}/#{options[:custom_report_file_name]}"
test_reports << last_report_file_path
if (retry_count += 1) < 3
setup_fragile_tests_for_rescan(
project_path: options[:project],
scheme: options[:scheme],
report_filepath: last_report_file_path
)
retry
end
merge_junit_report(input_files: test_reports)
raise e
end
end
lane :merge do
merge_junit_report(input_files: ['build/run0/report.xml', 'build/run1/report.xml', 'build/run2/report.xml'])
end