cucumber-nagios 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +1 -1
- data/lib/cucumber/formatter/nagios.rb +11 -13
- data/lib/generators/project/Gemfile +1 -1
- metadata +2 -2
data/AUTHORS
CHANGED
@@ -7,7 +7,7 @@ Contributors
|
|
7
7
|
------------
|
8
8
|
|
9
9
|
Morgan Christiansson <morgan@mog.se>
|
10
|
-
Martin Englund <martin
|
10
|
+
Martin Englund <martin@englund.nu>
|
11
11
|
Adam Jacob <adam@opscode.com>
|
12
12
|
Juri Rischel Jensen <juri@fab-it.dk>
|
13
13
|
Gareth Rushgrove <gareth@morethanseven.net>
|
@@ -10,7 +10,7 @@ module Cucumber
|
|
10
10
|
@warning = []
|
11
11
|
@io = io
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def after_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background)
|
15
15
|
record_result(status, :step_match => step_match)
|
16
16
|
end
|
@@ -20,7 +20,7 @@ module Cucumber
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def after_table_row(table_row)
|
23
|
-
unless @header_row
|
23
|
+
unless @header_row
|
24
24
|
record_result(table_row.status) if table_row.respond_to?(:status)
|
25
25
|
end
|
26
26
|
@header_row = false if @header_row
|
@@ -29,24 +29,22 @@ module Cucumber
|
|
29
29
|
def after_features(steps)
|
30
30
|
print_summary
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
private
|
34
34
|
def print_summary
|
35
35
|
@total = @failed.size + @passed.size + @warning.size
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
message
|
43
|
-
message += ", nosteps=#{@warning.size}"
|
44
|
-
message += ", total=#{@total}\n"
|
36
|
+
@status = @failed.size > 0 && "CRITICAL" || @warning.size > 0 && "WARNING" || "OK"
|
37
|
+
|
38
|
+
service_output = [ "CUCUMBER #{@status} - Critical: #{@failed.size}",
|
39
|
+
"Warning: #{@warning.size}", "#{@passed.size} okay" ]
|
40
|
+
performance_data = [ "passed=#{@passed.size}", "failed=#{@failed.size}",
|
41
|
+
"nosteps=#{@warning.size}", "total=#{@total}" ]
|
42
|
+
message = "#{service_output.join(', ')} | #{performance_data.join('; ')}\n"
|
45
43
|
|
46
44
|
@io.print(message)
|
47
45
|
@io.flush
|
48
46
|
end
|
49
|
-
|
47
|
+
|
50
48
|
def record_result(status, opts={})
|
51
49
|
step_match = opts[:step_match] || true
|
52
50
|
case status
|