danger-xcode_summary 0.1.1 → 0.1.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 +4 -4
- data/Gemfile.lock +20 -25
- data/lib/xcode_summary/gem_version.rb +1 -1
- data/lib/xcode_summary/plugin.rb +17 -3
- data/spec/fixtures/pr_json.json +8 -0
- data/spec/xcode_summary_spec.rb +21 -13
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5ef0a41da411d5fedee16a908c63a787016845a4
|
|
4
|
+
data.tar.gz: 8c9907a822c190b740071ec03d5ec697165fffb5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7fb0cc0bffa225a4e92e0a489502400dc411521f9c315286820262f4473d78d88ee009db84704f6fd33cfb58a1128c9f8b0615d98bb38bca9c8f44777ff9d7b1
|
|
7
|
+
data.tar.gz: ed3e60b481fc7becd59935525706655b75c27fdfe6c9a3371087d146692fc8b15ac96258b0c77b2c88c4f6edd78803b5f0f9e933e8a10a67ecbb9a5f1295e4c3
|
data/Gemfile.lock
CHANGED
|
@@ -1,48 +1,46 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
danger-xcode_summary (0.1.
|
|
4
|
+
danger-xcode_summary (0.1.2)
|
|
5
5
|
danger-plugin-api (~> 1.0)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
addressable (2.
|
|
10
|
+
addressable (2.5.0)
|
|
11
|
+
public_suffix (~> 2.0, >= 2.0.2)
|
|
11
12
|
ast (2.3.0)
|
|
12
|
-
claide (1.0.
|
|
13
|
-
claide-plugins (0.9.
|
|
13
|
+
claide (1.0.1)
|
|
14
|
+
claide-plugins (0.9.2)
|
|
14
15
|
cork
|
|
15
16
|
nap
|
|
16
17
|
open4 (~> 1.3)
|
|
17
18
|
coderay (1.1.1)
|
|
18
19
|
colored (1.2)
|
|
20
|
+
colored2 (3.1.2)
|
|
19
21
|
cork (0.2.0)
|
|
20
22
|
colored (~> 1.2)
|
|
21
|
-
danger (3.0
|
|
23
|
+
danger (4.3.0)
|
|
22
24
|
claide (~> 1.0)
|
|
23
|
-
claide-plugins (
|
|
24
|
-
|
|
25
|
+
claide-plugins (>= 0.9.2)
|
|
26
|
+
colored2 (~> 3.1)
|
|
25
27
|
cork (~> 0.1)
|
|
26
28
|
faraday (~> 0.9)
|
|
27
29
|
faraday-http-cache (~> 1.0)
|
|
28
30
|
git (~> 1)
|
|
29
|
-
gitlab (~> 3.7.0)
|
|
30
31
|
kramdown (~> 1.5)
|
|
31
32
|
octokit (~> 4.2)
|
|
32
33
|
terminal-table (~> 1)
|
|
33
34
|
danger-plugin-api (1.0.0)
|
|
34
35
|
danger (> 2.0)
|
|
35
36
|
diff-lcs (1.2.5)
|
|
36
|
-
faraday (0.
|
|
37
|
+
faraday (0.11.0)
|
|
37
38
|
multipart-post (>= 1.2, < 3)
|
|
38
39
|
faraday-http-cache (1.3.1)
|
|
39
40
|
faraday (~> 0.8)
|
|
40
41
|
ffi (1.9.14)
|
|
41
42
|
formatador (0.2.5)
|
|
42
43
|
git (1.3.0)
|
|
43
|
-
gitlab (3.7.0)
|
|
44
|
-
httparty (~> 0.13.0)
|
|
45
|
-
terminal-table
|
|
46
44
|
guard (2.14.0)
|
|
47
45
|
formatador (>= 0.2.4)
|
|
48
46
|
listen (>= 2.7, < 4.0)
|
|
@@ -57,25 +55,20 @@ GEM
|
|
|
57
55
|
guard (~> 2.1)
|
|
58
56
|
guard-compat (~> 1.1)
|
|
59
57
|
rspec (>= 2.99.0, < 4.0)
|
|
60
|
-
|
|
61
|
-
json (~> 1.8)
|
|
62
|
-
multi_xml (>= 0.5.2)
|
|
63
|
-
json (1.8.3)
|
|
64
|
-
kramdown (1.12.0)
|
|
58
|
+
kramdown (1.13.2)
|
|
65
59
|
listen (3.0.7)
|
|
66
60
|
rb-fsevent (>= 0.9.3)
|
|
67
61
|
rb-inotify (>= 0.9.7)
|
|
68
62
|
lumberjack (1.0.10)
|
|
69
63
|
method_source (0.8.2)
|
|
70
|
-
multi_xml (0.5.5)
|
|
71
64
|
multipart-post (2.0.0)
|
|
72
65
|
nap (1.1.0)
|
|
73
66
|
nenv (0.3.0)
|
|
74
67
|
notiffany (0.1.0)
|
|
75
68
|
nenv (~> 0.1)
|
|
76
69
|
shellany (~> 0.0)
|
|
77
|
-
octokit (4.
|
|
78
|
-
sawyer (~> 0.
|
|
70
|
+
octokit (4.6.2)
|
|
71
|
+
sawyer (~> 0.8.0, >= 0.5.3)
|
|
79
72
|
open4 (1.3.4)
|
|
80
73
|
parser (2.3.1.2)
|
|
81
74
|
ast (~> 2.2)
|
|
@@ -84,6 +77,7 @@ GEM
|
|
|
84
77
|
coderay (~> 1.1.0)
|
|
85
78
|
method_source (~> 0.8.1)
|
|
86
79
|
slop (~> 3.4)
|
|
80
|
+
public_suffix (2.0.5)
|
|
87
81
|
rainbow (2.1.0)
|
|
88
82
|
rake (10.5.0)
|
|
89
83
|
rb-fsevent (0.9.7)
|
|
@@ -109,12 +103,13 @@ GEM
|
|
|
109
103
|
ruby-progressbar (~> 1.7)
|
|
110
104
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
|
111
105
|
ruby-progressbar (1.8.1)
|
|
112
|
-
sawyer (0.
|
|
113
|
-
addressable (>= 2.3.5, < 2.
|
|
114
|
-
faraday (~> 0.8, < 0
|
|
106
|
+
sawyer (0.8.1)
|
|
107
|
+
addressable (>= 2.3.5, < 2.6)
|
|
108
|
+
faraday (~> 0.8, < 1.0)
|
|
115
109
|
shellany (0.0.1)
|
|
116
110
|
slop (3.6.0)
|
|
117
|
-
terminal-table (1.
|
|
111
|
+
terminal-table (1.7.0)
|
|
112
|
+
unicode-display_width (~> 1.1)
|
|
118
113
|
thor (0.19.1)
|
|
119
114
|
unicode-display_width (1.1.0)
|
|
120
115
|
yard (0.9.1)
|
|
@@ -136,4 +131,4 @@ DEPENDENCIES
|
|
|
136
131
|
yard
|
|
137
132
|
|
|
138
133
|
BUNDLED WITH
|
|
139
|
-
1.
|
|
134
|
+
1.14.3
|
data/lib/xcode_summary/plugin.rb
CHANGED
|
@@ -38,6 +38,12 @@ module Danger
|
|
|
38
38
|
# @return [Boolean]
|
|
39
39
|
attr_accessor :sticky_summary
|
|
40
40
|
|
|
41
|
+
# Defines if the build summary is shown or not.
|
|
42
|
+
# Defaults to `true`.
|
|
43
|
+
# @param [Boolean] value
|
|
44
|
+
# @return [Boolean]
|
|
45
|
+
attr_accessor :test_summary
|
|
46
|
+
|
|
41
47
|
def project_root
|
|
42
48
|
root = @project_root || Dir.pwd
|
|
43
49
|
root += '/' unless root.end_with? '/'
|
|
@@ -52,6 +58,10 @@ module Danger
|
|
|
52
58
|
@sticky_summary || false
|
|
53
59
|
end
|
|
54
60
|
|
|
61
|
+
def test_summary
|
|
62
|
+
@test_summary .nil? ? true : @test_summary
|
|
63
|
+
end
|
|
64
|
+
|
|
55
65
|
# Reads a file with JSON Xcode summary and reports it.
|
|
56
66
|
#
|
|
57
67
|
# @param [String] file_path Path for Xcode summary in JSON format.
|
|
@@ -74,9 +84,13 @@ module Danger
|
|
|
74
84
|
end
|
|
75
85
|
|
|
76
86
|
def messages(xcode_summary)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
87
|
+
if test_summary
|
|
88
|
+
[
|
|
89
|
+
xcode_summary[:tests_summary_messages]
|
|
90
|
+
].flatten.uniq.compact.map(&:strip)
|
|
91
|
+
else
|
|
92
|
+
[]
|
|
93
|
+
end
|
|
80
94
|
end
|
|
81
95
|
|
|
82
96
|
def warnings(xcode_summary)
|
data/spec/xcode_summary_spec.rb
CHANGED
|
@@ -13,14 +13,7 @@ module Danger
|
|
|
13
13
|
before do
|
|
14
14
|
@dangerfile = testing_dangerfile
|
|
15
15
|
@xcode_summary = @dangerfile.xcode_summary
|
|
16
|
-
@xcode_summary.env.request_source.pr_json =
|
|
17
|
-
head: {
|
|
18
|
-
repo: {
|
|
19
|
-
html_url: 'https://github.com/diogot/danger-xcode_summary'
|
|
20
|
-
},
|
|
21
|
-
sha: '129jef029jf029fj2039fj203f92'
|
|
22
|
-
}
|
|
23
|
-
}
|
|
16
|
+
@xcode_summary.env.request_source.pr_json = JSON.parse(IO.read('spec/fixtures/pr_json.json'))
|
|
24
17
|
@xcode_summary.project_root = '/Users/diogo/src/MyWeight'
|
|
25
18
|
end
|
|
26
19
|
|
|
@@ -28,17 +21,32 @@ module Danger
|
|
|
28
21
|
expect(@xcode_summary.sticky_summary).to eq false
|
|
29
22
|
end
|
|
30
23
|
|
|
24
|
+
it 'sets test_summary to true as default' do
|
|
25
|
+
expect(@xcode_summary.test_summary).to eq true
|
|
26
|
+
end
|
|
27
|
+
|
|
31
28
|
it 'fail if file does not exist' do
|
|
32
29
|
@xcode_summary.report('spec/fixtures/inexistent_file.json')
|
|
33
30
|
expect(@dangerfile.status_report[:errors]).to eq ['summary file not found']
|
|
34
31
|
end
|
|
35
32
|
|
|
36
33
|
describe 'summary' do
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
context 'enabled' do
|
|
35
|
+
it 'formats summary messages' do
|
|
36
|
+
@xcode_summary.test_summary = true
|
|
37
|
+
@xcode_summary.report('spec/fixtures/summary_messages.json')
|
|
38
|
+
expect(@dangerfile.status_report[:messages]).to eq [
|
|
39
|
+
'Executed 4 tests, with 0 failures (0 unexpected) in 0.012 (0.017) seconds'
|
|
40
|
+
]
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
context 'disabled' do
|
|
45
|
+
it 'shows no summary messages' do
|
|
46
|
+
@xcode_summary.test_summary = false
|
|
47
|
+
@xcode_summary.report('spec/fixtures/summary_messages.json')
|
|
48
|
+
expect(@dangerfile.status_report[:messages]).to eq []
|
|
49
|
+
end
|
|
42
50
|
end
|
|
43
51
|
|
|
44
52
|
it 'formats compile warnings' do
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: danger-xcode_summary
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Diogo Tridapalli
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2017-
|
|
12
|
+
date: 2017-03-05 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: danger-plugin-api
|
|
@@ -145,6 +145,7 @@ files:
|
|
|
145
145
|
- lib/danger_xcode_summary.rb
|
|
146
146
|
- lib/xcode_summary/gem_version.rb
|
|
147
147
|
- lib/xcode_summary/plugin.rb
|
|
148
|
+
- spec/fixtures/pr_json.json
|
|
148
149
|
- spec/fixtures/summary.json
|
|
149
150
|
- spec/fixtures/summary_messages.json
|
|
150
151
|
- spec/fixtures/summary_with_empty_line.json
|
|
@@ -171,12 +172,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
171
172
|
version: '0'
|
|
172
173
|
requirements: []
|
|
173
174
|
rubyforge_project:
|
|
174
|
-
rubygems_version: 2.
|
|
175
|
+
rubygems_version: 2.4.5.2
|
|
175
176
|
signing_key:
|
|
176
177
|
specification_version: 4
|
|
177
178
|
summary: A [Danger](http://danger.systems) plugin that shows all build errors, warnings
|
|
178
179
|
and unit tests results generated from `xcodebuild`.
|
|
179
180
|
test_files:
|
|
181
|
+
- spec/fixtures/pr_json.json
|
|
180
182
|
- spec/fixtures/summary.json
|
|
181
183
|
- spec/fixtures/summary_messages.json
|
|
182
184
|
- spec/fixtures/summary_with_empty_line.json
|