From 0e69710f417dce418ca1e3b54ff448493b102c06 Mon Sep 17 00:00:00 2001 From: "John W. Parent" <45471568+johnwparent@users.noreply.github.com> Date: Fri, 9 Dec 2022 08:27:46 -0500 Subject: Windows: reenable unit tests (#33385) Unit tests on Windows are supposed to pass for any PR to pass CI. However, the return code for the unit test command was not being checked, which meant this check was always passing (effectively disabled). This PR * Properly checks the result of the unit tests and fails if the unit tests fail * Fixes (or disables on Windows) a number of tests which have "drifted" out of support on Windows since this check was effectively disabled --- share/spack/qa/setup_spack.ps1 | 3 --- share/spack/qa/setup_spack_installer.ps1 | 2 ++ share/spack/qa/validate_last_exit.ps1 | 3 +++ share/spack/qa/windows_test_setup.ps1 | 16 +++++----------- 4 files changed, 10 insertions(+), 14 deletions(-) delete mode 100644 share/spack/qa/setup_spack.ps1 create mode 100644 share/spack/qa/setup_spack_installer.ps1 create mode 100644 share/spack/qa/validate_last_exit.ps1 (limited to 'share') diff --git a/share/spack/qa/setup_spack.ps1 b/share/spack/qa/setup_spack.ps1 deleted file mode 100644 index 6b462916fa..0000000000 --- a/share/spack/qa/setup_spack.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -spack compiler find -echo F|xcopy .\spack\share\spack\qa\configuration\windows_config.yaml $env:USERPROFILE\.spack\windows\config.yaml -spack external find cmake \ No newline at end of file diff --git a/share/spack/qa/setup_spack_installer.ps1 b/share/spack/qa/setup_spack_installer.ps1 new file mode 100644 index 0000000000..f2acdcc50a --- /dev/null +++ b/share/spack/qa/setup_spack_installer.ps1 @@ -0,0 +1,2 @@ +spack compiler find +spack external find cmake \ No newline at end of file diff --git a/share/spack/qa/validate_last_exit.ps1 b/share/spack/qa/validate_last_exit.ps1 new file mode 100644 index 0000000000..c8a9f7f5be --- /dev/null +++ b/share/spack/qa/validate_last_exit.ps1 @@ -0,0 +1,3 @@ +if ($LASTEXITCODE -ne 0){ + throw "Unit Tests have failed" +} \ No newline at end of file diff --git a/share/spack/qa/windows_test_setup.ps1 b/share/spack/qa/windows_test_setup.ps1 index a7e3c66ea3..2e25d95960 100644 --- a/share/spack/qa/windows_test_setup.ps1 +++ b/share/spack/qa/windows_test_setup.ps1 @@ -1,11 +1,5 @@ -Set-Location ../ - -$env:python_pf_ver="C:\hostedtoolcache\windows\Python\3.9.5\x64\python.exe" - -cmd /c "`"spack\bin\spack_cmd.bat`" print " | -foreach { - if ($_ -match "=") { - $v = $_.split("=") - [Environment]::SetEnvironmentVariable($v[0], $v[1]) - } -} +$ErrorActionPreference = "SilentlyContinue" +Write-Output F|xcopy .\share\spack\qa\configuration\windows_config.yaml $env:USERPROFILE\.spack\windows\config.yaml +# The line below prevents the _spack_root symlink from causing issues with cyclic symlinks on Windows +(Get-Item '.\lib\spack\docs\_spack_root').Delete() +./share/spack/setup-env.ps1 \ No newline at end of file -- cgit v1.2.3-70-g09d2