From 5a1fab432fa86aa716a641883636db1776a3734e Mon Sep 17 00:00:00 2001 From: Jay Mundrawala Date: Mon, 15 Dec 2014 21:56:21 -0800 Subject: Adding appveyor.yml --- appveyor.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000000..24a1936bb4 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,32 @@ +version: "{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 -- cgit v1.2.1 From e811e4c4f0e60c6a2dcf73fd65ef5cef37bc2a74 Mon Sep 17 00:00:00 2001 From: Jay Mundrawala Date: Tue, 16 Dec 2014 09:09:20 -0800 Subject: More info more version --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 24a1936bb4..b9748c220b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: "{build}" +version: "master-{build}" os: Windows Server 2012 platform: -- cgit v1.2.1 From 032cfdcc0eb1f7ad634d3b766ff31f75ca165168 Mon Sep 17 00:00:00 2001 From: Jay Mundrawala Date: Mon, 15 Dec 2014 15:47:22 -0800 Subject: Fix broken powershell_script resource The powershell commands were not being guarded by our code that checks for for exit codes --- lib/chef/provider/powershell_script.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/chef/provider/powershell_script.rb b/lib/chef/provider/powershell_script.rb index 0e76cd1656..97f77ca491 100644 --- a/lib/chef/provider/powershell_script.rb +++ b/lib/chef/provider/powershell_script.rb @@ -87,6 +87,10 @@ EOH interpreter_flags end + + def code + @code + end end end end -- cgit v1.2.1 From e8c110d027134ab59346eb5de1e145930fb0d773 Mon Sep 17 00:00:00 2001 From: Jay Mundrawala Date: Mon, 15 Dec 2014 20:45:13 -0800 Subject: Allow execute unit tests to run on windows --- spec/unit/provider/execute_spec.rb | 1 + 1 file changed, 1 insertion(+) 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) -- cgit v1.2.1 From 5466700b0f782e85579c4141316efe5600ebb5f5 Mon Sep 17 00:00:00 2001 From: Jay Mundrawala Date: Tue, 16 Dec 2014 17:38:38 -0800 Subject: Disable broken registry_spec tests The registry_spec has been broken since we switched to rspec 3 :pending was running the tests, but expecting them to fail. There seems to be a bug where if there is a failure outside the test, in our case the before block was silently raising an exception accessing resource_name, the tests would fail as expected but rspec would return with an exit code of 1 --- spec/functional/resource/registry_spec.rb | 2 +- spec/spec_helper.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1 From 2e7ffaa7d83343379476fd353cb2f5a351ba090e Mon Sep 17 00:00:00 2001 From: Jay Mundrawala Date: Tue, 16 Dec 2014 22:13:27 -0800 Subject: Use attr_accessor for script resource provider --- lib/chef/provider/powershell_script.rb | 8 ++------ lib/chef/provider/script.rb | 5 ++++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/chef/provider/powershell_script.rb b/lib/chef/provider/powershell_script.rb index 97f77ca491..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 = <