corn 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/corn.rb +25 -8
- data/lib/corn/mini_test.rb +1 -1
- data/lib/corn/test_unit.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: bd6bf050c9281d4d7466d536e0c21a742b49a54c
|
4
|
+
data.tar.gz: 85b6e57c88e13ef0e4eef17c92bc8084b2aeb0ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8397e9bf1689a62df96fd5a07e7d576ee576dd0f66c749e38f1564fb0697a6cf5d0e97ff8f5d290220c6f0f1ec1768a89de3874e11f0b4a1be71056e92a8564a
|
7
|
+
data.tar.gz: 1823d6d382275608edeace1b8114e14a48baf57ba122be4ac05d048dbffaa85eb7b77ca55739ec6a7922d5c8381f4fbb14350182a0b93909a332c4149fe29e3c
|
data/README.md
CHANGED
data/lib/corn.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'net/http'
|
2
2
|
require 'net/https'
|
3
3
|
require 'logger'
|
4
|
+
require 'csv'
|
4
5
|
|
5
6
|
require 'corn/report'
|
6
7
|
require 'corn/test_unit'
|
@@ -10,15 +11,15 @@ module Corn
|
|
10
11
|
module_function
|
11
12
|
|
12
13
|
def host
|
13
|
-
ENV['CORN_HOST']
|
14
|
+
ENV['CORN_HOST'] || raise('No environment vairable CORN_HOST defined')
|
14
15
|
end
|
15
16
|
|
16
17
|
def client_id
|
17
|
-
ENV['CORN_CLIENT_ID'] || '
|
18
|
+
ENV['CORN_CLIENT_ID'] || raise('No environment vairable CORN_CLIENT_ID defined')
|
18
19
|
end
|
19
20
|
|
20
|
-
def
|
21
|
-
ENV['
|
21
|
+
def build_label
|
22
|
+
ENV['CORN_BUILD_LABEL'] || raise('No environment vairable CORN_BUILD_LABEL defined')
|
22
23
|
end
|
23
24
|
|
24
25
|
def logger
|
@@ -46,15 +47,31 @@ module Corn
|
|
46
47
|
end
|
47
48
|
|
48
49
|
def report_start
|
50
|
+
@reports ||= create_reports
|
49
51
|
Report.new
|
50
52
|
end
|
51
53
|
|
52
54
|
def report_end(test_name, report)
|
55
|
+
@reports << [test_name] + report.records.flatten
|
56
|
+
end
|
57
|
+
|
58
|
+
def create_reports
|
59
|
+
at_exit { submit_reports }
|
60
|
+
[]
|
61
|
+
end
|
62
|
+
|
63
|
+
def submit_reports
|
64
|
+
return if @reports.nil? || @reports.empty?
|
53
65
|
log_error do
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
66
|
+
reports_csv = CSV.generate do |csv|
|
67
|
+
@reports.each do |rep|
|
68
|
+
csv << rep
|
69
|
+
end
|
70
|
+
end
|
71
|
+
data = { client_id: client_id,
|
72
|
+
build_label: build_label,
|
73
|
+
reports: reports_csv }
|
74
|
+
@reports = []
|
58
75
|
http_post(File.join(host, 'benchmarks'), data)
|
59
76
|
end
|
60
77
|
end
|
data/lib/corn/mini_test.rb
CHANGED
data/lib/corn/test_unit.rb
CHANGED
@@ -18,7 +18,7 @@ module Corn
|
|
18
18
|
@_result = result
|
19
19
|
begin
|
20
20
|
report.record(:setup) { setup }
|
21
|
-
report.record(
|
21
|
+
report.record(:run_test) { __send__(@method_name) }
|
22
22
|
rescue AssertionFailedError => e
|
23
23
|
add_failure(e.message, e.backtrace)
|
24
24
|
rescue Exception
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: corn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xiao Li
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: TBD
|
14
14
|
email:
|