serverspec-runner 1.3.5 → 1.3.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2893b04d84f72c5c95f0e95d79cef06efaf6fa47e8fa5eb14ff9a975b8be0c03
4
- data.tar.gz: 8756b9568764c40af973bc75de8ee306a210e32e1bfd24b5ab5fe05992507076
3
+ metadata.gz: 95214931bd6fe3c15da86173962af41207536632933cf17b34b4de732e2c92e1
4
+ data.tar.gz: 9d37ddc59b12c92a0e11952898aab65fd7fe9ebadcf7d4b9b9084610cc435ae6
5
5
  SHA512:
6
- metadata.gz: edfd6470ed8e2e229c267a413e4da1eb10024a5389a7e37dab63bba41cb329c634847929b5c08b05416acc4fa469847d53dd1c08e8412eccb8bb3fcbbe2323c0
7
- data.tar.gz: 5d39179afce8b6a68004413e72fc288d313e3ff64701283e9b40fe8912592471519123aa002940213cc9157ce55730d7ef0f0eb92f039de71aa1f2d83eada636
6
+ metadata.gz: 1bdfe0bcc4ec3cdf22081217c055644f44511943a723f832b256d8940bc0d52faf68dbb327c65f6237b35774e2cfa30bac869c42f8b982bf9b9a77f9a78ed9fb
7
+ data.tar.gz: d8c155efdb66b9561c91128bf7ec4c2ab7fc53b995fb9db3ce6b940ae1dcfc99808dca7bd0b773ff2174f80bfaee6f76578a01677ece8c39c370c2433348b7d8
data/.travis.yml CHANGED
@@ -5,9 +5,10 @@ rvm:
5
5
  - 2.0.0
6
6
  - 2.1.5
7
7
  - 2.2.0
8
+ - 2.5.1
8
9
 
9
10
  before_install:
10
11
  - gem update bundler
11
12
 
12
13
  script:
13
- - bundle exec rake spec
14
+ - bundle exec rake spec -I
data/Rakefile CHANGED
@@ -213,6 +213,8 @@ namespace :spec do
213
213
  gen_exec_plan(nil, scenarios, [], ssh_options, tasks, platform)
214
214
 
215
215
  task :stdout do
216
+ ENV['is_example_error'] = 'true' if CSV.foreach(csv_file).any? { |c| c.size > 1 && c[1] == 'NG' }
217
+
216
218
  if ENV['tableformat'] == 'none'
217
219
  elsif ENV['tableformat'] == 'bool'
218
220
 
@@ -279,6 +281,10 @@ namespace :spec do
279
281
  end
280
282
  end
281
283
 
284
+ task :exit do
285
+ exit(1) if !ENV['ignore_error_exit'] && ENV['is_example_error']
286
+ end
287
+
282
288
  exec_tasks = []
283
289
  if ENV['parallels']
284
290
  processes = ENV['parallels'].to_i
@@ -302,6 +308,7 @@ namespace :spec do
302
308
  end
303
309
 
304
310
  exec_tasks << :stdout
311
+ exec_tasks << :exit
305
312
  task :all => exec_tasks
306
313
 
307
314
  # tempファイルに書き出し
@@ -11,20 +11,21 @@ raketask = 'spec'
11
11
  showtasks = false
12
12
 
13
13
  opts = GetoptLong.new(
14
- ["--scenario", "-s", GetoptLong::REQUIRED_ARGUMENT],
15
- ["--inventory", "-i", GetoptLong::REQUIRED_ARGUMENT],
16
- ["--specroot", "-r", GetoptLong::REQUIRED_ARGUMENT],
17
- ["--ssh_options", "-o", GetoptLong::REQUIRED_ARGUMENT],
18
- ["--explain", "-e", GetoptLong::REQUIRED_ARGUMENT],
19
- ["--tableformat", "-t", GetoptLong::REQUIRED_ARGUMENT],
20
- ["--parallel", "-p", GetoptLong::REQUIRED_ARGUMENT],
21
- ["--pattern", "-P", GetoptLong::REQUIRED_ARGUMENT],
22
- ["--exclude-pattern", "-E", GetoptLong::REQUIRED_ARGUMENT],
23
- ["--version", "-v", GetoptLong::NO_ARGUMENT],
24
- ["--help", "-h", GetoptLong::NO_ARGUMENT],
25
- ["--raketask", "-1", GetoptLong::REQUIRED_ARGUMENT],
26
- ["--tmpdir", "-2", GetoptLong::REQUIRED_ARGUMENT],
27
- ["--tasks", "-T", GetoptLong::NO_ARGUMENT]
14
+ ["--scenario", "-s", GetoptLong::REQUIRED_ARGUMENT],
15
+ ["--inventory", "-i", GetoptLong::REQUIRED_ARGUMENT],
16
+ ["--specroot", "-r", GetoptLong::REQUIRED_ARGUMENT],
17
+ ["--ssh_options", "-o", GetoptLong::REQUIRED_ARGUMENT],
18
+ ["--explain", "-e", GetoptLong::REQUIRED_ARGUMENT],
19
+ ["--tableformat", "-t", GetoptLong::REQUIRED_ARGUMENT],
20
+ ["--parallel", "-p", GetoptLong::REQUIRED_ARGUMENT],
21
+ ["--pattern", "-P", GetoptLong::REQUIRED_ARGUMENT],
22
+ ["--exclude-pattern", "-E", GetoptLong::REQUIRED_ARGUMENT],
23
+ ["--ignore-error-exit", "-I", GetoptLong::NO_ARGUMENT],
24
+ ["--version", "-v", GetoptLong::NO_ARGUMENT],
25
+ ["--help", "-h", GetoptLong::NO_ARGUMENT],
26
+ ["--raketask", "-1", GetoptLong::REQUIRED_ARGUMENT],
27
+ ["--tmpdir", "-2", GetoptLong::REQUIRED_ARGUMENT],
28
+ ["--tasks", "-T", GetoptLong::NO_ARGUMENT]
28
29
  )
