summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpoornima <poorndm@progress.com>2022-04-04 10:20:47 +0530
committerJohn McCrae <jmccrae@chf.io>2022-04-04 10:31:35 -0700
commit526a1257995fe983af0a947ba2bc754f025886cd (patch)
tree85e9558022db22018261267069786117685b2a01
parentdc5343e01dfde638f4d46a31b95355d1f593fd55 (diff)
downloadmixlib-shellout-526a1257995fe983af0a947ba2bc754f025886cd.tar.gz
Use .expeditor/run_windows_tests.ps1 and 'NT AUTHORITY\SYSTEM' user
Signed-off-by: poornima <poorndm@progress.com>
-rw-r--r--.expeditor/run_windows_tests.ps117
-rw-r--r--.expeditor/verify.pipeline.yml3
-rw-r--r--spec/mixlib/shellout_spec.rb2
3 files changed, 20 insertions, 2 deletions
diff --git a/.expeditor/run_windows_tests.ps1 b/.expeditor/run_windows_tests.ps1
new file mode 100644
index 0000000..324fd9d
--- /dev/null
+++ b/.expeditor/run_windows_tests.ps1
@@ -0,0 +1,17 @@
+# 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 0035a0b..51a69a6 100644
--- a/.expeditor/verify.pipeline.yml
+++ b/.expeditor/verify.pipeline.yml
@@ -53,10 +53,11 @@ steps:
- label: run-specs-ruby-3.1-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.1
+ user: 'NT AUTHORITY\SYSTEM'
diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb
index dce47dd..a2dd56c 100644
--- a/spec/mixlib/shellout_spec.rb
+++ b/spec/mixlib/shellout_spec.rb
@@ -1167,7 +1167,7 @@ describe Mixlib::ShellOut do
context "and child processes should be killed" do
it "kills the child processes" do
expect(shell_cmd).to receive(:kill_process) do |instance|
- expect(instance.wmi_ole_object.Name).to match(/powershell/)
+ expect(instance.wmi_ole_object.Name).to match(/powershell.exe/)
Process.kill(:KILL, instance.wmi_ole_object.processid)
end
expect { executed_cmd }.to raise_error(Mixlib::ShellOut::CommandTimeout)