testability-driver-runner 0.9.2 → 1.0.0
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/lib/tdrunner.rb +2 -2
- data/lib/tdrunner_cucumber.rb +5 -6
- data/lib/tdrunner_monitor.rb +95 -1
- data/lib/tdrunner_profile.rb +3 -3
- data/rakefile +2 -2
- metadata +57 -57
data/lib/tdrunner.rb
CHANGED
@@ -47,7 +47,7 @@ module TDRunner
|
|
47
47
|
elsif args[0]=='--help'
|
48
48
|
tdrunner_help()
|
49
49
|
elsif args[0]=='--version'
|
50
|
-
puts '0.
|
50
|
+
puts '1.0.0'
|
51
51
|
elsif args[0]=='--websi'
|
52
52
|
start_websi()
|
53
53
|
elsif args[0]=='-p'
|
@@ -188,7 +188,7 @@ module TDRunner
|
|
188
188
|
puts 'tdrunner -p lpt_qt lpt_sd my_cucumber_tests my_test_unit_test'
|
189
189
|
puts ''
|
190
190
|
puts 'Combines prefious test results to the current test execution:'
|
191
|
-
puts 'tdrunner -c C:/
|
191
|
+
puts 'tdrunner -c C:/tdriver_reports/test_run_yyyyddmmhhss my_test_suite_folder'
|
192
192
|
puts ''
|
193
193
|
puts ''
|
194
194
|
puts "\t-H i\t\t\tDefines how many hours tdrunner will run i as number of hours."
|
data/lib/tdrunner_cucumber.rb
CHANGED
@@ -44,7 +44,7 @@ module TDRunner
|
|
44
44
|
end.flatten.uniq
|
45
45
|
remove_excluded_files_from(potential_feature_files)
|
46
46
|
lpt_feature_files = potential_feature_files.sort
|
47
|
-
lpt_feature_files,content_arr=
|
47
|
+
lpt_feature_files,content_arr=randomize_features(lpt_feature_files,$tdrunner_parameters)
|
48
48
|
lpt_feature_files
|
49
49
|
end
|
50
50
|
end
|
@@ -66,11 +66,9 @@ module TDRunner
|
|
66
66
|
def initialize(args, out_stream = STDOUT, error_stream = STDERR)
|
67
67
|
@args = args
|
68
68
|
if Gem.available?('cucumber','>0.4.4')
|
69
|
-
|
70
|
-
@out_stream = out_stream == STDOUT ? Cucumber::Formatter::ColorIO.new(Kernel, STDOUT) : out_stream
|
71
|
-
else
|
69
|
+
|
72
70
|
@out_stream = out_stream
|
73
|
-
|
71
|
+
|
74
72
|
else
|
75
73
|
@out_stream = out_stream == STDOUT ? Cucumber::Formatter::ColorIO.new : out_stream
|
76
74
|
end
|
@@ -103,7 +101,7 @@ module TDRunner
|
|
103
101
|
return @drb_output if run_drb_client
|
104
102
|
|
105
103
|
#SIERRA runner
|
106
|
-
|
104
|
+
configuration.feature_files
|
107
105
|
run_start_time=Time.now
|
108
106
|
b_execution_monitor_thread=false
|
109
107
|
$tdrunner_interrupted=false
|
@@ -126,6 +124,7 @@ module TDRunner
|
|
126
124
|
end
|
127
125
|
end
|
128
126
|
end
|
127
|
+
configuration.feature_files
|
129
128
|
$tdrunner_interrupted=true if configuration.feature_files==[]
|
130
129
|
runtime = Cucumber::Runtime.new(configuration)
|
131
130
|
runtime.run!
|
data/lib/tdrunner_monitor.rb
CHANGED
@@ -341,6 +341,36 @@ module TDRunner
|
|
341
341
|
return ordered_tests, ordered_contents
|
342
342
|
end
|
343
343
|
|
344
|
+
def order_the_features(tests,case_contents_array)
|
345
|
+
ordered_tests=[]
|
346
|
+
ordered_contents=[]
|
347
|
+
tests_to_string=[]
|
348
|
+
not_found_tests=[]
|
349
|
+
tests.each do |tc|
|
350
|
+
tests_to_string << tc.to_s
|
351
|
+
end
|
352
|
+
|
353
|
+
case_contents_array.each do|tc|
|
354
|
+
if not_found_tests.include?(tc[0].to_s)==false
|
355
|
+
index=tests_to_string.index tc[0].to_s
|
356
|
+
if index!=nil
|
357
|
+
ordered_tests.push tests[index]
|
358
|
+
ordered_contents.push tc
|
359
|
+
else
|
360
|
+
tests_to_be_added=tests.find_all{|item| item.to_s % item.to_s == tc[0].to_s }
|
361
|
+
if tests_to_be_added!=[]
|
362
|
+
ordered_tests.push tests_to_be_added.first
|
363
|
+
ordered_contents.push tc
|
364
|
+
else
|
365
|
+
not_found_tests << tc[0].to_s
|
366
|
+
end
|
367
|
+
end
|
368
|
+
end
|
369
|
+
end
|
370
|
+
|
371
|
+
return ordered_tests, ordered_contents
|
372
|
+
end
|
373
|
+
|
344
374
|
def organize_tests(tests,case_contents_array,case_name_array,tdrunner_parameters)
|
345
375
|
organized_tests=[]
|
346
376
|
test_classes=get_test_classes(tests)
|
@@ -365,6 +395,28 @@ module TDRunner
|
|
365
395
|
organized_tests
|
366
396
|
end
|
367
397
|
|
398
|
+
def organize_features(tests,case_contents_array,case_name_array,tdrunner_parameters)
|
399
|
+
organized_tests=[]
|
400
|
+
|
401
|
+
tests.each do |test_case|
|
402
|
+
profile_index=case_name_array.index test_case.to_s
|
403
|
+
if profile_index == nil
|
404
|
+
File.open(tdrunner_parameters.execution_profile, 'a') { |file| file.write("\n"+test_case.to_s+"=1") } if tdrunner_parameters.execution_mode=='-m'
|
405
|
+
else
|
406
|
+
case_contents_array.each do |test|
|
407
|
+
if test_case.to_s==test[0].to_s
|
408
|
+
|
409
|
+
organized_tests.push test_case
|
410
|
+
|
411
|
+
end
|
412
|
+
end
|
413
|
+
end
|
414
|
+
|
415
|
+
end
|
416
|
+
|
417
|
+
organized_tests
|
418
|
+
end
|
419
|
+
|
368
420
|
def value_exists_in_array(current_array,value)
|
369
421
|
b_exists=false
|
370
422
|
current_array.each do |arr_value|
|
@@ -375,6 +427,48 @@ module TDRunner
|
|
375
427
|
b_exists
|
376
428
|
end
|
377
429
|
|
430
|
+
#method for randomizing the executed features
|
431
|
+
def randomize_features(tests,tdrunner_parameters)
|
432
|
+
tests=flatten_tests(tests)
|
433
|
+
if tdrunner_parameters.execution_profile!=nil
|
434
|
+
f = File.open(tdrunner_parameters.execution_profile) or die "Unable to open file..."
|
435
|
+
@case_contents_array=[] # start with an empty array
|
436
|
+
case_name_array=[]
|
437
|
+
b_profile_file_exist=false
|
438
|
+
|
439
|
+
f.each_line do |line|
|
440
|
+
case_arr=line.split('=')
|
441
|
+
if case_arr.length == 2
|
442
|
+
for i in (1..case_arr[1].to_i)
|
443
|
+
@case_contents_array << [case_arr[0].gsub('-',''),nil,case_arr[0],'not run'] #name, parameters, place in tree, test result
|
444
|
+
case_name_array << case_arr[0].gsub('-','')
|
445
|
+
end
|
446
|
+
b_profile_file_exist=true
|
447
|
+
elsif case_arr.length == 3
|
448
|
+
for i in (1..case_arr[1].to_i)
|
449
|
+
@case_contents_array << [case_arr[0].gsub('-',''),case_arr[2],case_arr[0],'not run'] #name, parameters, place in tree, test result
|
450
|
+
case_name_array << case_arr[0].gsub('-','')
|
451
|
+
end
|
452
|
+
b_profile_file_exist=true
|
453
|
+
end
|
454
|
+
end
|
455
|
+
tests=organize_features(tests,@case_contents_array,case_name_array,tdrunner_parameters)
|
456
|
+
|
457
|
+
end
|
458
|
+
|
459
|
+
if tdrunner_parameters.tdrunner_ordered==false
|
460
|
+
if b_profile_file_exist==true
|
461
|
+
@case_contents_array=@case_contents_array.shuffle
|
462
|
+
tests,@case_contents_array=order_the_features(tests, @case_contents_array)
|
463
|
+
end
|
464
|
+
else
|
465
|
+
if b_profile_file_exist==true
|
466
|
+
tests,@case_contents_array=order_the_features(tests, @case_contents_array)
|
467
|
+
end
|
468
|
+
end
|
469
|
+
return tests, @case_contents_array
|
470
|
+
|
471
|
+
end
|
378
472
|
#method for randomizing the executed tests
|
379
473
|
def randomize_test_cases(tests,tdrunner_parameters)
|
380
474
|
tests=flatten_tests(tests)
|
@@ -401,7 +495,7 @@ module TDRunner
|
|
401
495
|
end
|
402
496
|
end
|
403
497
|
tests=organize_tests(tests,@case_contents_array,case_name_array,tdrunner_parameters)
|
404
|
-
|
498
|
+
|
405
499
|
end
|
406
500
|
|
407
501
|
if tdrunner_parameters.tdrunner_ordered==false
|
data/lib/tdrunner_profile.rb
CHANGED
@@ -198,7 +198,7 @@ module TDRunner
|
|
198
198
|
|
199
199
|
args.each do |value|
|
200
200
|
if hour_defined==true
|
201
|
-
@execution_mode='-H'
|
201
|
+
@execution_mode='-H' if @execution_mode!='-m'
|
202
202
|
@duration_value=value.to_s
|
203
203
|
if !check_duration(@duration_value)
|
204
204
|
puts 'Error duration '+ @duration_value+ ' is not valid!'
|
@@ -207,7 +207,7 @@ module TDRunner
|
|
207
207
|
hour_defined=false
|
208
208
|
end
|
209
209
|
if end_date_defined==true
|
210
|
-
@execution_mode='-d'
|
210
|
+
@execution_mode='-d' if @execution_mode!='-m'
|
211
211
|
@lpt_run=Time.new
|
212
212
|
@lpt_run=format_tdrunner_date(value)
|
213
213
|
if @lpt_run < Time.now
|
@@ -225,7 +225,7 @@ module TDRunner
|
|
225
225
|
start_date_defined=false
|
226
226
|
end
|
227
227
|
if iterations_defined==true
|
228
|
-
@execution_mode='-i'
|
228
|
+
@execution_mode='-i' if @execution_mode!='-m'
|
229
229
|
@lpt_run=value.to_i
|
230
230
|
iterations_defined=false
|
231
231
|
end
|
data/rakefile
CHANGED
@@ -55,9 +55,9 @@ def make_spec
|
|
55
55
|
s.require_path = "lib"
|
56
56
|
s.bindir = "bin"
|
57
57
|
s.add_dependency("testability-driver")
|
58
|
-
s.add_dependency("rails", "
|
58
|
+
s.add_dependency("rails", ">=2.3.5")
|
59
59
|
s.add_dependency("zippy")
|
60
|
-
s.add_dependency("sqlite3-ruby", "1.2.5")
|
60
|
+
s.add_dependency("sqlite3-ruby", ">=1.2.5")
|
61
61
|
|
62
62
|
end
|
63
63
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testability-driver-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
|
+
- 1
|
7
8
|
- 0
|
8
|
-
-
|
9
|
-
|
10
|
-
version: 0.9.2
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Testability Driver team
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-12-20 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
|
-
- - "
|
41
|
+
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
hash: 9
|
44
44
|
segments:
|
@@ -68,7 +68,7 @@ dependencies:
|
|
68
68
|
requirement: &id004 !ruby/object:Gem::Requirement
|
69
69
|
none: false
|
70
70
|
requirements:
|
71
|
-
- - "
|
71
|
+
- - ">="
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
hash: 21
|
74
74
|
segments:
|
@@ -90,77 +90,77 @@ extra_rdoc_files:
|
|
90
90
|
files:
|
91
91
|
- readme
|
92
92
|
- rakefile
|
93
|
-
- bin/sierra
|
94
93
|
- bin/tdrunner
|
95
|
-
-
|
94
|
+
- bin/sierra
|
95
|
+
- lib/tdrunner_monitor.rb
|
96
|
+
- lib/tdrunner_file_finder.rb
|
97
|
+
- lib/tdrunner_cucumber_runners.rb
|
98
|
+
- lib/tdrunner_test_unit.rb
|
96
99
|
- lib/tdrunner.yml
|
100
|
+
- lib/tdrunner.rb
|
97
101
|
- lib/tdrunner_cucumber.rb
|
98
|
-
- lib/tdrunner_cucumber_runners.rb
|
99
|
-
- lib/tdrunner_file_finder.rb
|
100
|
-
- lib/tdrunner_monitor.rb
|
101
102
|
- lib/tdrunner_profile.rb
|
102
|
-
- lib/tdrunner_test_unit.rb
|
103
|
-
- websi/app/controllers/application_controller.rb
|
104
|
-
- websi/app/controllers/report_editor/test_run/cases_controller.rb
|
105
|
-
- websi/app/controllers/report_editor_controller.rb
|
106
|
-
- websi/app/controllers/websi_controller.rb
|
107
|
-
- websi/app/controllers/websi_script.rb
|
108
|
-
- websi/app/controllers/websi_support.rb
|
109
|
-
- websi/app/helpers/application_helper.rb
|
110
|
-
- websi/app/helpers/report_editor/report_editor_helper.rb
|
111
|
-
- websi/app/helpers/report_editor/test_run/cases_helper.rb
|
112
|
-
- websi/app/helpers/websi_helper.rb
|
113
|
-
- websi/app/views/layouts/application.rhtml
|
114
|
-
- websi/app/views/websi/execution.html.erb
|
115
|
-
- websi/app/views/websi/index.html.erb
|
116
|
-
- websi/app/views/websi/profile.html.erb
|
117
|
-
- websi/app/views/websi/results.html.erb
|
118
|
-
- websi/app/views/websi/tests.html.erb
|
119
|
-
- websi/app/views/websi/weights.html.erb
|
120
|
-
- websi/config/boot.rb
|
121
103
|
- websi/config/database.yml
|
104
|
+
- websi/config/routes.rb
|
105
|
+
- websi/config/locales/en.yml
|
122
106
|
- websi/config/environment.rb
|
123
|
-
- websi/config/environments/development.rb
|
124
|
-
- websi/config/environments/production.rb
|
125
|
-
- websi/config/environments/test.rb
|
126
|
-
- websi/config/initializers/backtrace_silencers.rb
|
127
107
|
- websi/config/initializers/inflections.rb
|
128
108
|
- websi/config/initializers/mime_types.rb
|
129
109
|
- websi/config/initializers/new_rails_defaults.rb
|
130
110
|
- websi/config/initializers/session_store.rb
|
131
|
-
- websi/config/
|
132
|
-
- websi/config/
|
133
|
-
- websi/
|
134
|
-
- websi/
|
135
|
-
- websi/
|
136
|
-
- websi/log/development.log
|
137
|
-
- websi/log/production.log
|
111
|
+
- websi/config/initializers/backtrace_silencers.rb
|
112
|
+
- websi/config/boot.rb
|
113
|
+
- websi/config/environments/production.rb
|
114
|
+
- websi/config/environments/development.rb
|
115
|
+
- websi/config/environments/test.rb
|
138
116
|
- websi/log/server.log
|
139
117
|
- websi/log/test.log
|
140
|
-
- websi/
|
141
|
-
- websi/
|
142
|
-
- websi/public/stylesheets/tdriver_report_style.css
|
143
|
-
- websi/public/tests/config/web_profile.sip
|
144
|
-
- websi/public/tests/example_profile.sip
|
145
|
-
- websi/public/tests/tdrunner.yml
|
146
|
-
- websi/public/tests/websi_parameters.xml
|
147
|
-
- websi/public/tests/web_profile.sip
|
118
|
+
- websi/log/production.log
|
119
|
+
- websi/log/development.log
|
148
120
|
- websi/Rakefile
|
149
|
-
- websi/README
|
150
|
-
- websi/script/about
|
151
|
-
- websi/script/console
|
152
|
-
- websi/script/dbconsole
|
153
121
|
- websi/script/destroy
|
154
|
-
- websi/script/
|
155
|
-
- websi/script/performance/benchmarker
|
156
|
-
- websi/script/performance/profiler
|
122
|
+
- websi/script/dbconsole
|
157
123
|
- websi/script/plugin
|
158
124
|
- websi/script/runner
|
125
|
+
- websi/script/performance/profiler
|
126
|
+
- websi/script/performance/benchmarker
|
127
|
+
- websi/script/console
|
159
128
|
- websi/script/server
|
129
|
+
- websi/script/about
|
130
|
+
- websi/script/generate
|
131
|
+
- websi/app/helpers/application_helper.rb
|
132
|
+
- websi/app/helpers/report_editor/test_run/cases_helper.rb
|
133
|
+
- websi/app/helpers/report_editor/report_editor_helper.rb
|
134
|
+
- websi/app/helpers/websi_helper.rb
|
135
|
+
- websi/app/views/websi/execution.html.erb
|
136
|
+
- websi/app/views/websi/profile.html.erb
|
137
|
+
- websi/app/views/websi/index.html.erb
|
138
|
+
- websi/app/views/websi/tests.html.erb
|
139
|
+
- websi/app/views/websi/weights.html.erb
|
140
|
+
- websi/app/views/websi/results.html.erb
|
141
|
+
- websi/app/views/layouts/application.rhtml
|
142
|
+
- websi/app/controllers/websi_controller.rb
|
143
|
+
- websi/app/controllers/application_controller.rb
|
144
|
+
- websi/app/controllers/report_editor/test_run/cases_controller.rb
|
145
|
+
- websi/app/controllers/report_editor_controller.rb
|
146
|
+
- websi/app/controllers/websi_support.rb
|
147
|
+
- websi/app/controllers/websi_script.rb
|
148
|
+
- websi/doc/README_FOR_APP
|
149
|
+
- websi/README
|
160
150
|
- websi/test/functional/websi_controller_test.rb
|
161
151
|
- websi/test/performance/browsing_test.rb
|
162
152
|
- websi/test/test_helper.rb
|
163
153
|
- websi/test/unit/helpers/websi_helper_test.rb
|
154
|
+
- websi/public/tests/config/web_profile.sip
|
155
|
+
- websi/public/tests/websi_parameters.xml
|
156
|
+
- websi/public/tests/web_profile.sip
|
157
|
+
- websi/public/tests/tdrunner.yml
|
158
|
+
- websi/public/tests/example_profile.sip
|
159
|
+
- websi/public/report_editor/test_run/_index.html
|
160
|
+
- websi/public/robots.txt
|
161
|
+
- websi/public/stylesheets/tdriver_report_style.css
|
162
|
+
- websi/db/seeds.rb
|
163
|
+
- websi/db/development.sqlite3
|
164
164
|
has_rdoc: true
|
165
165
|
homepage:
|
166
166
|
licenses: []
|