diff options
author | Jaymala Sinha <jsinha@chef.io> | 2019-09-27 15:03:34 -0400 |
---|---|---|
committer | Jaymala Sinha <jsinha@chef.io> | 2019-09-27 15:03:34 -0400 |
commit | 9c3fe7b43ac95e0392bf62ef5930b117c7903ae1 (patch) | |
tree | 9f87f887e6dfbcc8da5180ce972c596131989ddc /scripts | |
parent | 2a98c165d1bd7dd5959c6e7b8d7d4699f6cb97c9 (diff) | |
download | chef-9c3fe7b43ac95e0392bf62ef5930b117c7903ae1.tar.gz |
Fix Windows Integration and Functional tests for BK
* Use default windows 2019 image
* Skip 8dot3name tests as default disabled on 2019
* Use windows privileged executor for functional tests
* Use windows docker image for chocolatey tests
Signed-off-by: Jaymala Sinha <jsinha@chef.io>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/bk_tests/bk_run_choco.ps1 | 15 | ||||
-rw-r--r-- | scripts/bk_tests/bk_win_functional.ps1 | 28 | ||||
-rw-r--r-- | scripts/bk_tests/bk_win_integration.ps1 | 8 |
3 files changed, 49 insertions, 2 deletions
diff --git a/scripts/bk_tests/bk_run_choco.ps1 b/scripts/bk_tests/bk_run_choco.ps1 new file mode 100644 index 0000000000..1d4b87a73a --- /dev/null +++ b/scripts/bk_tests/bk_run_choco.ps1 @@ -0,0 +1,15 @@ +echo "--- system details" +$Properties = 'Caption', 'CSName', 'Version', 'BuildType', 'OSArchitecture' +Get-CimInstance Win32_OperatingSystem | Select-Object $Properties | Format-Table -AutoSize + +choco --version +ruby -v +bundle --version + +echo "--- bundle install" +bundle install --jobs=3 --retry=3 --without omnibus_package docgen chefstyle + +echo "+++ bundle exec rspec chocolatey_package_spec" +bundle exec rspec spec/functional/resource/chocolatey_package_spec.rb + +exit $LASTEXITCODE
\ No newline at end of file diff --git a/scripts/bk_tests/bk_win_functional.ps1 b/scripts/bk_tests/bk_win_functional.ps1 index 06695ccd97..085f22e40c 100644 --- a/scripts/bk_tests/bk_win_functional.ps1 +++ b/scripts/bk_tests/bk_win_functional.ps1 @@ -1,13 +1,39 @@ echo "--- system details" $Properties = 'Caption', 'CSName', 'Version', 'BuildType', 'OSArchitecture' Get-CimInstance Win32_OperatingSystem | Select-Object $Properties | Format-Table -AutoSize + +# chocolatey functional tests fail so delete the chocolatey binary to avoid triggering them +Remove-Item -Path C:\ProgramData\chocolatey\bin\choco.exe -ErrorAction SilentlyContinue + +# +# 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)" + +# Set-Item -Path Env:Path -Value to include ruby26 +$Env:Path+=";C:\ruby26\bin" + +winrm quickconfig -q ruby -v bundle --version echo "--- bundle install" bundle install --jobs=3 --retry=3 --without omnibus_package docgen chefstyle -echo "+++ bundle exec rake" +echo "+++ bundle exec rake spec:functional" bundle exec rake spec:functional exit $LASTEXITCODE
\ No newline at end of file diff --git a/scripts/bk_tests/bk_win_integration.ps1 b/scripts/bk_tests/bk_win_integration.ps1 index c6cdd5e2b1..546a9fbb91 100644 --- a/scripts/bk_tests/bk_win_integration.ps1 +++ b/scripts/bk_tests/bk_win_integration.ps1 @@ -1,13 +1,19 @@ echo "--- system details" $Properties = 'Caption', 'CSName', 'Version', 'BuildType', 'OSArchitecture' Get-CimInstance Win32_OperatingSystem | Select-Object $Properties | Format-Table -AutoSize + +# 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" + +winrm quickconfig -q + ruby -v bundle --version echo "--- bundle install" bundle install --jobs=3 --retry=3 --without omnibus_package docgen chefstyle -echo "+++ bundle exec rake" +echo "+++ bundle exec rake spec:integration" bundle exec rake spec:integration exit $LASTEXITCODE
\ No newline at end of file |