fastlane-plugin-xcresult_to_junit 0.4.0 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26d80a12ddd11ffb1a610f03fbe2b553e429e50318230aab292e05a7af7c562d
4
- data.tar.gz: ead5297fa4ef5adcf6225ba13229202143a51ae2b0194f45d1452fcd1c878cef
3
+ metadata.gz: c3e3c80ce10c32abd6b9ccb28cdaeb5a36cd3f521e3744b4f578523800d2ea79
4
+ data.tar.gz: b14e9c4e46bcfea6b535558650fb94d10f356574da0f693e16dd2ed05c1d2143
5
5
  SHA512:
6
- metadata.gz: 889460cd463ecfabf20d363fcb1cd8940eb2e9390950403fcd5409d3a9e566b0dee6aa3200cba0b0869776c87063da9af3a78a4418c0a435c04a8b7fe16fda97
7
- data.tar.gz: 0f69ba041ff93232e524f11039b8e703ec06d0d1a26dc3a92132749f81613a4f036afaa8acd74249108d53af3608e9e7eee2ca8ff7139a30969a22a1b4ab78b5
6
+ metadata.gz: ace6f018fd0942119a4a7c1cfd3e6b8afebfb25ead7644ef91841a520892e896f8e4c23216f68020325afd6b11aa5f9929f98d99d097aef71154eb7eee9a0c3e
7
+ data.tar.gz: 40ec61f25ef1adf0ca0f870e4f39ed3968d2800236864451f4a212674c4bd88a72313dd29d8f7ae6d443f4b776dbdc7a1a9c6c31b19c5518117aeb49c97b2568
@@ -36,9 +36,18 @@ module Fastlane
36
36
  passed += 1
37
37
  elsif test_case['result'] == 'Failed'
38
38
  failed += 1
39
+ testcase[:failure] ||= []
40
+ testcase[:failure_location] ||= []
39
41
  test_case['children'].each do |failure|
40
- testcase[:failure] = failure['name'].split(': ')[1]
41
- testcase[:failure_location] = failure['name'].split(': ')[0]
42
+ if failure['nodeType'] == 'Repetition'
43
+ failure['children'].each do |retry_failure|
44
+ testcase[:failure] << retry_failure['name']
45
+ testcase[:failure_location] << failure['name']
46
+ end
47
+ elsif failure['nodeType'] == 'Failure Message'
48
+ testcase[:failure] << failure['name']
49
+ testcase[:failure_location] << failure['name'].split(': ')[0]
50
+ end
42
51
  end
43
52
  end
44
53
  test_cases << testcase
@@ -60,12 +69,13 @@ module Fastlane
60
69
  test_identifier = test_attachment['testIdentifier']
61
70
  folder_name = test_identifier.sub('()', '').sub('/', '.')
62
71
 
63
- test_attachment['attachments'].each do |attachment|
72
+ test_attachment['attachments'].reverse().each do |attachment|
64
73
  name = attachment['suggestedHumanReadableName']
65
74
  filename = attachment['exportedFileName']
66
75
  mime_type = 'image/png'
67
76
  mime_type = 'text/plain' if filename.end_with?('.txt')
68
77
  timestamp = attachment['timestamp']
78
+ map[folder_name] ||= { 'files' => [] }
69
79
  map[folder_name]['files'].push({ 'description' => name, 'mime-type' => mime_type, 'path' => filename,
70
80
  'timestamp' => timestamp })
71
81
  end
@@ -79,7 +79,14 @@ module Fastlane
79
79
  end
80
80
 
81
81
  def self.junit_testcase_failure(testcase)
82
- puts("<failure message=#{testcase[:failure].encode(xml: :attr)}>#{testcase[:failure_location].encode(xml: :text)}</failure>")
82
+ if testcase[:failure].length != testcase[:failure_location].length
83
+ raise "Mismatch in lengths: testcase[:failure] and testcase[:failure_location] must have the same length."
84
+ end
85
+ for index in 0...testcase[:failure].length
86
+ failure = testcase[:failure][index]
87
+ failure_location = testcase[:failure_location][index]
88
+ puts("<failure message=#{failure.encode(xml: :attr)}>#{failure_location.encode(xml: :text)}</failure>")
89
+ end
83
90
  end
84
91
 
85
92
  def self.junit_testcase_error(testcase)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Fastlane
4
4
  module XcresultToJunit
5
- VERSION = '0.4.0'
5
+ VERSION = '0.4.3'
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.0
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Birdsall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-18 00:00:00.000000000 Z
11
+ date: 2025-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler