testplan 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 037a992cc75ac85a66ba0d1f9314f2a022d34c52
4
- data.tar.gz: 4afb94608239a1f58c90a76785c1ec9826489490
3
+ metadata.gz: e86fe5f0204532eccc8b6f70555baddaa1a4c029
4
+ data.tar.gz: 081f80dae2908c8cfa72d62ebc9cdea37eccd16f
5
5
  SHA512:
6
- metadata.gz: 25c26db41b103301bc946beef39d6f775349924c1b686698fdeb5cc021bd7de4126998279bb3e134c6844617b86721b7b5cd072c95a89b30bdee6e38b34c7b54
7
- data.tar.gz: 122ce3606a04ab2c286fd06736ed82a308a14f69ebebd8d2edc3345332357f2e241b904ce74be2895112f345c67d94c58c54b14a6986a8c95350171cb4215758
6
+ metadata.gz: c614345131cd13a8d2722023f0a424c5e5a767f8628d978e8dce043dd0a995215afe2a7f3c569f324125dc083ac94b7fdd74c1aaf6b1382e1f4d664dd9a890bd
7
+ data.tar.gz: 772fd4c38ed6824a841bfc4995bb8b12ca4d8c0c41b5c8bd60c45e389da9e5ba6ee53b8e2d5673da6966438b73633d71d80d31140dbf152ab183ac044986fc71
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.0.4 2015-09-30 Pim
4
+ * Add rake task to run all cases at once
5
+ * remove testlink tasks
6
+ * simplify task names
7
+ * improve error reporting
8
+
3
9
  ## 0.0.3 2015-06-18 Pim
4
10
  * Raise when one test fails
5
11
 
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
@@ -62,6 +62,7 @@ class MyTestplan < Thor
62
62
  end
63
63
  output.render(outfile)
64
64
  end
65
+
65
66
  end
66
67
 
67
68
  MyTestplan.start(ARGV)
data/lib/tasks/rspec.rake CHANGED
@@ -1,6 +1,5 @@
1
1
  desc 'Build spec(s) with normal output'
2
2
  RSpec::Core::RakeTask.new(:normal) do |t|
3
- # t.rspec_opts = "--format documentation"
4
3
  t.pattern = '**/*_spec.rb'
5
4
  end
6
5
 
@@ -1,24 +1,25 @@
1
1
  task default: %w[testplan:build_ci]
2
2
  namespace :testplan do
3
3
 
4
- desc 'build continuious intergration plan'
5
- task :build_ci do
6
- Testplan::Build::plan_in_format :ci, :junit
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 'build production testplan'
10
- task :build_production do
11
- Testplan::Build::plan_in_format :production, :junit
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 'build plan by testplan name'
15
- task :build,[:testplan] do |t, args|
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 'build plan by testplan name, format documentation'
20
- task :build_fancy,[:testplan] do |t, args|
21
- Testplan::Build::plan_in_format args[:testplan].to_sym, :documentation
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
 
@@ -1,3 +1,3 @@
1
1
  module Testplan
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
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
- config[:platforms][tplan][:cases].each do | acase |
31
- exec_string = "#{envstring}bundle exec rake #{format.to_s} SPEC_OPTS=\"-e #{acase}\""
32
- print "\nRunning testcase #{acase} with ENV: #{envstring}\n"
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 > 0
38
- raise 'at least one test failed'
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.3
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-06-18 00:00:00.000000000 Z
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
@@ -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
-