diff options
author | Jaymala Sinha <jsinha@chef.io> | 2019-09-24 14:26:27 -0400 |
---|---|---|
committer | Jaymala Sinha <jsinha@chef.io> | 2019-09-26 13:42:31 -0400 |
commit | 63965c3f0706c23b6591aaed4eb78a65c2c02f76 (patch) | |
tree | ac1031812dd9d65ee0ecf3a132a917e033ca6fd2 | |
parent | db2aa50e937d17d3832fd2968857a194d1dd50d4 (diff) | |
download | chef-63965c3f0706c23b6591aaed4eb78a65c2c02f76.tar.gz |
Use windows privileged executor for functional tests
Signed-off-by: Jaymala Sinha <jsinha@chef.io>
-rw-r--r-- | .expeditor/verify.pipeline.yml | 9 | ||||
-rw-r--r-- | scripts/bk_tests/bk_win_functional.ps1 | 27 |
2 files changed, 28 insertions, 8 deletions
diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index 2a008cd6f3..2acb0453cd 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -206,14 +206,11 @@ steps: - label: "Functional Specs Windows :ruby: 2.6" commands: - - /workdir/scripts/bk_tests/bk_win_functional.ps1 + - scripts/bk_tests/bk_win_functional.ps1 expeditor: executor: - docker: - host_os: windows - environment: - - FORCE_FFI_YAJL=ext - - CHEF_LICENSE=accept-no-persist + windows: + privileged: true shell: ["powershell", "-Command"] - label: "Unit Specs Windows :ruby: 2.6" diff --git a/scripts/bk_tests/bk_win_functional.ps1 b/scripts/bk_tests/bk_win_functional.ps1 index c8d5dd40e4..3c6a4aade8 100644 --- a/scripts/bk_tests/bk_win_functional.ps1 +++ b/scripts/bk_tests/bk_win_functional.ps1 @@ -2,9 +2,32 @@ echo "--- system details" $Properties = 'Caption', 'CSName', 'Version', 'BuildType', 'OSArchitecture' Get-CimInstance Win32_OperatingSystem | Select-Object $Properties | Format-Table -AutoSize +# Install Chocolatey (and essentials) +echo "Installing chocolatey" +Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) +C:\ProgramData\Chocolatey\bin\refreshenv + +# +# Software Languages +# + +# Install Ruby + Devkit +$ErrorActionPreference = 'Stop' + +echo "Downloading Ruby + DevKit" +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +(New-Object System.Net.WebClient).DownloadFile('https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.4-1/rubyinstaller-devkit-2.6.4-1-x64.exe', 'c:\\rubyinstaller-devkit-2.6.4-1-x64.exe') + +echo "Installing Ruby + DevKit" +Start-Process c:\rubyinstaller-devkit-2.6.4-1-x64.exe -ArgumentList '/verysilent /dir=C:\\ruby26' -Wait + +echo "Cleaning up installation" +Remove-Item c:\rubyinstaller-devkit-2.6.4-1-x64.exe -Force +echo "Closing out the layer (this can take awhile)" + +$Env:path +=";C:\ruby26\bin" + winrm quickconfig -q -# Set-Item -Path Env:Path -Value ($Env:Path + ";C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin") -$Env:path="C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\ruby26\bin;C:\ci-studio-common\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Users\ContainerAdministrator\AppData\Local\Microsoft\WindowsApps;C:\Go\bin;C:\Users\ContainerAdministrator\go\bin" ruby -v bundle --version |