testplan 0.0.3 → 0.0.4
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -0
- data/bin/testplan +1 -0
- data/lib/tasks/rspec.rake +0 -1
- data/lib/tasks/testplan.rake +13 -12
- data/lib/testplan/version.rb +1 -1
- data/lib/testplan.rb +35 -8
- metadata +2 -3
- data/lib/tasks/testlink.rake +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e86fe5f0204532eccc8b6f70555baddaa1a4c029
|
4
|
+
data.tar.gz: 081f80dae2908c8cfa72d62ebc9cdea37eccd16f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c614345131cd13a8d2722023f0a424c5e5a767f8628d978e8dce043dd0a995215afe2a7f3c569f324125dc083ac94b7fdd74c1aaf6b1382e1f4d664dd9a890bd
|
7
|
+
data.tar.gz: 772fd4c38ed6824a841bfc4995bb8b12ca4d8c0c41b5c8bd60c45e389da9e5ba6ee53b8e2d5673da6966438b73633d71d80d31140dbf152ab183ac044986fc71
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -4,6 +4,7 @@ This gem helps organize rspec cases into testplans. It replaces the need
|
|
4
4
|
for an test management application like TestLink.
|
5
5
|
|
6
6
|
## TODO
|
7
|
+
* autonumbering of specs
|
7
8
|
* add Example group aliases like :requirement and :project
|
8
9
|
* add Requirements Coverage Report PDF functionality (sep. Gem)
|
9
10
|
* add Estemated Hours Impact Report PDF functionality (sep. Gem)
|
data/bin/testplan
CHANGED
data/lib/tasks/rspec.rake
CHANGED
data/lib/tasks/testplan.rake
CHANGED
@@ -1,24 +1,25 @@
|
|
1
1
|
task default: %w[testplan:build_ci]
|
2
2
|
namespace :testplan do
|
3
3
|
|
4
|
-
desc '
|
5
|
-
task :
|
6
|
-
Testplan::Build::plan_in_format :
|
4
|
+
desc 'run all cases in plan separately by testplan name, format documentation'
|
5
|
+
task :run_separate_doc,[:testplan] do |t, args|
|
6
|
+
Testplan::Build::plan_in_format args[:testplan].to_sym, :documentation, false
|
7
7
|
end
|
8
8
|
|
9
|
-
desc '
|
10
|
-
task :
|
11
|
-
Testplan::Build::plan_in_format :
|
9
|
+
desc 'run all cases in plan at once by testplan name, format documentation'
|
10
|
+
task :run_all_doc,[:testplan] do |t, args|
|
11
|
+
Testplan::Build::plan_in_format args[:testplan].to_sym, :documentation, true
|
12
12
|
end
|
13
13
|
|
14
|
-
desc '
|
15
|
-
task :
|
16
|
-
Testplan::Build::plan_in_format args[:testplan].to_sym, :junit
|
14
|
+
desc 'run all cases in plan separately by testplan name, format junit'
|
15
|
+
task :run_separate_junit,[:testplan] do |t, args|
|
16
|
+
Testplan::Build::plan_in_format args[:testplan].to_sym, :junit, false
|
17
17
|
end
|
18
18
|
|
19
|
-
desc '
|
20
|
-
task :
|
21
|
-
Testplan::Build::plan_in_format args[:testplan].to_sym, :
|
19
|
+
desc 'run all cases in plan at once by testplan name, format junit'
|
20
|
+
task :run_all_junit,[:testplan] do |t, args|
|
21
|
+
Testplan::Build::plan_in_format args[:testplan].to_sym, :junit, true
|
22
22
|
end
|
23
|
+
|
23
24
|
end
|
24
25
|
|
data/lib/testplan/version.rb
CHANGED
data/lib/testplan.rb
CHANGED
@@ -8,17 +8,19 @@ Dir.glob("#{spec.gem_dir}/lib/tasks/*.rake").each { |r| import r }
|
|
8
8
|
|
9
9
|
module Testplan
|
10
10
|
class Setup
|
11
|
-
|
12
11
|
def self.init(value)
|
13
12
|
$initconf = value
|
14
13
|
end
|
15
|
-
|
16
14
|
end
|
17
15
|
|
18
16
|
class Build
|
19
|
-
def self.plan_in_format(plan, format)
|
17
|
+
def self.plan_in_format(plan, format, execute_all_at_once = false)
|
20
18
|
exitcode = 0
|
19
|
+
|
21
20
|
config = $initconf.call
|
21
|
+
|
22
|
+
validate_plan_name(config, plan)
|
23
|
+
|
22
24
|
config[:testplans][plan].each do |tplan|
|
23
25
|
envarr = {}
|
24
26
|
config[:platforms][tplan].each do | k,v|
|
@@ -27,19 +29,44 @@ module Testplan
|
|
27
29
|
|
28
30
|
envstring = make_env_string(envarr)
|
29
31
|
|
30
|
-
|
31
|
-
|
32
|
-
|
32
|
+
if execute_all_at_once
|
33
|
+
print "\nRunning all testcases at once with ENV: #{envstring}\n"
|
34
|
+
exec_string = "#{envstring}bundle exec rake #{format.to_s} SPEC_OPTS=\""
|
35
|
+
config[:platforms][tplan][:cases].each do | acase |
|
36
|
+
|
37
|
+
exec_string += " -e #{acase} "
|
38
|
+
print " - testcase #{acase}\n"
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
exec_string += "\""
|
33
43
|
exitcode = 1 unless system exec_string
|
44
|
+
|
45
|
+
else
|
46
|
+
config[:platforms][tplan][:cases].each do | acase |
|
47
|
+
|
48
|
+
exec_string = "#{envstring}bundle exec rake #{format.to_s} SPEC_OPTS=\"-e #{acase}\""
|
49
|
+
print "\nRunning testcase #{acase} with ENV: #{envstring}\n"
|
50
|
+
|
51
|
+
exitcode += 1 unless system exec_string
|
52
|
+
end
|
53
|
+
|
34
54
|
end
|
35
55
|
end
|
36
56
|
|
37
|
-
if exitcode
|
38
|
-
|
57
|
+
if exitcode == 1
|
58
|
+
raise 'At least one test failed'
|
59
|
+
elsif exitcode > 1
|
60
|
+
raise "There were #{exitcode} failed tests."
|
39
61
|
end
|
40
62
|
|
41
63
|
return exitcode
|
64
|
+
end
|
42
65
|
|
66
|
+
def self.validate_plan_name(config, plan_name)
|
67
|
+
if !config[:testplans].has_key?(plan_name)
|
68
|
+
raise 'Plan name does not exist'
|
69
|
+
end
|
43
70
|
end
|
44
71
|
|
45
72
|
def self.make_env_string(envarr)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testplan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pim Snel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -97,7 +97,6 @@ files:
|
|
97
97
|
- Rakefile
|
98
98
|
- bin/testplan
|
99
99
|
- lib/tasks/rspec.rake
|
100
|
-
- lib/tasks/testlink.rake
|
101
100
|
- lib/tasks/testplan.rake
|
102
101
|
- lib/testplan.rb
|
103
102
|
- lib/testplan/version.rb
|
data/lib/tasks/testlink.rake
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
namespace :testlink do
|
2
|
-
desc 'run ci plan (for backwards compatibilty)'
|
3
|
-
task :plan_ci do
|
4
|
-
Rake::Task["testplan:build_ci"].invoke
|
5
|
-
end
|
6
|
-
|
7
|
-
desc 'run production plan (for backwards compatibilty)'
|
8
|
-
task :plan_production do
|
9
|
-
Rake::Task["testplan:build_production"].invoke
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|