rutema 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.4.3 / 2008-02-25
2
+ * fixed bug in rutemax when the activerecord reporter is used, where the database was not created relative to the configuration entry
3
+ * fixed bug in rutemah where the report was not printed (doh!)
4
+ * added active record reporter configuration and rutemah configuration to distro test
1
5
  == 0.4.2 / 2007-12-05
2
6
  * rutemah code cleaned up
3
7
  * Bugfix: MinimalXMLParser now handles relative paths in command elements correctly
data/Manifest.txt CHANGED
@@ -24,6 +24,16 @@ lib/rutemaweb/htdocs/step_warn.png
24
24
  lib/rutemaweb/htdocs/style.css
25
25
  lib/rutemaweb/htdocs/tie_logo.gif
26
26
  lib/rutemaweb/rutemaweb.rb
27
+ lib/rutemaweb/htdocs/bg_menu.gif
28
+ lib/rutemaweb/htdocs/bg_submenu.gif
29
+ lib/rutemaweb/htdocs/run_error.png
30
+ lib/rutemaweb/htdocs/run_ok.png
31
+ lib/rutemaweb/htdocs/run_warn.png
32
+ lib/rutemaweb/htdocs/step_error.png
33
+ lib/rutemaweb/htdocs/step_ok.png
34
+ lib/rutemaweb/htdocs/step_warn.png
35
+ lib/rutemaweb/htdocs/style.css
36
+ lib/rutemaweb/htdocs/tie_logo.gif
27
37
  test/test_configuration.rb
28
38
  test/test_specification.rb
29
39
  test/test_system.rb
@@ -38,7 +48,10 @@ test/samples/tests/sample.spec
38
48
  test/samples/valid_config.rb
39
49
  test/samples/rutemah_config.rb
40
50
  test/distro_test/config/minimal.rutema
51
+ test/distro_test/config/database.rutema
52
+ test/distro_test/config/database.rutemah
41
53
  test/distro_test/specs/T001.spec
42
54
  test/distro_test/specs/T002.spec
43
55
  test/distro_test/specs/T003.spec
44
56
  test/distro_test/specs/T004.spec
57
+
data/README.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  rutema http://patir.rubyforge.org/rutema
2
2
 
3
3
  == DESCRIPTION:
4
-
4
+
5
5
  Rutema provides the basis for building tools that can manage the execution of tests as well as an example implementation as proof-of-concept for the ideas behind it.
6
6
 
7
7
  It's purpose is to provide a set of classes and a framework that will allow testers to specify and execute tests in heterogeneous testing environments.
@@ -11,9 +11,9 @@ Rutema will allows you to combine tools, takes care of logging, reporting, archi
11
11
  For more information look at http://patir.rubyforge.org/rutema
12
12
 
13
13
  == FEATURES/PROBLEMS:
14
-
14
+
15
15
  * rutemax - runs tests
16
- * rutemah - a tool to create reports out of the test result database
16
+ * rutemah - a tool to create reports out of a test result database
17
17
  * rutemaweb - a web frontend for the test result database
18
18
 
19
19
  == SYNOPSIS:
