cider_ci-support 1.0.0.pre.beta.3 → 1.0.0.pre.beta.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 +4 -4
- data/bin/cider-ci_coverage +17 -2
- data/lib/cider_ci/support/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cd56b168f3ede1ddada598b7abf7f1c22c5cf5f
|
4
|
+
data.tar.gz: d2e62c1576f33c9691c195ed10398b9cbeafccaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de45cea9237c07ca6b77f930114cf4b7c985b98760f697d9f51851b2d044da58e97321a7ba54c9a04d36d8ec89091ca0c3b5a911236079a22750d91c83ac457a
|
7
|
+
data.tar.gz: a59857988e4f5c9e09ed96e8721f7debf07f75678893de7bcf7d73c181d500167345284319cf61ef5bd5c46dda334b563d725ccdbbf473669ffa7ef9503db136
|
data/bin/cider-ci_coverage
CHANGED
@@ -23,7 +23,7 @@ require 'thread/pool'
|
|
23
23
|
require 'mime/types'
|
24
24
|
require 'open-uri'
|
25
25
|
|
26
|
-
require 'pry'
|
26
|
+
# require 'pry'
|
27
27
|
|
28
28
|
###############################################################################
|
29
29
|
# Download from Cider-CI
|
@@ -148,6 +148,7 @@ def run_coverage root, tree_id, thrad_pool_size
|
|
148
148
|
SimpleCov::Result.new self
|
149
149
|
end.instance_eval do
|
150
150
|
SimpleCov::Formatter::HTMLFormatter.new.format self
|
151
|
+
self
|
151
152
|
end
|
152
153
|
end
|
153
154
|
|
@@ -188,6 +189,10 @@ def parse_options options
|
|
188
189
|
options.upload= true
|
189
190
|
end
|
190
191
|
|
192
|
+
opts.on('-t', '--threshold',Integer) do |t|
|
193
|
+
options.threshold= t
|
194
|
+
end
|
195
|
+
|
191
196
|
end.parse!
|
192
197
|
|
193
198
|
options
|
@@ -221,6 +226,7 @@ def main
|
|
221
226
|
options.password= ENV['CIDER_CI_PASSWORD']
|
222
227
|
options.api_url= ENV['CIDER_CI_API_URL']
|
223
228
|
options.upload= false
|
229
|
+
options.threshold= 90
|
224
230
|
parse_options options
|
225
231
|
options.api_url || raise(OptionParser::MissingArgument \
|
226
232
|
, "api_url is required, set CIDER_CI_API_URL or provide -a option")
|
@@ -232,10 +238,19 @@ def main
|
|
232
238
|
root = connect(options.api_url, options.username, options.password).get()
|
233
239
|
tree_id = get_current_tree_id
|
234
240
|
FileUtils.rm_rf('coverage')
|
235
|
-
run_coverage root, tree_id, options.thread_pool_size
|
241
|
+
result= run_coverage root, tree_id, options.thread_pool_size
|
236
242
|
if options.upload
|
237
243
|
upload_as_tree_attachments root, tree_id
|
238
244
|
end
|
245
|
+
|
246
|
+
coverage= result.covered_lines / result.total_lines.to_f
|
247
|
+
|
248
|
+
if coverage < options.threshold/100.0
|
249
|
+
Kernel.abort("coverage at #{(coverage * 100).round(2)}% is below threshold of #{options.threshold}% ")
|
250
|
+
else
|
251
|
+
Kernel.exit(0)
|
252
|
+
end
|
253
|
+
|
239
254
|
end
|
240
255
|
|
241
256
|
main
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cider_ci-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.pre.beta.
|
4
|
+
version: 1.0.0.pre.beta.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Schank
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|