From 5849b4693dfb9d4f9315a3817f07f9e9e4b7c382 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Thu, 21 Apr 2022 14:28:54 +0530 Subject: [PATCH] added ruby 3.0/3.1 windows/linux image Signed-off-by: nikhil2611 --- .expeditor/run_windows_tests.ps1 | 16 ++++++++++ .expeditor/verify.pipeline.yml | 53 +++++++++++++++++++++++++++----- Rakefile | 5 +-- 3 files changed, 65 insertions(+), 9 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 000000000..bfa05ac59 --- /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 set --local without docs debug +bundle config set --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 spec +If ($lastexitcode -ne 0) { Exit $lastexitcode } \ No newline at end of file diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index 94af6519b..470fb9a48 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -10,22 +10,61 @@ expeditor: timeout_in_minutes: 30 steps: + - label: run-specs-ruby-2.7 command: - .expeditor/run_linux_tests.sh "rake spec" expeditor: executor: docker: - image: ruby:2.7-buster + image: ruby:2.7 + +- label: run-specs-ruby-3.0 + command: + - .expeditor/run_linux_tests.sh "rake spec" + expeditor: + executor: + docker: + image: ruby:3.0 + +- label: run-specs-ruby-3.1 + command: + - .expeditor/run_linux_tests.sh "rake spec" + expeditor: + executor: + docker: + image: ruby:3.1 + + +- label: run-specs-ruby-2.7-windows + command: + - .expeditor/run_windows_tests.ps1 + expeditor: + executor: + docker: + host_os: windows + shell: ["powershell", "-Command"] + image: rubydistros/windows-2019:2.7 + user: 'NT AUTHORITY\SYSTEM' + +- label: run-specs-ruby-3.0-windows + command: + - .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-windows +- label: run-specs-ruby-3.1-windows command: - - bundle config set --local without docs debug - - bundle config set --local path vendor/bundle - - bundle install --jobs=7 --retry=3 - - bundle exec rake spec + - .expeditor/run_windows_tests.ps1 expeditor: executor: docker: host_os: windows - image: rubydistros/windows-2019:2.7 \ No newline at end of file + shell: ["powershell", "-Command"] + image: rubydistros/windows-2019:3.1 + user: 'NT AUTHORITY\SYSTEM' \ No newline at end of file diff --git a/Rakefile b/Rakefile index c017665d0..057cc583a 100644 --- a/Rakefile +++ b/Rakefile @@ -3,8 +3,9 @@ require "bundler/gem_tasks" begin require "rspec/core/rake_task" - RSpec::Core::RakeTask.new do |t| - t.pattern = "spec/**/*_spec.rb" + RSpec::Core::RakeTask.new(:spec) do |t| + t.verbose = false + t.pattern = FileList["spec/**/*_spec.rb"] end rescue LoadError desc "rspec is not installed, this task is disabled"