@@ -33,6 +33,10 @@ rutemax -c sample.cfg unattended - to run all unattended tests
33
33
  * patir (http://patir.rubyforge.org)
34
34
  * highline (http://highline.rubyforge.org)
35
35
  * mailfactory (http://rubyforge.org/projects/mailfactory/)
36
+ * activerecord (http://ar.rubyonrails.com/)
37
+ * sqlite3 (http://rubyforge.org/projects/sqlite-ruby/)
38
+ * camping (http://camping.rubyforge.org/)
39
+ * ruport (http://rubyreports.org/)
36
40
 
37
41
  == INSTALL:
38
42
 
data/Rakefile CHANGED
@@ -19,6 +19,7 @@ Hoe.new('rutema', "#{Rutema::Version::STRING}") do |p|
19
19
  p.extra_deps<<['mailfactory']
20
20
  p.extra_deps<<['activerecord']
21
21
  p.extra_deps<<['ruport']
22
+ p.extra_deps<<['acts_as_reportable']
22
23
  p.extra_deps<<['camping']
23
24
  p.spec_extras={:executables=>["rutemax","rutemah","rutemaweb"],
24
25
  :default_executable=>"rutemax"}
@@ -135,20 +135,20 @@ module Rutema
135
135
  end
136
136
 
137
137
  def configuration
138
- prev_dir=Dir.pwd
139
- Dir.chdir(File.dirname(config_file))
140
- conf=OpenStruct.new
141
- conf.tools=OpenStruct.new(@tools)
142
- conf.paths=OpenStruct.new(@paths)
143
- conf.setup=@setup
144
- conf.teardown=@teardown
145
- conf.check=@check
146
- conf.context=OpenStruct.new(@context)
147
- conf.parser=@parser
148
- conf.reporters=@reporters
149
- conf.tests=@tests.collect{|e| File.expand_path(e) }
150
- Dir.chdir(prev_dir)
151
- return conf
138
+ @configuration=OpenStruct.new
139
+ Dir.chdir(File.dirname(config_file)) do |path|
140
+ @configuration.tools=OpenStruct.new(@tools)
141
+ @configuration.paths=OpenStruct.new(@paths)
142
+ @configuration.setup=@setup
143
+ @configuration.teardown=@teardown
144
+ @configuration.check=@check
145
+ @configuration.context=OpenStruct.new(@context)
146
+ @configuration.parser=@parser
147
+ @configuration.reporters=@reporters
148
+ @configuration.tests=@tests.collect{|e| File.expand_path(e) }
149
+ @configuration.filename=@config_file
150
+ end
151
+ return @configuration
152
152
  end
153
153
  end
154
154
 
@@ -1,7 +1,6 @@
1
- require 'rutema/reporter_ar'
2
- require 'rutema/system'
3
-
4
1
  require 'rubygems'
2
+ require 'rutema/model'
3
+ require 'rutema/system'
5
4
  require "ruport"
6
5
 
7
6
  module Rutema
@@ -17,7 +16,7 @@ module Rutema
17
16
  raise "No configuration file defined!" if !@config_file
18
17
  configuration=RutemaHConfigurator.new(@config_file,logger).configuration
19
18
  historian=Historian.new(configuration,logger)
20
- historian.history(@command)
19
+ puts historian.history(@command)
21
20
  rescue Patir::ConfigurationException
22
21
  logger.debug($!)
23
22
  logger.fatal("Configuration error '#{$!.message}'")
@@ -66,6 +65,7 @@ module Rutema
66
65
  case mode
67
66
  when "all"
68
67
  table=Model::Scenario.report_table(:all)
68
+ @logger.warn("No entries found") if table.empty?
69
69
  ret=Ruport::Data::Grouping(beautify(table),:by=>"run_id")
70
70
  when String
71
71
  ret=per_spec(mode)
@@ -96,13 +96,12 @@ module Rutema
96
96
  end
97
97
  def connect
98
98
  ActiveRecord::Base.logger = @logger
99
- begin
100
- ActiveRecord::Base.connection
101
- @logger.info("Database connection available: #{ActiveRecord::Base.connection.to_s}")
102
- rescue
103
- @logger.info("Connecting with database '#{@configuration.source}'")
104
- ActiveRecord::Base.establish_connection(:adapter => "sqlite3",:database => @configuration.source)
105
- end
99
+ if File.exist?(@configuration.source)
100
+ @logger.info("Connecting with database '#{@configuration.source}'")
101
+ ActiveRecord::Base.establish_connection(:adapter=>"sqlite3", :database=>@configuration.source )
102
+ else
103
+ @logger.fatal("Could not find #{@configuration.source}")
104
+ end
106
105
  end
107
106
  end
108
107
  end
@@ -11,10 +11,10 @@ module Rutema
11
11
  #The current implementation uses SQLite as the DBMS until we get enough time to implement the rest of the configuration.
12
12
  class ActiveRecordReporter<Reporter
13
13
  def initialize definition
14
- @definition=definition
15
14
  @logger=definition[:logger]
16
15
  @logger||=Patir.setup_logger
17
16
  raise "No database file defined" unless definition[:dbfile]
17
+ @dbfile=File.expand_path(definition[:dbfile])
18
18
  connect
19
19
  end
20
20
 
@@ -42,7 +42,7 @@ module Rutema
42
42
  #get the specification for this scenario
43
43
  spec=specifications[scenario.sequence_name]
44
44
  if spec
45
- sc.version=spec.version
45
+ sc.version=spec.version if spec.has_version?
46
46
  else
47
47
  @logger.error("Could not find specification for #{scenario.sequence_name}")
48
48
  end
@@ -63,17 +63,16 @@ module Rutema
63
63
  end
64
64
  run_entry.scenarios<<sc
65
65
  end
66
- run_entry.save
66
+ run_entry.save!
67
67
  end
68
68
 
69
69
  private
70
70
  def connect
71
71
  ActiveRecord::Base.logger = @logger
72
- @logger.info("Connecting with database '#{@definition[:dbfile]}'")
72
+ @logger.info("Connecting with database '#{@dbfile}'")
73
73
  ActiveRecord::Base.establish_connection(:adapter => "sqlite3",
74
- :database => @definition[:dbfile])
75
- Model::Schema.migrate(:up) unless File.exists?(@definition[:dbfile])
74
+ :database => @dbfile)
75
+ Model::Schema.migrate(:up) unless File.exists?(@dbfile)
76
76
  end
77
- end
78
-
77
+ end
79
78
  end
data/lib/rutema/system.rb CHANGED
@@ -16,7 +16,7 @@ module Rutema
16
16
  module Version
17
17
  MAJOR=0
18
18
  MINOR=4
19
- TINY=2
19
+ TINY=3
20
20
  STRING=[ MAJOR, MINOR, TINY ].join( "." )
21
21
  end
22
22
  #Is raised when an error is found in a specification
@@ -167,8 +167,7 @@ module Rutema
167
167
  def parse_specification param
168
168
  spec = super(param)
169
169
  #change into the directory the spec is in to handle relative paths correctly
170
- prev_dir=Dir.pwd
171
- Dir.chdir(File.dirname(spec.filename))
170
+ Dir.chdir(File.dirname(spec.filename)) do |path|
172
171
  spec.scenario.steps.each do |step|
173
172
  case step.step_type
174
173
  when "echo"
@@ -192,7 +191,7 @@ module Rutema
192
191
  end#do rubycommand
193
192
  end#case
194
193
  end#do spec.scenario.steps
195
- Dir.chdir(prev_dir)
194
+ end
196
195
  return spec
197
196
  end
198
197
  end
@@ -496,8 +495,10 @@ module Rutema
496
495
  begin
497
496
  raise "No configuration file defined!" if !@config_file
498
497
  @configuration=RutemaXConfigurator.new(@config_file,@logger).configuration
499
- @coordinator=Coordinator.new(@configuration,@logger)
500
- application_flow
498
+ Dir.chdir(File.dirname(@config_file)) do
499
+ @coordinator=Coordinator.new(@configuration,@logger)
500
+ application_flow
501
+ end
501
502
  rescue Patir::ConfigurationException
502
503
  @logger.debug($!)
503
504
  @logger.fatal("Configuration error '#{$!.message}'")
@@ -519,10 +520,10 @@ module Rutema
519
520
  opt.on("-v", "--version","Displays the version") { $stdout.puts("v#{Version::STRING}");exit 0 }
520
521
  opt.on("--help", "-h", "-?", "This text") { $stdout.puts opt; exit 0 }
521
522
  opt.on("The commands are:")
522
- opt.on("\tall - Runs all tests")
523
- opt.on("\tattended - Runs all attended tests")
524
- opt.on("\tunattended - Runs all unattended tests")
525
- opt.on("You can also provide a specification filename in order to run a single test")
523
+ opt.on("\tall - Runs all tests")
524
+ opt.on("\tattended - Runs all attended tests")
525
+ opt.on("\tunattended - Runs all unattended tests")
526
+ opt.on("You can also provide a specification filename in order to run a single test")
526
527
  opt.parse!
527
528
  #and now the rest
528
529
  if args.empty?
@@ -0,0 +1,9 @@
1
+ require 'rutema/reporter_ar'
2
+ configuration.parser={:class=>Rutema::MinimalXMLParser}
3
+ configuration.reporter={:class=>Rutema::ActiveRecordReporter, :dbfile=>"sample.db"}
4
+ configuration.tests=[
5
+ "../specs/T001.spec",
6
+ "../specs/T002.spec",
7
+ "../specs/T003.spec",
8
+ "../specs/T004.spec"
9
+ ]
@@ -0,0 +1,2 @@
1
+ configuration.load_from_file("database.rutema")
2
+ configuration.source="sample.db"
@@ -1,3 +1,3 @@
1
- $:.unshift File.dirname(__FILE__)
1
+ #$:.unshift File.dirname(__FILE__)
2
2
  configuration.load_from_file("valid_config.rb")
3
- configuration.source="../test.db"
3
+ configuration.source="test.db"
@@ -33,7 +33,6 @@ module TestRutema
33
33
  def teardown
34
34
  Dir.chdir(@prev_dir)
35
35
  end
36
-
37
36
  def test_report
38
37
  spec1=OpenStruct.new(:name=>"test1")
39
38
  spec2=OpenStruct.new(:name=>"test2",:version=>"10")
@@ -52,6 +51,9 @@ module TestRutema
52
51
  #with some context
53
52
  configuration.context="context"
54
53
  assert_nothing_raised() { r.report(specs,@status,@parse_errors,configuration) }
54
+ assert_equal(4, Rutema::Model::Run.find(:all).size)
55
+ assert_equal(8, Rutema::Model::Scenario.find(:all).size)
56
+ assert_equal(12, Rutema::Model::Step.find(:all).size)
55
57
  end
56
58
  end
57
59
  class TestEmailReporter<Test::Unit::TestCase
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rutema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
5
- platform: ""
4
+ version: 0.4.3
5
+ platform: ruby
6
6
  authors:
7
7
  - Vassilis Rizopoulos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2007-12-05 00:00:00 +01:00
12
+ date: 2008-02-25 00:00:00 +01:00
13
13
  default_executable: rutemax
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -57,6 +57,15 @@ dependencies:
57
57
  - !ruby/object:Gem::Version
58
58
  version: "0"
59
59
  version:
60
+ - !ruby/object:Gem::Dependency
61
+ name: acts_as_reportable
62
+ version_requirement:
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ version:
60
69
  - !ruby/object:Gem::Dependency
61
70
  name: camping
62
71
  version_requirement:
@@ -73,9 +82,9 @@ dependencies:
73
82
  requirements:
74
83
  - - ">="
75
84
  - !ruby/object:Gem::Version
76
- version: 1.3.0
85
+ version: 1.5.0
77
86
  version:
78
- description: "== DESCRIPTION: Rutema provides the basis for building tools that can manage the execution of tests as well as an example implementation as proof-of-concept for the ideas behind it. It's purpose is to provide a set of classes and a framework that will allow testers to specify and execute tests in heterogeneous testing environments. Rutema will allows you to combine tools, takes care of logging, reporting, archiving of results and formalizes execution of automated and manual tests. For more information look at http://patir.rubyforge.org/rutema == FEATURES/PROBLEMS: * rutemax - runs tests * rutemah - a tool to create reports out of the test result database * rutemaweb - a web frontend for the test result database"
87
+ description: "== DESCRIPTION: Rutema provides the basis for building tools that can manage the execution of tests as well as an example implementation as proof-of-concept for the ideas behind it. It's purpose is to provide a set of classes and a framework that will allow testers to specify and execute tests in heterogeneous testing environments. Rutema will allows you to combine tools, takes care of logging, reporting, archiving of results and formalizes execution of automated and manual tests. For more information look at http://patir.rubyforge.org/rutema == FEATURES/PROBLEMS:"
79
88
  email: riva@braveworld.net
80
89
  executables:
81
90
  - rutemax
@@ -129,6 +138,8 @@ files:
129
138
  - test/samples/valid_config.rb
130
139
  - test/samples/rutemah_config.rb
131
140
  - test/distro_test/config/minimal.rutema
141
+ - test/distro_test/config/database.rutema
142
+ - test/distro_test/config/database.rutemah
132
143
  - test/distro_test/specs/T001.spec
133
144
  - test/distro_test/specs/T002.spec
134
145
  - test/distro_test/specs/T003.spec
@@ -156,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
167
  requirements: []
157
168
 
158
169
  rubyforge_project: patir
159
- rubygems_version: 0.9.5
170
+ rubygems_version: 1.0.1
160
171
  signing_key:
161
172
  specification_version: 2
162
173
  summary: rutema is a test execution and management framework for heterogeneous testing environments