From 0650db3ee1d33df1c8cf80bf93a30cd623fb6800 Mon Sep 17 00:00:00 2001 From: poornima Date: Fri, 25 Feb 2022 22:27:08 +0530 Subject: Test Ruby 3.0/3.1 Signed-off-by: poornima Update Label and Code owners Signed-off-by: poornima Drop Ruby 2.4 Testing & Fix chefstyle issue Signed-off-by: poornima Fix bundle exec args Signed-off-by: poornima Modify bundle exec Signed-off-by: poornima Modified verify-pipeline - command Signed-off-by: poornima updated chefstyle Signed-off-by: poornima Add ruby 3.0/3.1 tests on windows Signed-off-by: poornima Offence corrected Signed-off-by: poornima --- .expeditor/run_windows_tests.ps1 | 16 +++++++++ .expeditor/verify.pipeline.yml | 50 +++++++++++++++++---------- .github/CODEOWNERS | 4 +-- lib/mixlib/authentication/signedheaderauth.rb | 2 +- mixlib-authentication.gemspec | 2 +- 5 files changed, 51 insertions(+), 23 deletions(-) create mode 100644 .expeditor/run_windows_tests.ps1 diff --git a/.expeditor/run_windows_tests.ps1 b/.expeditor/run_windows_tests.ps1 new file mode 100644 index 0000000..c37728b --- /dev/null +++ b/.expeditor/run_windows_tests.ps1 @@ -0,0 +1,16 @@ +# Stop script execution when a non-terminating error occurs +$ErrorActionPreference = "Stop" +# This will run ruby test on windows platform + +Write-Output "--- Bundle install" + +bundle config --local path vendor/bundle +If ($lastexitcode -ne 0) { Exit $lastexitcode } + +bundle install --jobs=7 --retry=3 +If ($lastexitcode -ne 0) { Exit $lastexitcode } + +Write-Output "--- Bundle Execute" + +bundle exec rake +If ($lastexitcode -ne 0) { Exit $lastexitcode } diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index 165dccc..416b41b 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -8,52 +8,64 @@ expeditor: steps: -- label: run-lint-and-specs-:ruby:-2.4 +- label: run-specs-:ruby:-2.5 command: - - .expeditor/run_linux_tests.sh rake + - .expeditor/run_linux_tests.sh rake spec expeditor: executor: docker: - image: ruby:2.4-buster + image: ruby:2.5 -- label: run-lint-and-specs-:ruby:-2.5 +- label: run-specs-:ruby:-2.6 command: - - .expeditor/run_linux_tests.sh rake + - .expeditor/run_linux_tests.sh rake spec expeditor: executor: docker: - image: ruby:2.5-buster + image: ruby:2.6 -- label: run-lint-and-specs-:ruby:-2.6 +- label: run-specs-:ruby:-2.7 command: - - .expeditor/run_linux_tests.sh rake + - .expeditor/run_linux_tests.sh rake spec expeditor: executor: docker: - image: ruby:2.6-buster + image: ruby:2.7 -- label: run-lint-and-specs-:ruby:-2.7 +- label: run-specs-:ruby:-3.0 command: - - .expeditor/run_linux_tests.sh rake + - .expeditor/run_linux_tests.sh rake spec expeditor: executor: docker: - image: ruby:2.7-buster + image: ruby:3.0 -- label: run-lint-and-specs-:ruby:-3.0 +- label: run-specs-:ruby:-3.1 command: - - .expeditor/run_linux_tests.sh rake + - .expeditor/run_linux_tests.sh rake spec expeditor: executor: docker: - image: ruby:3.0-buster + image: ruby:3.1 -- label: run-specs-windows +- label: run-specs-ruby-3.0-windows command: - - bundle config --local path vendor/bundle - - bundle install --jobs=7 --retry=3 - - bundle exec rake + - .expeditor/run_windows_tests.ps1 expeditor: executor: docker: host_os: windows + shell: ["powershell", "-Command"] + image: rubydistros/windows-2019:3.0 + user: 'NT AUTHORITY\SYSTEM' + +- label: run-specs-ruby-3.1-windows + command: + - .expeditor/run_windows_tests.ps1 + expeditor: + executor: + docker: + host_os: windows + shell: ["powershell", "-Command"] + image: rubydistros/windows-2019:3.1 + user: 'NT AUTHORITY\SYSTEM' diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 950afb7..36212ce 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,5 @@ # Order is important. The last matching pattern has the most precedence. -* @chef/chef-foundation-owners @chef/chef-foundation-approvers @chef/chef-foundation-reviewers -.expeditor/ @chef/jex-team +* @chef/chef-infra-reviewers @chef/chef-infra-approvers @chef/chef-infra-owners +.expeditor/ @chef/infra-packages *.md @chef/docs-team diff --git a/lib/mixlib/authentication/signedheaderauth.rb b/lib/mixlib/authentication/signedheaderauth.rb index dc2adf3..cfd7bfe 100644 --- a/lib/mixlib/authentication/signedheaderauth.rb +++ b/lib/mixlib/authentication/signedheaderauth.rb @@ -196,7 +196,7 @@ module Mixlib # TODO: tim 2009-12-28: It'd be nice to just remove this special case, # always sign the entire request body, using the expanded multipart # body in the case of a file being include. - @hashed_body ||= if file&.respond_to?(:read) + @hashed_body ||= if file.respond_to?(:read) digester.hash_file(file, digest) else digester.hash_string(body, digest) diff --git a/mixlib-authentication.gemspec b/mixlib-authentication.gemspec index 2bcf30e..a9d4ddd 100644 --- a/mixlib-authentication.gemspec +++ b/mixlib-authentication.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |s| s.author = "Chef Software, Inc." s.email = "info@chef.io" s.homepage = "https://github.com/chef/mixlib-authentication" - s.required_ruby_version = ">= 2.4" + s.required_ruby_version = ">= 2.5" s.files = %w{LICENSE} + Dir.glob("lib/**/*") s.require_paths = ["lib"] -- cgit v1.2.1