fastlane-plugin-xcresult_to_junit 0.3.0 → 0.3.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb3ca55a4312742fa6206f72196d9c82cb9044be5ec7eace2a119740291ac527
|
4
|
+
data.tar.gz: a0d87f022674375715b8bd906369be0bb6e798531a5ead56902768a87c0dc65d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8caaa365d18f8d36fed3c30159ac7393c9e95fe9a57b1dcfea89e878ab632a4bae16b4e28f1a414cc31adeb7de18455f64bbfde85f9aa090ede2650e928180d9
|
7
|
+
data.tar.gz: f93a64d0ab5052064985d14b85e0e7751f020c93d31e3cddb1f21ea5083d4f11bd2e94b3209d6ba23ba938677875efd96a845478a330183d453e20b1c8aef9a2
|
data/README.md
CHANGED
@@ -31,17 +31,20 @@ The below table captures the current requirements this plugin meets. If you have
|
|
31
31
|
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
32
32
|
|
33
33
|
Ensure you specify the following when you call scan
|
34
|
+
|
34
35
|
```ruby
|
35
36
|
fail_build: false, # Allows to continue after scan
|
36
37
|
result_bundle: true # Generate xcresult in output directory
|
37
38
|
```
|
38
39
|
|
39
40
|
After scan you can call the plugin, which will look something like this
|
41
|
+
|
40
42
|
```ruby
|
41
43
|
xcresult_to_junit(xcresult_path: './fastlane/test_output/MyScheme.test_result.xcresult', output_path: './fastlane/test_output/')
|
42
44
|
```
|
43
45
|
|
44
46
|
We can get a list of the junit reports generated by doing something like so
|
47
|
+
|
45
48
|
```ruby
|
46
49
|
junit_reports = Dir['./test_output/*.junit']
|
47
50
|
# Now we can iterate over the reports and send them where they need to go
|
@@ -52,12 +55,13 @@ We can get a list of the junit reports generated by doing something like so
|
|
52
55
|
|
53
56
|
To run both the tests, and code style validation, run
|
54
57
|
|
55
|
-
```
|
58
|
+
```bash
|
56
59
|
rake
|
57
60
|
```
|
58
61
|
|
59
62
|
To automatically fix many of the styling issues, use
|
60
|
-
|
63
|
+
|
64
|
+
```bash
|
61
65
|
rubocop -a
|
62
66
|
```
|
63
67
|
|
@@ -46,12 +46,14 @@ module Fastlane
|
|
46
46
|
ref['activitySummaries']['_values'].each do |summary|
|
47
47
|
next unless summary['attachments']
|
48
48
|
summary['attachments']['_values'].each do |attachment|
|
49
|
+
name = attachment['name']['_value']
|
50
|
+
next unless name != 'kXCTAttachmentLegacyDiagnosticReportData'
|
49
51
|
timestamp = DateTime.parse(attachment['timestamp']['_value']).to_time.to_i
|
50
52
|
filename = attachment['filename']['_value']
|
51
|
-
name = attachment['name']['_value']
|
52
53
|
folder_name = "#{suite_name}.#{testcase_name}"
|
53
|
-
id = attachment
|
54
|
-
|
54
|
+
id = attachment.dig('payloadRef', 'id', '_value')
|
55
|
+
next if id.nil?
|
56
|
+
Helper::XcresultToJunitHelper.fetch_screenshot(params[:xcresult_path], "#{junit_folder}/attachments/#{folder_name}", filename.to_s, id)
|
55
57
|
map[folder_name]['files'].push({ 'description' => name, 'mime-type' => 'image/png', 'path' => "#{folder_name}/#{filename}", 'timestamp' => timestamp })
|
56
58
|
end
|
57
59
|
end
|
@@ -8,18 +8,18 @@ module Fastlane
|
|
8
8
|
module Helper
|
9
9
|
class XcresultToJunitHelper
|
10
10
|
def self.load_object(xcresult_path, id)
|
11
|
-
JSON.parse(FastlaneCore::CommandExecutor.execute(command: "xcrun xcresulttool get --format json --path #{xcresult_path} --id #{id}"))
|
11
|
+
JSON.parse(FastlaneCore::CommandExecutor.execute(command: "xcrun xcresulttool get --legacy --format json --path #{xcresult_path} --id #{id}"))
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.load_results(xcresult_path)
|
15
|
-
JSON.parse(FastlaneCore::CommandExecutor.execute(command: "xcrun xcresulttool get --format json --path #{xcresult_path}"))
|
15
|
+
JSON.parse(FastlaneCore::CommandExecutor.execute(command: "xcrun xcresulttool get --legacy --format json --path #{xcresult_path}"))
|
16
16
|
end
|
17
17
|
|
18
18
|
def self.fetch_screenshot(xcresult_path, output_path, file_name, id)
|
19
19
|
unless File.directory?(output_path)
|
20
20
|
FileUtils.mkdir(output_path)
|
21
21
|
end
|
22
|
-
FastlaneCore::CommandExecutor.execute(command: "xcrun xcresulttool export --path #{xcresult_path} --output-path \"#{output_path}/#{file_name}\" --id #{id} --type file")
|
22
|
+
FastlaneCore::CommandExecutor.execute(command: "xcrun xcresulttool export --legacy --path #{xcresult_path} --output-path \"#{output_path}/#{file_name}\" --id #{id} --type file")
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.save_screenshot_mapping(map_hash, output_path)
|
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.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane Birdsall
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -122,20 +122,6 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: fastlane
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: 2.134.0
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: 2.134.0
|
139
125
|
description:
|
140
126
|
email: shane.birdsall@fiserv.com
|
141
127
|
executables: []
|
@@ -167,8 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
153
|
- !ruby/object:Gem::Version
|
168
154
|
version: '0'
|
169
155
|
requirements: []
|
170
|
-
|
171
|
-
rubygems_version: 2.7.6.2
|
156
|
+
rubygems_version: 3.4.10
|
172
157
|
signing_key:
|
173
158
|
specification_version: 4
|
174
159
|
summary: Produces junit xml files from Xcode 11+ xcresult files
|