fastlane-plugin-xcresult_to_junit 0.4.3 → 0.4.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3e3c80ce10c32abd6b9ccb28cdaeb5a36cd3f521e3744b4f578523800d2ea79
4
- data.tar.gz: b14e9c4e46bcfea6b535558650fb94d10f356574da0f693e16dd2ed05c1d2143
3
+ metadata.gz: e56ddaa027a106f5eef88030a4d42eb1c4efccb02edffe8703bb8a26f29075d0
4
+ data.tar.gz: 0e908487046ad6efacf372577118972946111af7a66f8992dc08e8be216602d3
5
5
  SHA512:
6
- metadata.gz: ace6f018fd0942119a4a7c1cfd3e6b8afebfb25ead7644ef91841a520892e896f8e4c23216f68020325afd6b11aa5f9929f98d99d097aef71154eb7eee9a0c3e
7
- data.tar.gz: 40ec61f25ef1adf0ca0f870e4f39ed3968d2800236864451f4a212674c4bd88a72313dd29d8f7ae6d443f4b776dbdc7a1a9c6c31b19c5518117aeb49c97b2568
6
+ metadata.gz: 0ebe78e460e3be0eccb90d8b5a5827003f7c0270670faae6d51002974d3c4511876b42bc089077d119f1c1da251d568bafd043b32a1d2d95242920c4d32ea764
7
+ data.tar.gz: 8b795cfbd057468cc63818fce333b7516e7fab91affbbb8080adfeefc31158db4fa84137c11d8b5764ac27a4e17adcac05f7454abb69c145be4e49b4823ae0ac
@@ -13,75 +13,78 @@ module Fastlane
13
13
 
14
14
  devices = result['devices']
15
15
  test_plans = result['testNodes']
16
- map = {}
17
- junit_folder = Helper::XcresultToJunitHelper.save_device_details_to_file(params[:output_path], devices)
18
- test_suites = []
19
-
20
- test_plans.each do |test_plan|
21
- test_plan['children'].each do |test_bundle|
22
- test_bundle['children'].each do |test_suite|
23
- suite_name = test_suite['name']
24
- count = 0
25
- passed = 0
26
- failed = 0
27
- test_cases = []
28
- test_suite['children'].each do |test_case|
29
- duration = 0.0
30
- duration = test_case['duration'].sub('s', '').to_f if test_case['duration']
31
- full_testcase_name = test_case['name'].sub('()', '')
32
- tags = full_testcase_name.split('_')[1..]
33
- testcase = { name: full_testcase_name, time: duration }
34
- count += 1
35
- if test_case['result'] == 'Passed'
36
- passed += 1
37
- elsif test_case['result'] == 'Failed'
38
- failed += 1
39
- testcase[:failure] ||= []
40
- testcase[:failure_location] ||= []
41
- test_case['children'].each do |failure|
42
- if failure['nodeType'] == 'Repetition'
43
- failure['children'].each do |retry_failure|
44
- testcase[:failure] << retry_failure['name']
45
- testcase[:failure_location] << failure['name']
16
+
17
+ devices.each do |device|
18
+ map = {}
19
+ junit_folder = Helper::XcresultToJunitHelper.save_device_details_to_file(params[:output_path], [device])
20
+ test_suites = []
21
+
22
+ test_plans.each do |test_plan|
23
+ test_plan['children'].each do |test_bundle|
24
+ test_bundle['children'].each do |test_suite|
25
+ suite_name = test_suite['name']
26
+ count = 0
27
+ passed = 0
28
+ failed = 0
29
+ test_cases = []
30
+ test_suite['children'].each do |test_case|
31
+ duration = 0.0
32
+ duration = test_case['duration'].sub('s', '').to_f if test_case['duration']
33
+ full_testcase_name = test_case['name'].sub('()', '')
34
+ tags = full_testcase_name.split('_')[1..]
35
+ testcase = { name: full_testcase_name, time: duration }
36
+ count += 1
37
+ if test_case['result'] == 'Passed'
38
+ passed += 1
39
+ elsif test_case['result'] == 'Failed'
40
+ failed += 1
41
+ testcase[:failure] ||= []
42
+ testcase[:failure_location] ||= []
43
+ test_case['children'].each do |failure|
44
+ if failure['nodeType'] == 'Repetition'
45
+ failure['children'].each do |retry_failure|
46
+ testcase[:failure] << retry_failure['name']
47
+ testcase[:failure_location] << failure['name']
48
+ end
49
+ elsif failure['nodeType'] == 'Failure Message'
50
+ testcase[:failure] << failure['name']
51
+ testcase[:failure_location] << failure['name'].split(': ')[0]
46
52
  end
47
- elsif failure['nodeType'] == 'Failure Message'
48
- testcase[:failure] << failure['name']
49
- testcase[:failure_location] << failure['name'].split(': ')[0]
50
53
  end
51
54
  end
55
+ test_cases << testcase
56
+ map["#{suite_name}.#{full_testcase_name}"] = { 'files' => [], 'tags' => tags }
52
57
  end
53
- test_cases << testcase
54
- map["#{suite_name}.#{full_testcase_name}"] = { 'files' => [], 'tags' => tags }
58
+ suite = { name: suite_name.to_s, count: count, failures: failed, errors: 0, cases: test_cases }
59
+ test_suites << suite
55
60
  end
56
- suite = { name: suite_name.to_s, count: count, failures: failed, errors: 0, cases: test_cases }
57
- test_suites << suite
58
61
  end
59
62
  end
60
- end
61
63
 
62
- Helper::XcresultToJunitHelper.generate_junit(junit_folder, test_suites)
63
- attachments_folder = "#{junit_folder}/attachments"
64
- Helper::XcresultToJunitHelper.save_attachments(params[:xcresult_path], attachments_folder)
65
-
66
- test_attachments = Helper::XcresultToJunitHelper.fetch_attachment_manifest(attachments_folder)
67
-
68
- test_attachments.each do |test_attachment|
69
- test_identifier = test_attachment['testIdentifier']
70
- folder_name = test_identifier.sub('()', '').sub('/', '.')
71
-
72
- test_attachment['attachments'].reverse().each do |attachment|
73
- name = attachment['suggestedHumanReadableName']
74
- filename = attachment['exportedFileName']
75
- mime_type = 'image/png'
76
- mime_type = 'text/plain' if filename.end_with?('.txt')
77
- timestamp = attachment['timestamp']
78
- map[folder_name] ||= { 'files' => [] }
79
- map[folder_name]['files'].push({ 'description' => name, 'mime-type' => mime_type, 'path' => filename,
80
- 'timestamp' => timestamp })
64
+ Helper::XcresultToJunitHelper.generate_junit(junit_folder, test_suites)
65
+ attachments_folder = "#{junit_folder}/attachments"
66
+ Helper::XcresultToJunitHelper.save_attachments(params[:xcresult_path], attachments_folder)
67
+
68
+ test_attachments = Helper::XcresultToJunitHelper.fetch_attachment_manifest(attachments_folder)
69
+
70
+ test_attachments.each do |test_attachment|
71
+ test_identifier = test_attachment['testIdentifier']
72
+ folder_name = test_identifier.sub('()', '').sub('/', '.')
73
+
74
+ test_attachment['attachments'].reverse().each do |attachment|
75
+ name = attachment['suggestedHumanReadableName']
76
+ filename = attachment['exportedFileName']
77
+ mime_type = 'image/png'
78
+ mime_type = 'text/plain' if filename.end_with?('.txt')
79
+ timestamp = attachment['timestamp']
80
+ map[folder_name] ||= { 'files' => [] }
81
+ map[folder_name]['files'].push({ 'description' => name, 'mime-type' => mime_type, 'path' => filename,
82
+ 'timestamp' => timestamp })
83
+ end
81
84
  end
82
- end
83
85
 
84
- Helper::XcresultToJunitHelper.save_screenshot_mapping(map, attachments_folder)
86
+ Helper::XcresultToJunitHelper.save_screenshot_mapping(map, attachments_folder)
87
+ end
85
88
  UI.message('The xcresult_to_junit plugin has finished!')
86
89
  end
87
90
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Fastlane
4
4
  module XcresultToJunit
5
- VERSION = '0.4.3'
5
+ VERSION = '0.4.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-xcresult_to_junit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Birdsall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-24 00:00:00.000000000 Z
11
+ date: 2025-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -123,7 +123,7 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  description:
126
- email: shane.birdsall@fiserv.com
126
+ email: zanizrules@gmail.com
127
127
  executables: []
128
128
  extensions: []
129
129
  extra_rdoc_files: []