onceover 3.11.0 → 3.11.1

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
  SHA256:
3
- metadata.gz: 71d240d281209575819137b3b4a0d8128d049d8df9482bc679f2915107f74a40
4
- data.tar.gz: add61e481be9978f6dc492eb351d0f3b43d248119d3b94b98132c7323495e52a
3
+ metadata.gz: 0de0a768f2e22ad3164a270df1a526f814f6ddc21e8333cebca698e55cab3425
4
+ data.tar.gz: f1eca8504701aaedd2a84b5e949ad3defd013a190014f2276d93bde738216d2b
5
5
  SHA512:
6
- metadata.gz: ea96a764d79607406e3c89fd0aea91b568c70902ba88b1d30cc7cf2619eb7a204a43764dd12abc74cca7cf25ad5d79dcd18e0dd02ad3a2689b6e9363b1db4d4e
7
- data.tar.gz: d35d26e20dbc980b22775784e1a3945c0251cf2f554fc320ae3ce24ed113d39c21b25aec37353e5d177e29ea0c47a3d7ddf7af16e305e2a36f8e7295239e68bd
6
+ metadata.gz: d06d28ae8e4bf7065ed9a25caa4b9f98dcab8fd5f825c84dccc501bce4274752cd35590b44d8c245b314b6b023f552a6a1adab0a084d9d2a109178b97df1baf5
7
+ data.tar.gz: 6bf9cb7ca6c63c9557e433e597e73b0e7a8c0c9cb1dda28552ca9fce366d6ecfff01c36854e34fe300b392c0d6ca91817f513bcb056ce2332d33d10c36441da9
@@ -52,6 +52,12 @@ Feature: Run rspec and acceptance test suites
52
52
  When I run onceover command "run spec" with class "role::test_new_functions"
53
53
  Then I should not see any errors
54
54
 
55
+ Scenario: Running tests that fail to compile
56
+ Given control repo "function_mocking"
57
+ When I run onceover command "run spec" with class "role::fail"
58
+ Then I should see message pattern "failed"
59
+ And Onceover should exit 1
60
+
55
61
  # This test is a full test using my controlrepo. It should remain at the end because it takes ages
56
62
  Scenario: Run advanced spec tests
57
63
  Given control repo "puppet_controlrepo"
@@ -51,6 +51,10 @@ Then(/^I should not see any errors$/) do
51
51
  expect(@cmd.success?).to be true
52
52
  end
53
53
 
54
+ Then(/^Onceover should exit (\d+)$/) do |code|
55
+ expect(@cmd.exit_code).to eq code.to_i
56
+ end
57
+
54
58
  Then(/^I should see error with message pattern "([^"]*)"$/) do |err_msg_regexp|
55
59
  expect(@cmd.success?).to be false
56
60
  puts @cmd.output
@@ -18,6 +18,10 @@ class Command_Helper
18
18
  return @result.success?
19
19
  end
20
20
 
21
+ def exit_code
22
+ @result.exitstatus
23
+ end
24
+
21
25
  def generate_command
22
26
  controlrepo_param = @controlrepo ? "--path #{File.expand_path(@controlrepo.root_folder)}" : ''
23
27
  return "#{@executable} #{@command} #{controlrepo_param}"
@@ -79,10 +79,10 @@ class Onceover
79
79
  #`bin/rake spec_standalone`
80
80
  if @config.opts[:parallel]
81
81
  logger.debug "Running #{@command_prefix}rake parallel_spec from #{@repo.tempdir}"
82
- Backticks::Runner.new(interactive:true).run(@command_prefix.strip.split, 'rake', 'parallel_spec').join
82
+ result = Backticks::Runner.new(interactive:true).run(@command_prefix.strip.split, 'rake', 'parallel_spec').join
83
83
  else
84
84
  logger.debug "Running #{@command_prefix}rake spec_standalone from #{@repo.tempdir}"
85
- Backticks::Runner.new(interactive:true).run(@command_prefix.strip.split, 'rake', 'spec_standalone').join
85
+ result = Backticks::Runner.new(interactive:true).run(@command_prefix.strip.split, 'rake', 'spec_standalone').join
86
86
  end
87
87
  # TODO: Refactor this to be much nicer
88
88
  if @config.formatters.include? 'FailureCollector'
@@ -94,6 +94,9 @@ class Onceover
94
94
  puts 'No failures detected'
95
95
  end
96
96
  end
97
+
98
+ # Finally exit and preserve the exit code
99
+ exit result.status.exitstatus
97
100
  end
98
101
  end
99
102
 
@@ -104,8 +107,11 @@ class Onceover
104
107
  #`bundle install --binstubs`
105
108
  #`bin/rake spec_standalone`
106
109
  logger.debug "Running #{@command_prefix}rake acceptance from #{@repo.tempdir}"
107
- Backticks::Runner.new(interactive:true).run(@command_prefix.strip.split, 'rake', 'acceptance').join
110
+ result = Backticks::Runner.new(interactive:true).run(@command_prefix.strip.split, 'rake', 'acceptance').join
108
111
  end
112
+
113
+ # Finally exit and preserve the exit code
114
+ exit result.status.exitstatus
109
115
  end
110
116
  end
111
117
  end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "onceover"
7
- s.version = "3.11.0"
7
+ s.version = "3.11.1"
8
8
  s.authors = ["Dylan Ratcliffe"]
9
9
  s.email = ["dylan.ratcliffe@puppet.com"]
10
10
  s.homepage = "https://github.com/dylanratcliffe/onceover"
@@ -0,0 +1,7 @@
1
+ # Class: role::fail
2
+ #
3
+ #
4
+ class role::fail {
5
+ user ( derp, this is not valid )
6
+ how do Puppet?
7
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onceover
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.11.0
4
+ version: 3.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Ratcliffe
@@ -411,6 +411,7 @@ files:
411
411
  - spec/fixtures/controlrepos/function_mocking/site/profile/functions/fail_puppet.pp
412
412
  - spec/fixtures/controlrepos/function_mocking/site/profile/lib/puppet/functions/profile/fail_ruby.rb
413
413
  - spec/fixtures/controlrepos/function_mocking/site/profile/manifests/base.pp
414
+ - spec/fixtures/controlrepos/function_mocking/site/role/manifests/fail.pp
414
415
  - spec/fixtures/controlrepos/function_mocking/site/role/manifests/test_data_return.pp
415
416
  - spec/fixtures/controlrepos/function_mocking/site/role/manifests/test_new_functions.pp
416
417
  - spec/fixtures/controlrepos/function_mocking/spec/onceover.yaml