testability-driver-runner 0.9.2
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.
- data/bin/sierra +19 -0
- data/bin/tdrunner +17 -0
- data/lib/tdrunner.rb +208 -0
- data/lib/tdrunner.yml +1 -0
- data/lib/tdrunner_cucumber.rb +222 -0
- data/lib/tdrunner_cucumber_runners.rb +35 -0
- data/lib/tdrunner_file_finder.rb +45 -0
- data/lib/tdrunner_monitor.rb +473 -0
- data/lib/tdrunner_profile.rb +416 -0
- data/lib/tdrunner_test_unit.rb +433 -0
- data/rakefile +135 -0
- data/readme +186 -0
- data/websi/README +243 -0
- data/websi/Rakefile +10 -0
- data/websi/app/controllers/application_controller.rb +29 -0
- data/websi/app/controllers/report_editor/test_run/cases_controller.rb +307 -0
- data/websi/app/controllers/report_editor_controller.rb +25 -0
- data/websi/app/controllers/websi_controller.rb +478 -0
- data/websi/app/controllers/websi_script.rb +26 -0
- data/websi/app/controllers/websi_support.rb +142 -0
- data/websi/app/helpers/application_helper.rb +22 -0
- data/websi/app/helpers/report_editor/report_editor_helper.rb +26 -0
- data/websi/app/helpers/report_editor/test_run/cases_helper.rb +26 -0
- data/websi/app/helpers/websi_helper.rb +21 -0
- data/websi/app/views/layouts/application.rhtml +17 -0
- data/websi/app/views/websi/execution.html.erb +28 -0
- data/websi/app/views/websi/index.html.erb +23 -0
- data/websi/app/views/websi/profile.html.erb +30 -0
- data/websi/app/views/websi/results.html.erb +30 -0
- data/websi/app/views/websi/tests.html.erb +23 -0
- data/websi/app/views/websi/weights.html.erb +16 -0
- data/websi/config/boot.rb +129 -0
- data/websi/config/database.yml +22 -0
- data/websi/config/environment.rb +60 -0
- data/websi/config/environments/development.rb +36 -0
- data/websi/config/environments/production.rb +47 -0
- data/websi/config/environments/test.rb +47 -0
- data/websi/config/initializers/backtrace_silencers.rb +26 -0
- data/websi/config/initializers/inflections.rb +29 -0
- data/websi/config/initializers/mime_types.rb +24 -0
- data/websi/config/initializers/new_rails_defaults.rb +40 -0
- data/websi/config/initializers/session_store.rb +34 -0
- data/websi/config/locales/en.yml +5 -0
- data/websi/config/routes.rb +62 -0
- data/websi/db/development.sqlite3 +0 -0
- data/websi/db/seeds.rb +26 -0
- data/websi/doc/README_FOR_APP +2 -0
- data/websi/log/development.log +0 -0
- data/websi/log/production.log +0 -0
- data/websi/log/server.log +0 -0
- data/websi/log/test.log +0 -0
- data/websi/public/report_editor/test_run/_index.html +12 -0
- data/websi/public/robots.txt +5 -0
- data/websi/public/stylesheets/tdriver_report_style.css +220 -0
- data/websi/public/tests/config/web_profile.sip +0 -0
- data/websi/public/tests/example_profile.sip +8 -0
- data/websi/public/tests/tdrunner.yml +3 -0
- data/websi/public/tests/web_profile.sip +8 -0
- data/websi/public/tests/websi_parameters.xml +4 -0
- data/websi/script/about +4 -0
- data/websi/script/console +3 -0
- data/websi/script/dbconsole +3 -0
- data/websi/script/destroy +3 -0
- data/websi/script/generate +3 -0
- data/websi/script/performance/benchmarker +3 -0
- data/websi/script/performance/profiler +3 -0
- data/websi/script/plugin +3 -0
- data/websi/script/runner +3 -0
- data/websi/script/server +3 -0
- data/websi/test/functional/websi_controller_test.rb +27 -0
- data/websi/test/performance/browsing_test.rb +28 -0
- data/websi/test/test_helper.rb +57 -0
- data/websi/test/unit/helpers/websi_helper_test.rb +23 -0
- metadata +199 -0
data/bin/sierra
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Add '.rb' to work around a bug in IronRuby's File#dirname
|
3
|
+
$:.unshift(File.dirname(__FILE__ + '.rb') + '/../lib') unless $:.include?(File.dirname(__FILE__ + '.rb') + '/../lib')
|
4
|
+
|
5
|
+
require 'tdrunner'
|
6
|
+
|
7
|
+
begin
|
8
|
+
file, line = caller.first.split(":")
|
9
|
+
$stdout.puts "%s:%s warning: sierra deprecated please use tdrunner instead" % [ file, line]
|
10
|
+
# The dup is to keep ARGV intact, so that tools like ruby-debug can respawn.
|
11
|
+
failure = TDRunner::Main.execute(ARGV.dup)
|
12
|
+
Kernel.exit(0)
|
13
|
+
rescue SystemExit => e
|
14
|
+
Kernel.exit(e.status)
|
15
|
+
rescue Exception => e
|
16
|
+
STDERR.puts("#{e.message} (#{e.class})")
|
17
|
+
STDERR.puts(e.backtrace.join("\n"))
|
18
|
+
Kernel.exit(1)
|
19
|
+
end
|
data/bin/tdrunner
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Add '.rb' to work around a bug in IronRuby's File#dirname
|
3
|
+
$:.unshift(File.dirname(__FILE__ + '.rb') + '/../lib') unless $:.include?(File.dirname(__FILE__ + '.rb') + '/../lib')
|
4
|
+
|
5
|
+
require 'tdrunner'
|
6
|
+
|
7
|
+
begin
|
8
|
+
# The dup is to keep ARGV intact, so that tools like ruby-debug can respawn.
|
9
|
+
failure = TDRunner::Main.execute(ARGV.dup)
|
10
|
+
Kernel.exit(0)
|
11
|
+
rescue SystemExit => e
|
12
|
+
Kernel.exit(e.status)
|
13
|
+
rescue Exception => e
|
14
|
+
STDERR.puts("#{e.message} (#{e.class})")
|
15
|
+
STDERR.puts(e.backtrace.join("\n"))
|
16
|
+
Kernel.exit(1)
|
17
|
+
end
|
data/lib/tdrunner.rb
ADDED
@@ -0,0 +1,208 @@
|
|
1
|
+
############################################################################
|
2
|
+
##
|
3
|
+
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
4
|
+
## All rights reserved.
|
5
|
+
## Contact: Nokia Corporation (testabilitydriver@nokia.com)
|
6
|
+
##
|
7
|
+
## This file is part of Testability Driver.
|
8
|
+
##
|
9
|
+
## If you have questions regarding the use of this file, please contact
|
10
|
+
## Nokia at testabilitydriver@nokia.com .
|
11
|
+
##
|
12
|
+
## This library is free software; you can redistribute it and/or
|
13
|
+
## modify it under the terms of the GNU Lesser General Public
|
14
|
+
## License version 2.1 as published by the Free Software Foundation
|
15
|
+
## and appearing in the file LICENSE.LGPL included in the packaging
|
16
|
+
## of this file.
|
17
|
+
##
|
18
|
+
############################################################################
|
19
|
+
|
20
|
+
|
21
|
+
require File.expand_path( File.join( File.dirname( __FILE__ ), 'tdrunner_monitor' ) )
|
22
|
+
require File.expand_path( File.join( File.dirname( __FILE__ ), 'tdrunner_profile' ) )
|
23
|
+
require 'yaml'
|
24
|
+
|
25
|
+
#Sophisticated Interface for Running Random Automation
|
26
|
+
module TDRunner
|
27
|
+
#Main class which is used to start TDRunner run
|
28
|
+
class Main
|
29
|
+
include TDRunnerMonitor
|
30
|
+
class << self
|
31
|
+
def execute(args)
|
32
|
+
begin
|
33
|
+
new(args)
|
34
|
+
return 0
|
35
|
+
rescue Exception => e
|
36
|
+
Kernel.raise e,("#{e.message} #{e.backtrace}")
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
#Initializes TDRunner and checks the command line parameters
|
41
|
+
#-h and --help displays help for TDRunner
|
42
|
+
#-p loads a execution profile from siearra.yml configuration file form config folder in the execution directory
|
43
|
+
#parse the command line arguments if above steps are not found
|
44
|
+
def initialize(args)
|
45
|
+
if args[0]=='-h'
|
46
|
+
tdrunner_help()
|
47
|
+
elsif args[0]=='--help'
|
48
|
+
tdrunner_help()
|
49
|
+
elsif args[0]=='--version'
|
50
|
+
puts '0.9.2'
|
51
|
+
elsif args[0]=='--websi'
|
52
|
+
start_websi()
|
53
|
+
elsif args[0]=='-p'
|
54
|
+
profile = TDRunnerProfileLoader.new(args)
|
55
|
+
tdrunner_profiles=profile.get_execution_profiles
|
56
|
+
tdrunner_profiles.each do |tdrunner_profile|
|
57
|
+
tdrunner_profile_execution_args=profile.args_from(tdrunner_profile)
|
58
|
+
start_tdrunner(tdrunner_profile_execution_args)
|
59
|
+
end
|
60
|
+
elsif args[0]==nil
|
61
|
+
tdrunner_help()
|
62
|
+
else
|
63
|
+
start_tdrunner(args)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
#Start tdrunner web UI
|
67
|
+
def start_websi()
|
68
|
+
websi_dir=[]
|
69
|
+
tdrunner_location=File.dirname(__FILE__)
|
70
|
+
websi_dir_arr=tdrunner_location.split('/')
|
71
|
+
for i in (0..websi_dir_arr.length-4)
|
72
|
+
websi_dir << websi_dir_arr[i] if websi_dir_arr[i] != nil
|
73
|
+
end
|
74
|
+
websi_path=websi_dir.join('/')
|
75
|
+
begin
|
76
|
+
Dir.chdir(websi_path+'/websi')
|
77
|
+
system ("ruby script/server")
|
78
|
+
rescue
|
79
|
+
ensure
|
80
|
+
end
|
81
|
+
end
|
82
|
+
#Executes the tdrunner command
|
83
|
+
#Loads the tdrunner command parameters in to memory for test execution control
|
84
|
+
def execute_test_unit_tests(test_parameters)
|
85
|
+
test_files=[]
|
86
|
+
tests=[]
|
87
|
+
test_suite = Test::Unit::TestSuite.new('Test suite')
|
88
|
+
tdrunner_tests=TDRunnerTestUnit::TDRunnerTestSuiteBuilder.new()
|
89
|
+
test_parameters.each do |value|
|
90
|
+
test_files.push tdrunner_tests.get_files(value)
|
91
|
+
end
|
92
|
+
test_files.each do |test_file|
|
93
|
+
tests.push tdrunner_tests.add_file(test_file)
|
94
|
+
end
|
95
|
+
tests.each do |test_classes|
|
96
|
+
test_classes.each do |test_class|
|
97
|
+
test_suite << test_class.suite
|
98
|
+
end
|
99
|
+
end
|
100
|
+
@tdrunner_runner=TDRunnerTestUnit::ForkedTestUnitRunner.new(test_suite)
|
101
|
+
end
|
102
|
+
def execute_cucumber_tests(test_parameters=[])
|
103
|
+
if Gem.available?('cucumber')
|
104
|
+
@cucumber_command=Array.new(test_parameters)
|
105
|
+
@tdrunner_runner=TDRunnerCucumber::ForkedCucumberRunner.new(@cucumber_command).execute
|
106
|
+
else
|
107
|
+
$stderr.puts('WARNING: Cucumber test framework gem was not found or installed')
|
108
|
+
end
|
109
|
+
end
|
110
|
+
def start_tdrunner(args)
|
111
|
+
$tdrunner_parameters=TDRunnerParameters.new(args)
|
112
|
+
ARGV.clear
|
113
|
+
wait_for_starttime($tdrunner_parameters)
|
114
|
+
case $tdrunner_parameters.test_framework
|
115
|
+
when 'cucumber'
|
116
|
+
require File.expand_path( File.join( File.dirname( __FILE__ ), 'tdrunner_cucumber' ) )
|
117
|
+
@cucumber_command=$tdrunner_parameters.test_framework_command
|
118
|
+
execute_cucumber_tests(@cucumber_command)
|
119
|
+
when 'test_suite', 'test_unit'
|
120
|
+
require File.expand_path( File.join( File.dirname( __FILE__ ), 'tdrunner_test_unit' ) )
|
121
|
+
@test_unit_command=$tdrunner_parameters.test_framework_command
|
122
|
+
execute_test_unit_tests(@test_unit_command)
|
123
|
+
else
|
124
|
+
require File.expand_path( File.join( File.dirname( __FILE__ ), 'tdrunner_cucumber' ) )
|
125
|
+
require File.expand_path( File.join( File.dirname( __FILE__ ), 'tdrunner_test_unit' ) )
|
126
|
+
@test_folder=$tdrunner_parameters.test_framework_command
|
127
|
+
execute_test_unit_tests(@test_folder)
|
128
|
+
@test_folder.each do |folder|
|
129
|
+
if File.directory?(folder)
|
130
|
+
if Gem.available?('cucumber')
|
131
|
+
if Gem.available?('cucumber','>0.4.4')
|
132
|
+
cucumber_parameters=["#{folder.to_s}", "-f", "TDriverReport::CucumberReporter"]
|
133
|
+
end
|
134
|
+
if Gem.available?('cucumber','=0.4.4')
|
135
|
+
cucumber_parameters=["#{folder.to_s}", "-f", "TDriverReport::CucumberListener"]
|
136
|
+
end
|
137
|
+
execute_cucumber_tests(cucumber_parameters)
|
138
|
+
else
|
139
|
+
$stderr.puts('WARNING: Cucumber test framework gem was not found or installed')
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
write_failed_sip_file($tdrunner_parameters)
|
146
|
+
end
|
147
|
+
#Method for displaying tdrunner help in commandline
|
148
|
+
def tdrunner_help()
|
149
|
+
puts 'Usage: tdrunner [options] [framework command]'
|
150
|
+
puts ''
|
151
|
+
puts 'Examples:'
|
152
|
+
puts ''
|
153
|
+
puts 'tdrunner my_test_folder'
|
154
|
+
puts ''
|
155
|
+
puts 'Executes tests for 1.5 hours:'
|
156
|
+
puts 'tdrunner -H 1.5 cucumber features'
|
157
|
+
puts 'tdrunner -H 1.5 test_suite ts_my_test_unit_suite.rb'
|
158
|
+
puts ''
|
159
|
+
puts 'Repeats tests for ten iterations:'
|
160
|
+
puts 'tdrunner -i 10 cucumber features'
|
161
|
+
puts 'tdrunner -i 10 test_suite ts_my_test_unit_suite.rb'
|
162
|
+
puts ''
|
163
|
+
puts 'Runs tests until defined date and time is reached:'
|
164
|
+
puts 'tdrunner -d "12.12.2100 12:00" cucumber features'
|
165
|
+
puts 'tdrunner -d "12.12.2100 12:00" test_suite ts_my_test_unit_suite.rb'
|
166
|
+
puts ''
|
167
|
+
puts 'Start tests when this time is reached:'
|
168
|
+
puts 'tdrunner -s "12.12.2100 12:00" cucumber features'
|
169
|
+
puts 'tdrunner -s "12.12.2100 12:00" test_suite ts_my_test_unit_suite.rb'
|
170
|
+
puts ''
|
171
|
+
puts 'Run test unit teardown only when the testcase is failed:'
|
172
|
+
puts 'tdrunner --teardown -d "12.12.2100 12:00" test_suite ts_my_test_unit_suite.rb'
|
173
|
+
puts ''
|
174
|
+
puts 'Create a execution profile without running the tests:'
|
175
|
+
puts 'tdrunner -m my_execution_profile --teardown -d "12.12.2100 12:00" test_suite ts_my_test_unit_suite.rb'
|
176
|
+
puts 'tdrunner -m my_execution_profile my_test_case_folder'
|
177
|
+
puts ''
|
178
|
+
puts 'Run tests using a execution profile:'
|
179
|
+
puts 'tdrunner -e my_execution_profile --teardown -d "12.12.2100 12:00" test_suite ts_my_test_unit_suite.rb'
|
180
|
+
puts 'tdrunner -e my_execution_profile my_test_folder'
|
181
|
+
puts 'tdrunner --ordered -e my_execution_profile my_test_folder'
|
182
|
+
puts ''
|
183
|
+
puts 'Create a execution profile of all Test::Unit tests which failed when tests were run using an execution profile:'
|
184
|
+
puts 'tdrunner -t my_failed_test_cases.sip -e my_execution_profile my_test_case_folder'
|
185
|
+
puts ''
|
186
|
+
puts 'Runs tests using a predefined profiles:'
|
187
|
+
puts 'tdrunner -p lpt'
|
188
|
+
puts 'tdrunner -p lpt_qt lpt_sd my_cucumber_tests my_test_unit_test'
|
189
|
+
puts ''
|
190
|
+
puts 'Combines prefious test results to the current test execution:'
|
191
|
+
puts 'tdrunner -c C:/tdriver_test_resuts/test_run_yyyyddmmhhss my_test_suite_folder'
|
192
|
+
puts ''
|
193
|
+
puts ''
|
194
|
+
puts "\t-H i\t\t\tDefines how many hours tdrunner will run i as number of hours."
|
195
|
+
puts "\t-i i\t\t\tDefines how many iterations tdrunner will run the tests i as number of iterations."
|
196
|
+
puts "\t-d \"date time\"\t\tDefines end date and time when tdrunner will stop testing"
|
197
|
+
puts "\t-e execution_profile \tDefines tdrunner to use execution profile for running tests"
|
198
|
+
puts "\t-m execution_profile \tDefines tdrunner to create execution profile without running tests"
|
199
|
+
puts "\t-t execution_profile \tDefines tdrunner to create execution profile of failed Test::Unit tests"
|
200
|
+
puts "\t--teardown\t\tRun test unit teardown only when the testcase is failed."
|
201
|
+
puts "\t--ordered\t\tUse this parameter with execution profile to run tests as they are ordered in the sip file."
|
202
|
+
puts "\t--websi\t\tUse this parameter to start tdrunner web interface which is then found from address http://localhost:3000/websi/"
|
203
|
+
puts "\t-p profile_name\t\tPull commandline arguments from tdrunner.yml which can be defined as strings or arrays."
|
204
|
+
puts "\t--version\t\tShow version."
|
205
|
+
puts "\t-h, --help\t\tYou're looking at it."
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
data/lib/tdrunner.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
default: test
|
@@ -0,0 +1,222 @@
|
|
1
|
+
############################################################################
|
2
|
+
##
|
3
|
+
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
4
|
+
## All rights reserved.
|
5
|
+
## Contact: Nokia Corporation (testabilitydriver@nokia.com)
|
6
|
+
##
|
7
|
+
## This file is part of Testability Driver.
|
8
|
+
##
|
9
|
+
## If you have questions regarding the use of this file, please contact
|
10
|
+
## Nokia at testabilitydriver@nokia.com .
|
11
|
+
##
|
12
|
+
## This library is free software; you can redistribute it and/or
|
13
|
+
## modify it under the terms of the GNU Lesser General Public
|
14
|
+
## License version 2.1 as published by the Free Software Foundation
|
15
|
+
## and appearing in the file LICENSE.LGPL included in the packaging
|
16
|
+
## of this file.
|
17
|
+
##
|
18
|
+
############################################################################
|
19
|
+
|
20
|
+
|
21
|
+
require File.expand_path( File.join( File.dirname( __FILE__ ), 'tdrunner_monitor' ) )
|
22
|
+
require File.expand_path( File.join( File.dirname( __FILE__ ), 'tdrunner_cucumber_runners' ) )
|
23
|
+
module TDRunner
|
24
|
+
module TDRunnerCucumber
|
25
|
+
begin
|
26
|
+
require 'cucumber/cli/configuration'
|
27
|
+
require 'cucumber/cli/main'
|
28
|
+
#This class is used for building the TDRunner cucumber test suite
|
29
|
+
class Cucumber::Cli::Configuration
|
30
|
+
include TDRunner::TDRunnerMonitor
|
31
|
+
# Modified feature file loader for multiplying the loaded features
|
32
|
+
def feature_files
|
33
|
+
potential_feature_files = paths.map do |path|
|
34
|
+
path = path.gsub(/\\/, '/') # In case we're on windows. Globs don't work with backslashes.
|
35
|
+
path = path.chomp('/')
|
36
|
+
if File.directory?(path)
|
37
|
+
Dir["#{path}/**/*.feature"]
|
38
|
+
elsif path[0..0] == '@' and # @listfile.txt
|
39
|
+
File.file?(path[1..-1]) # listfile.txt is a file
|
40
|
+
IO.read(path[1..-1]).split
|
41
|
+
else
|
42
|
+
path
|
43
|
+
end
|
44
|
+
end.flatten.uniq
|
45
|
+
remove_excluded_files_from(potential_feature_files)
|
46
|
+
lpt_feature_files = potential_feature_files.sort
|
47
|
+
lpt_feature_files,content_arr=randomize_test_cases(lpt_feature_files,$tdrunner_parameters)
|
48
|
+
lpt_feature_files
|
49
|
+
end
|
50
|
+
end
|
51
|
+
# TDRunner test runner for cucumber tests
|
52
|
+
class ForkedCucumberRunner < Cucumber::Cli::Main
|
53
|
+
include TDRunnerMonitor
|
54
|
+
include TDRunnerCucumberRunners
|
55
|
+
def step_mother
|
56
|
+
@step_mother ||= Cucumber::StepMother.new
|
57
|
+
end
|
58
|
+
def execute()
|
59
|
+
if Gem.available?('cucumber','>0.4.4')
|
60
|
+
execute!
|
61
|
+
else
|
62
|
+
execute!(step_mother)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def initialize(args, out_stream = STDOUT, error_stream = STDERR)
|
67
|
+
@args = args
|
68
|
+
if Gem.available?('cucumber','>0.4.4')
|
69
|
+
if Cucumber::WINDOWS_MRI
|
70
|
+
@out_stream = out_stream == STDOUT ? Cucumber::Formatter::ColorIO.new(Kernel, STDOUT) : out_stream
|
71
|
+
else
|
72
|
+
@out_stream = out_stream
|
73
|
+
end
|
74
|
+
else
|
75
|
+
@out_stream = out_stream == STDOUT ? Cucumber::Formatter::ColorIO.new : out_stream
|
76
|
+
end
|
77
|
+
|
78
|
+
|
79
|
+
@error_stream = error_stream
|
80
|
+
end
|
81
|
+
|
82
|
+
def create_cucumber_runner(step_mother)
|
83
|
+
runner=nil
|
84
|
+
if tdrunner_loaded_features==nil
|
85
|
+
runner=configuration.build_runner(step_mother, @out_stream)
|
86
|
+
set_tdrunner_loaded_features(configuration.feature_dirs,runner)
|
87
|
+
else
|
88
|
+
tdrunner_loaded_features.each do |value|
|
89
|
+
if value[0].to_s == configuration.feature_dirs.to_s
|
90
|
+
runner = value[1].at(0)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
if runner==nil
|
95
|
+
runner=configuration.build_runner(step_mother, @out_stream)
|
96
|
+
set_tdrunner_loaded_features(configuration.feature_dirs,runner)
|
97
|
+
end
|
98
|
+
runner
|
99
|
+
end
|
100
|
+
def execute!(step_mother=nil)
|
101
|
+
if step_mother==nil
|
102
|
+
trap_interrupt
|
103
|
+
return @drb_output if run_drb_client
|
104
|
+
|
105
|
+
#SIERRA runner
|
106
|
+
loaded_features=configuration.feature_files
|
107
|
+
run_start_time=Time.now
|
108
|
+
b_execution_monitor_thread=false
|
109
|
+
$tdrunner_interrupted=false
|
110
|
+
iteration=0
|
111
|
+
while tdrunner_active(run_start_time,iteration,$tdrunner_parameters)==true
|
112
|
+
if b_execution_monitor_thread==false
|
113
|
+
b_execution_monitor_thread=true
|
114
|
+
t1 = Thread.new do
|
115
|
+
begin
|
116
|
+
while $tdrunner_interrupted==false
|
117
|
+
sleep 10
|
118
|
+
if tdrunner_active(run_start_time,iteration,$tdrunner_parameters)==false
|
119
|
+
$tdrunner_interrupted=true
|
120
|
+
end
|
121
|
+
end
|
122
|
+
Cucumber.wants_to_quit = true
|
123
|
+
rescue Exception => e
|
124
|
+
$tdrunner_interrupted=true
|
125
|
+
Cucumber.wants_to_quit = true
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
$tdrunner_interrupted=true if configuration.feature_files==[]
|
130
|
+
runtime = Cucumber::Runtime.new(configuration)
|
131
|
+
runtime.run!
|
132
|
+
break if $tdrunner_interrupted
|
133
|
+
|
134
|
+
iteration+=1
|
135
|
+
end
|
136
|
+
iteration=0
|
137
|
+
$tdrunner_interrupted=true
|
138
|
+
current_run_time=Time.now-run_start_time
|
139
|
+
puts 'Run time: '+ format_duration(current_run_time)
|
140
|
+
#end SIERRA runner
|
141
|
+
|
142
|
+
runtime.results.failure? if runtime
|
143
|
+
|
144
|
+
else
|
145
|
+
trap_interrupt
|
146
|
+
if configuration.drb?
|
147
|
+
begin
|
148
|
+
return DRbClient.run(@args, @error_stream, @out_stream, configuration.drb_port)
|
149
|
+
rescue DRbClientError => e
|
150
|
+
@error_stream.puts "WARNING: #{e.message} Running features locally:"
|
151
|
+
end
|
152
|
+
end
|
153
|
+
step_mother.options = configuration.options
|
154
|
+
step_mother.log = configuration.log
|
155
|
+
|
156
|
+
step_mother.load_code_files(configuration.support_to_load)
|
157
|
+
step_mother.after_configuration(configuration)
|
158
|
+
features = step_mother.load_plain_text_features(configuration.feature_files)
|
159
|
+
step_mother.load_code_files(configuration.step_defs_to_load)
|
160
|
+
|
161
|
+
enable_diffing
|
162
|
+
|
163
|
+
runner = create_cucumber_runner(step_mother)
|
164
|
+
step_mother.visitor = runner # Needed to support World#announce
|
165
|
+
|
166
|
+
#SIERRA runner
|
167
|
+
run_start_time=Time.now
|
168
|
+
b_execution_monitor_thread=false
|
169
|
+
$tdrunner_interrupted=false
|
170
|
+
iteration=0
|
171
|
+
while tdrunner_active(run_start_time,iteration,$tdrunner_parameters)==true
|
172
|
+
if b_execution_monitor_thread==false
|
173
|
+
b_execution_monitor_thread=true
|
174
|
+
t1 = Thread.new do
|
175
|
+
begin
|
176
|
+
while $tdrunner_interrupted==false
|
177
|
+
sleep 10
|
178
|
+
if tdrunner_active(run_start_time,iteration,$tdrunner_parameters)==false
|
179
|
+
$tdrunner_interrupted=true
|
180
|
+
end
|
181
|
+
end
|
182
|
+
Cucumber.wants_to_quit = true
|
183
|
+
rescue Exception => e
|
184
|
+
$tdrunner_interrupted=true
|
185
|
+
Cucumber.wants_to_quit = true
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
$tdrunner_interrupted=true if configuration.feature_files==[]
|
190
|
+
runner.visit_features(features)
|
191
|
+
break if $tdrunner_interrupted
|
192
|
+
features=nil
|
193
|
+
features = step_mother.load_plain_text_features(configuration.feature_files)
|
194
|
+
step_mother.log = nil
|
195
|
+
step_mother.log = configuration.log
|
196
|
+
iteration+=1
|
197
|
+
end
|
198
|
+
iteration=0
|
199
|
+
$tdrunner_interrupted=true
|
200
|
+
current_run_time=Time.now-run_start_time
|
201
|
+
puts 'Run time: '+ format_duration(current_run_time)
|
202
|
+
#end SIERRA runner
|
203
|
+
|
204
|
+
failure = if exceeded_tag_limts?(features)
|
205
|
+
FAILURE
|
206
|
+
elsif configuration.wip?
|
207
|
+
step_mother.scenarios(:passed).any?
|
208
|
+
else
|
209
|
+
step_mother.scenarios(:failed).any? ||
|
210
|
+
(configuration.strict? && (step_mother.steps(:undefined).any? || step_mother.steps(:pending).any?))
|
211
|
+
end
|
212
|
+
end
|
213
|
+
rescue Exception => e
|
214
|
+
puts e.message
|
215
|
+
true
|
216
|
+
end
|
217
|
+
end
|
218
|
+
rescue LoadError
|
219
|
+
|
220
|
+
end
|
221
|
+
end
|
222
|
+
end
|