xcresult 0.1.1 → 0.2.0
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/Gemfile.lock +1 -1
- data/README.md +27 -4
- data/lib/xcresult/parser.rb +23 -2
- data/lib/xcresult/version.rb +1 -1
- data/xcresult.gemspec +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 719d1f64f463138bc78b23e18d124c07f815af7c7b052560d426feced0fbad64
|
4
|
+
data.tar.gz: 2ac8faad5109f78cde5a7c3bdd56aea980fdb5d9bdd80b2b38568034a627ae65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 576989a630f4abdd1550ab25dfdfe8034df9349ebe17784061bc2468c52026509dd9d02e669225101436510127ddd27088ad56f51a2589d070e462740e775679
|
7
|
+
data.tar.gz: 1a97becb5676f1f2c08ed4ef685785d008be4055c80c01d109fe0405387dbb3ed5fc34182d8cc619432e925cc0c492b257bce70ca1c5f53ccafcf0191a4bedbe
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
#
|
1
|
+
# XCResult
|
2
2
|
|
3
|
-
|
3
|
+
[](https://twitter.com/KrauseFx)
|
4
|
+
[](https://github.com/KrauseFx/trainer/blob/master/LICENSE)
|
5
|
+
[](http://rubygems.org/gems/trainer)
|
4
6
|
|
5
|
-
|
7
|
+
Ruby interface for inspecting data and exporting data from Xcode 11 `.xcresult` files
|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
@@ -20,9 +22,30 @@ Or install it yourself as:
|
|
20
22
|
|
21
23
|
$ gem install xcresult
|
22
24
|
|
25
|
+
## Roadmap
|
26
|
+
|
27
|
+
- [x] Allow for easy querying of test plan summaires
|
28
|
+
- [x] Allow for easy exporting of `.xccovreport` files
|
29
|
+
- [ ] Allow for exporting of screenshots
|
30
|
+
- [ ] Add full documentation on all classes and methods
|
31
|
+
- [ ] Add more and better explain examples
|
32
|
+
- [ ] Add tests and improved code coverage
|
33
|
+
|
23
34
|
## Usage
|
24
35
|
|
25
|
-
|
36
|
+
### Export .xccovreport files from .xcresult
|
37
|
+
|
38
|
+
```rb
|
39
|
+
parser = XCResult::Parser.new(path: 'YourProject.xcresult')
|
40
|
+
export_xccovreport_paths = parser.export_xccovreports(destination: './outputs')
|
41
|
+
```
|
42
|
+
|
43
|
+
### Get test plan summaries from .xcresult
|
44
|
+
|
45
|
+
```rb
|
46
|
+
parser = XCResult::Parser.new(path: 'YourProject.xcresult')
|
47
|
+
summaries = parser.action_test_plan_summaries
|
48
|
+
```
|
26
49
|
|
27
50
|
## Development
|
28
51
|
|
data/lib/xcresult/parser.rb
CHANGED
@@ -39,11 +39,13 @@ module XCResult
|
|
39
39
|
def export_xccovreports(destination: nil)
|
40
40
|
destination ||= Dir.pwd
|
41
41
|
|
42
|
-
|
42
|
+
# Collects report references
|
43
|
+
report_refs = actions_invocation_record.actions.map do |action|
|
43
44
|
action.action_result.coverage.report_ref
|
44
45
|
end.compact
|
45
|
-
ids =
|
46
|
+
ids = report_refs.map(&:id)
|
46
47
|
|
48
|
+
# Exports all xccovreport files from the report references
|
47
49
|
ids.each_with_index.map do |id, i|
|
48
50
|
output_path = File.join(destination, "action_#{i}.xccovreport")
|
49
51
|
cmd = "xcrun xcresulttool export --path #{path} --id '#{id}' --output-path #{output_path} --type file"
|
@@ -53,6 +55,25 @@ module XCResult
|
|
53
55
|
end
|
54
56
|
end
|
55
57
|
|
58
|
+
def export_xccovarchives(destination: nil)
|
59
|
+
destination ||= Dir.pwd
|
60
|
+
|
61
|
+
# Collects archive references
|
62
|
+
archive_refs = actions_invocation_record.actions.map do |action|
|
63
|
+
action.action_result.coverage.archive_ref
|
64
|
+
end.compact
|
65
|
+
ids = archive_refs.map(&:id)
|
66
|
+
|
67
|
+
# Exports all xcovarchive directories from the archive references
|
68
|
+
ids.each_with_index.map do |id, i|
|
69
|
+
output_path = File.join(destination, "action_#{i}.xccovarchive")
|
70
|
+
cmd = "xcrun xcresulttool export --path #{path} --id '#{id}' --output-path #{output_path} --type directory"
|
71
|
+
execute_cmd(cmd)
|
72
|
+
|
73
|
+
output_path
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
56
77
|
private
|
57
78
|
|
58
79
|
def get_result_bundle_json(id: nil)
|
data/lib/xcresult/version.rb
CHANGED
data/xcresult.gemspec
CHANGED
@@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
19
19
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
20
|
end
|
21
|
+
spec.bindir = "exe"
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
23
|
spec.require_paths = ['lib']
|
22
24
|
|
23
25
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xcresult
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Holtz
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|