rutema 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/Rakefile +1 -1
- data/lib/rutema/reporter.rb +1 -1
- data/lib/rutema/reporters/activerecord.rb +5 -1
- data/lib/rutema/reporters/text.rb +9 -1
- data/lib/rutema/system.rb +3 -3
- data/test/test_reporter.rb +10 -2
- metadata +2 -2
data/History.txt
CHANGED
data/Rakefile
CHANGED
@@ -14,7 +14,7 @@ Hoe.new('rutema', "#{Rutema::Version::STRING}") do |p|
|
|
14
14
|
p.description = p.paragraphs_of('README.txt', 1..5).join("\n\n")
|
15
15
|
p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
|
16
16
|
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
|
17
|
-
p.extra_deps<<['patir',">=0.5.
|
17
|
+
p.extra_deps<<['patir',">=0.5.7"]
|
18
18
|
p.extra_deps<<['highline']
|
19
19
|
p.extra_deps<<['mailfactory']
|
20
20
|
p.extra_deps<<['activerecord','=2.0.2']
|
data/lib/rutema/reporter.rb
CHANGED
@@ -12,7 +12,7 @@ module Rutema
|
|
12
12
|
|
13
13
|
#Coordinator will pass the Rutema __configuration__ giving you access to the context which can contain data like headings and build numbers to use in the report. It will also pass the specifications used in the last run so that data like the title and the specification version can be used.
|
14
14
|
#
|
15
|
-
#runner_states is
|
15
|
+
#runner_states is an Array of Patir::CommandSequenceStatus containing the stati of the last run (so it contains all the Scenario stati for the loaded tests)
|
16
16
|
#
|
17
17
|
#parse_errors is an Array of {:filename,:error} hashes containing the errors encountered by the parser when loading the specifications
|
18
18
|
def report specifications,runner_states,parse_errors,configuration
|
@@ -25,6 +25,7 @@ module Rutema
|
|
25
25
|
@dbfile=database_configuration[:database]
|
26
26
|
end
|
27
27
|
Rutema.connect_to_ar(@dbfile,@logger)
|
28
|
+
@logger.info("Reporter '#{self.to_s}' registered")
|
28
29
|
end
|
29
30
|
|
30
31
|
#We get all the data for a Rutema::Model::Run entry in here.
|
@@ -74,6 +75,9 @@ module Rutema
|
|
74
75
|
end
|
75
76
|
run_entry.save!
|
76
77
|
end
|
77
|
-
|
78
|
+
|
79
|
+
def to_s
|
80
|
+
"ActiveRecordReporter using '#{@dbfile}'"
|
81
|
+
end
|
78
82
|
end
|
79
83
|
end
|
@@ -5,6 +5,10 @@ module Rutema
|
|
5
5
|
end
|
6
6
|
|
7
7
|
#Returns the text summary
|
8
|
+
#
|
9
|
+
#runner_states is an Array of Patir::CommandSequenceStatus containing the stati of the last run (so it contains all the Scenario stati for the loaded tests)
|
10
|
+
#
|
11
|
+
#parse_errors is an Array of {:filename,:error} hashes containing the errors encountered by the parser when loading the specifications
|
8
12
|
def report specifications,runner_states,parse_errors,configuration
|
9
13
|
return text_report(specifications,runner_states,parse_errors)
|
10
14
|
end
|
@@ -23,11 +27,15 @@ module Rutema
|
|
23
27
|
msg<<"\nNo scenarios in this run" if runner_states.empty?
|
24
28
|
msg<<"\nOne scenario in the current run:" if runner_states.size==1
|
25
29
|
msg<<"\n#{runner_states.size} scenarios in the current run:" if runner_states.size>1
|
26
|
-
runner_states.
|
30
|
+
rstates=runner_states.sort_by{ |state| state.sequence_id.to_s }
|
31
|
+
rstates.each do |state|
|
27
32
|
msg<<"\n#{state.summary}\n---"
|
28
33
|
end
|
29
34
|
return msg
|
30
35
|
end
|
36
|
+
def sorted_scenario_report runner_states
|
37
|
+
|
38
|
+
end
|
31
39
|
end
|
32
40
|
|
33
41
|
end
|
data/lib/rutema/system.rb
CHANGED
@@ -11,7 +11,7 @@ module Rutema
|
|
11
11
|
module Version
|
12
12
|
MAJOR=0
|
13
13
|
MINOR=9
|
14
|
-
TINY=
|
14
|
+
TINY=3
|
15
15
|
STRING=[ MAJOR, MINOR, TINY ].join( "." )
|
16
16
|
end
|
17
17
|
#The Elements module provides the namespace for the various modules adding parser functionality
|
@@ -463,7 +463,7 @@ module Rutema
|
|
463
463
|
def run name,scenario
|
464
464
|
@logger.debug("Starting run for #{name} with #{scenario.inspect}")
|
465
465
|
@states[name]=Patir::CommandSequenceStatus.new(name,scenario.steps)
|
466
|
-
@states[name].sequence_id="
|
466
|
+
@states[name].sequence_id="#{@number_of_runs}s"
|
467
467
|
#if setup /teardown is defined we need to execute them before and after
|
468
468
|
if @setup
|
469
469
|
@logger.info("Setup for #{name}")
|
@@ -484,7 +484,7 @@ module Rutema
|
|
484
484
|
#always execute teardown
|
485
485
|
@logger.warn("Teardown for #{name}")
|
486
486
|
@states["#{name}_teardown"]=run_scenario("#{name}_teardown",@teardown)
|
487
|
-
@states["#{name}_teardown"].sequence_id="
|
487
|
+
@states["#{name}_teardown"].sequence_id="#{@number_of_runs}t"
|
488
488
|
end
|
489
489
|
@number_of_runs+=1
|
490
490
|
return @states[name]
|
data/test/test_reporter.rb
CHANGED
@@ -79,9 +79,17 @@ module TestRutema
|
|
79
79
|
def test_multiple_scenarios
|
80
80
|
status1=mock()
|
81
81
|
status1.expects(:summary).returns("test1. Status - error. States 3\nStep status summary:\n\t1:'echo' - success\n\t2:'check' - warning\n\t3:'try' - error")
|
82
|
+
status1.expects(:sequence_id).returns(2)
|
82
83
|
status2=mock()
|
83
|
-
status2.expects(:summary).returns("test2. Status -
|
84
|
-
|
84
|
+
status2.expects(:summary).returns("test2. Status - success. States 3\nStep status summary:\n\t1:'echo' - success\n\t2:'check' - success\n\t3:'try' - success")
|
85
|
+
status2.expects(:sequence_id).returns(1)
|
86
|
+
status3=mock()
|
87
|
+
status3.expects(:summary).returns("test3. Status - success. States 3\nStep status summary:\n\t1:'echo' - success\n\t2:'check' - success\n\t3:'try' - success")
|
88
|
+
status3.expects(:sequence_id).returns(nil)
|
89
|
+
status4=mock()
|
90
|
+
status4.expects(:summary).returns("test4. Status - success. States 3\nStep status summary:\n\t1:'echo' - success\n\t2:'check' - success\n\t3:'try' - success")
|
91
|
+
status4.expects(:sequence_id).returns("1s")
|
92
|
+
@status=[status1,status2,status3,status4]
|
85
93
|
definition={:server=>"localhost",:port=>25,:recipients=>["test"],:sender=>"rutema",:subject=>"test"}
|
86
94
|
r=Rutema::EmailReporter.new(definition)
|
87
95
|
Net::SMTP.expects(:start)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rutema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vassilis Rizopoulos
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.5.
|
23
|
+
version: 0.5.7
|
24
24
|
version:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: highline
|