29
30
 
30
31
  opts.each do |opt, arg|
@@ -47,6 +48,8 @@ opts.each do |opt, arg|
47
48
  ENV['pattern'] = arg
48
49
  when '--exclude-pattern'
49
50
  ENV['exclude_pattern'] = arg
51
+ when '--ignore-error-exit'
52
+ ENV['ignore_error_exit'] = 'true'
50
53
  when '--tmpdir'
51
54
  ENV['tmpdir'] = arg
52
55
  when '--raketask'
@@ -58,18 +61,19 @@ opts.each do |opt, arg|
58
61
  exit 0
59
62
  else
60
63
  puts "Usage: serverspec-runner (options)"
61
- puts "-s, --scenario SCENARIO_FILE path to scenario yml file"
62
- puts "-i, --inventory INVENTORY_FILE path to ansible inventory yml file"
63
- puts "-r, --specroot SPEC_ROOT path to spec tests root dir"
64
- puts "-o, --ssh_options SSH_OPTIONS_FILE path to ssh options yml file"
65
- puts "-e, --explain (short|long) specify result explain length(default: short)"
66
- puts "-t, --tableformat (aa|mkd|csv|bool|none) specify result table type(default: aa)"
67
- puts "-T, --tasks display the tasks with descriptions(exec rake -T)"
68
- puts "-p, --parallel execute tasks in parallel"
69
- puts "-P, --pattern execute pattern in spec directory"
70
- puts "-1, --raketask RAKE_TASK_NAME execute specified rake task only(ex: spec:test::anyhost-01)"
71
- puts "-v, --version show version"
72
- puts "-h, --help show help"
64
+ puts "-s, --scenario SCENARIO_FILE path to scenario yml file"
65
+ puts "-i, --inventory INVENTORY_FILE path to ansible inventory yml file"
66
+ puts "-r, --specroot SPEC_ROOT path to spec tests root dir"
67
+ puts "-o, --ssh_options SSH_OPTIONS_FILE path to ssh options yml file"
68
+ puts "-e, --explain (short|long) specify result explain length(default: short)"
69
+ puts "-t, --tableformat (aa|mkd|csv|bool|none) specify result table type(default: aa)"
70
+ puts "-T, --tasks display the tasks with descriptions(exec rake -T)"
71
+ puts "-p, --parallel execute tasks in parallel"
72
+ puts "-P, --pattern execute pattern in spec directory"
73
+ puts "-I, --ignore-error-exit exit with 0 even on error"
74
+ puts "-1, --raketask RAKE_TASK_NAME execute specified rake task only(ex: spec:test::anyhost-01)"
75
+ puts "-v, --version show version"
76
+ puts "-h, --help show help"
73
77
  exit 0
74
78
  end
75
79
  end
@@ -1,3 +1,3 @@
1
1
  module ServerspecRunner
2
- VERSION = "1.3.5"
2
+ VERSION = "1.3.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverspec-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
4
+ version: 1.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - hiracy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-14 00:00:00.000000000 Z
11
+ date: 2018-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: serverspec
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
161
  version: '0'
162
162
  requirements: []
163
163
  rubyforge_project:
164
- rubygems_version: 2.7.7
164
+ rubygems_version: 2.7.6
165
165
  signing_key:
166
166
  specification_version: 4
167
167
  summary: simple execution framework for serverspec