summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan McLellan <btm@loftninjas.org>2014-12-17 12:12:49 -0500
committerBryan McLellan <btm@loftninjas.org>2014-12-17 12:12:49 -0500
commit0b27affcdb9145b3bd133948bab0b38fb7481a0c (patch)
tree0a71f9353cfaee3458fcb7bbd125b4a1f6f985e4
parent34a8affc37f80e6a742dbe8a130513897e6512a8 (diff)
parent2e7ffaa7d83343379476fd353cb2f5a351ba090e (diff)
downloadchef-11.18.0.r.tar.gz
Merge pull request #2661 from opscode/btm/appveyor11.18.0.r
Combination of all current PRs against master to get appveyor passing. Closes #2655, #2653, #2644, #2670.
-rw-r--r--appveyor.yml32
-rw-r--r--lib/chef/provider/powershell_script.rb4
-rw-r--r--lib/chef/provider/script.rb5
-rw-r--r--spec/functional/resource/registry_spec.rb2
-rw-r--r--spec/spec_helper.rb1
-rw-r--r--spec/unit/provider/execute_spec.rb1
6 files changed, 41 insertions, 4 deletions
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000000..b9748c220b
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,32 @@
+version: "master-{build}"
+
+os: Windows Server 2012
+platform:
+ - x64
+
+environment:
+ matrix:
+ - ruby_version: "200"
+
+clone_folder: c:\projects\chef
+clone_depth: 1
+skip_tags: true
+branches:
+ only:
+ - master
+ - 12-stable
+
+install:
+ - winrm quickconfig -q
+ - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
+ - echo %PATH%
+ - ruby --version
+ - gem --version
+ - gem install bundler --quiet --no-ri --no-rdoc
+ - bundler --version
+
+build_script:
+ - bundle install
+
+test_script:
+ - bundle exec rake spec
diff --git a/lib/chef/provider/powershell_script.rb b/lib/chef/provider/powershell_script.rb
index 0e76cd1656..96955f73b6 100644
--- a/lib/chef/provider/powershell_script.rb
+++ b/lib/chef/provider/powershell_script.rb
@@ -43,7 +43,7 @@ class Chef
code.to_s +
EXIT_STATUS_NORMALIZATION_SCRIPT )
convert_boolean_return = @new_resource.convert_boolean_return
- @code = <<EOH
+ self.code = <<EOH
new-variable -name interpolatedexitcode -visibility private -value $#{convert_boolean_return}
new-variable -name chefscriptresult -visibility private
$chefscriptresult = {
@@ -52,7 +52,7 @@ $chefscriptresult = {
if ($interpolatedexitcode -and $chefscriptresult.gettype().name -eq 'boolean') { exit [int32](!$chefscriptresult) } else { exit 0 }
EOH
Chef::Log.debug("powershell_script provider called with script code:\n\n#{code}\n")
- Chef::Log.debug("powershell_script provider will execute transformed code:\n\n#{@code}\n")
+ Chef::Log.debug("powershell_script provider will execute transformed code:\n\n#{self.code}\n")
end
public
diff --git a/lib/chef/provider/script.rb b/lib/chef/provider/script.rb
index ea286cb0e4..e8b5235b7a 100644
--- a/lib/chef/provider/script.rb
+++ b/lib/chef/provider/script.rb
@@ -32,10 +32,13 @@ class Chef
provides :ruby
provides :script
- def_delegators :@new_resource, :code, :interpreter, :flags
+ def_delegators :@new_resource, :interpreter, :flags
+
+ attr_accessor :code
def initialize(new_resource, run_context)
super
+ self.code = new_resource.code
end
def command
diff --git a/spec/functional/resource/registry_spec.rb b/spec/functional/resource/registry_spec.rb
index d3120ac77c..f112ad9b00 100644
--- a/spec/functional/resource/registry_spec.rb
+++ b/spec/functional/resource/registry_spec.rb
@@ -40,7 +40,7 @@ describe Chef::Resource::RegistryKey, :unix_only do
end
end
-describe Chef::Resource::RegistryKey, :windows_only, :pending => "Refactor helper methods" do
+describe Chef::Resource::RegistryKey, :windows_only, :broken => true do
# parent and key must be single keys, not paths
let(:parent) { 'Opscode' }
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index b155e6da24..995be5060b 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -141,6 +141,7 @@ RSpec.configure do |config|
config.filter_run_excluding :openssl_lt_101 => true unless openssl_lt_101?
config.filter_run_excluding :ruby_lt_20 => true unless ruby_lt_20?
config.filter_run_excluding :aes_256_gcm_only => true unless aes_256_gcm?
+ config.filter_run_excluding :broken => true
running_platform_arch = `uname -m`.strip
diff --git a/spec/unit/provider/execute_spec.rb b/spec/unit/provider/execute_spec.rb
index 794994533e..51305b6225 100644
--- a/spec/unit/provider/execute_spec.rb
+++ b/spec/unit/provider/execute_spec.rb
@@ -39,6 +39,7 @@ describe Chef::Provider::Execute do
let(:new_resource) { Chef::Resource::Execute.new("foo_resource", run_context) }
before do
+ allow(Chef::Platform).to receive(:windows?) { false }
@original_log_level = Chef::Log.level
Chef::Log.level = :info
allow(STDOUT).to receive(:tty?).and_return(true)