Enable all tests

This commit is contained in:
Vivian Thiebaut 2022-11-15 15:29:31 -05:00
parent fea0542d1f
commit 806eb63576
3 changed files with 65 additions and 67 deletions

View File

@ -200,20 +200,20 @@ function Invoke-OpenSSHTests
# ... # ...
# FixHostFilePermissions.ps1 # FixHostFilePermissions.ps1
# ... # ...
# Write-Verbose -Verbose -Message "Running Unit Tests..." Write-Verbose -Verbose -Message "Running Unit Tests..."
# Write-Verbose -Verbose -Message "Unit test directory is: ${OpenSSHBinPath}" Write-Verbose -Verbose -Message "Unit test directory is: ${OpenSSHBinPath}"
# $unitTestFailed = Invoke-OpenSSHUnitTest -UnitTestDirectory $OpenSSHBinPath $unitTestFailed = Invoke-OpenSSHUnitTest -UnitTestDirectory $OpenSSHBinPath
# if($unitTestFailed) if($unitTestFailed)
# { {
# Write-BuildMessage "At least one of the unit tests failed!" -Category Error Write-BuildMessage "At least one of the unit tests failed!" -Category Error
# $AllTestsPassed = $false $AllTestsPassed = $false
# } }
# else else
# { {
# Write-BuildMessage -Message "All Unit tests passed!" -Category Information Write-BuildMessage -Message "All Unit tests passed!" -Category Information
# } }
# Run all E2E tests. # Run all E2E tests.
Write-Verbose -Verbose -Message "Running E2E Tests..." Write-Verbose -Verbose -Message "Running E2E Tests..."
@ -239,62 +239,62 @@ function Invoke-OpenSSHTests
} }
} }
# # Bash tests. # Bash tests.
# Write-Verbose -Verbose -Message "Running Bash Tests..." Write-Verbose -Verbose -Message "Running Bash Tests..."
# # Ensure CygWin is installed, and install from Chocolatey if needed. # Ensure CygWin is installed, and install from Chocolatey if needed.
# $cygwinInstalled = $true $cygwinInstalled = $true
# $cygwinInstallLocation = "$env:SystemDrive/cygwin" $cygwinInstallLocation = "$env:SystemDrive/cygwin"
# if (! (Test-Path -Path "$cygwinInstallLocation/bin/sh.exe")) if (! (Test-Path -Path "$cygwinInstallLocation/bin/sh.exe"))
# { {
# Write-Verbose -Verbose -Message "CygWin not found" Write-Verbose -Verbose -Message "CygWin not found"
# Install-CygWin -InstallLocation $cygwinInstallLocation Install-CygWin -InstallLocation $cygwinInstallLocation
# # Hack to fix up mangled CygWin directory, if needed. # Hack to fix up mangled CygWin directory, if needed.
# $expectedCygWinPath = "$env:SystemDrive/cygwin/bin/sh.exe" $expectedCygWinPath = "$env:SystemDrive/cygwin/bin/sh.exe"
# if (! (Test-Path -Path $expectedCygWinPath)) if (! (Test-Path -Path $expectedCygWinPath))
# { {
# Write-Verbose -Verbose -Message "CygWin did not install correctly, missing expected path: ${expectedCygWinPath}" Write-Verbose -Verbose -Message "CygWin did not install correctly, missing expected path: ${expectedCygWinPath}"
# $cygWinDirs = Get-Item -Path "$env:SystemDrive/cygwin*" $cygWinDirs = Get-Item -Path "$env:SystemDrive/cygwin*"
# if ($cygWinDirs.Count -gt 1) if ($cygWinDirs.Count -gt 1)
# { {
# Write-Verbose -Verbose -Message "CygWin install failed with mangled folder locations: ${cygWinDirs}" Write-Verbose -Verbose -Message "CygWin install failed with mangled folder locations: ${cygWinDirs}"
# Write-Verbose -Verbose -Message 'TODO: Add hack to fix up CygWin folder.' Write-Verbose -Verbose -Message 'TODO: Add hack to fix up CygWin folder.'
# } }
# Write-BuildMessage -Message "All bash tests failed because CygWin install failed" -Category Error Write-BuildMessage -Message "All bash tests failed because CygWin install failed" -Category Error
# $AllTestsPassed = $false $AllTestsPassed = $false
# $cygwinInstalled = $false $cygwinInstalled = $false
# } }
# } }
# # Run UNIX bash tests. # Run UNIX bash tests.
# if ($cygwinInstalled) if ($cygwinInstalled)
# { {
# Write-Verbose -Verbose -Message "Starting Bash Tests..." Write-Verbose -Verbose -Message "Starting Bash Tests..."
# Invoke-OpenSSHBashTests Invoke-OpenSSHBashTests
# if (-not $Global:bash_tests_summary) if (-not $Global:bash_tests_summary)
# { {
# $errorMessage = "Failed to start OpenSSH bash tests" $errorMessage = "Failed to start OpenSSH bash tests"
# Write-BuildMessage -Message $errorMessage -Category Error Write-BuildMessage -Message $errorMessage -Category Error
# $AllTestsPassed = $false $AllTestsPassed = $false
# } }
# else else
# { {
# if ($Global:bash_tests_summary["TotalBashTestsFailed"] -ne 0) if ($Global:bash_tests_summary["TotalBashTestsFailed"] -ne 0)
# { {
# $total_bash_failed_tests = $Global:bash_tests_summary["TotalBashTestsFailed"] $total_bash_failed_tests = $Global:bash_tests_summary["TotalBashTestsFailed"]
# $total_bash_tests = $Global:bash_tests_summary["TotalBashTests"] $total_bash_tests = $Global:bash_tests_summary["TotalBashTests"]
# $errorMessage = "At least one of the bash tests failed. [$total_bash_failed_tests of $total_bash_tests]" $errorMessage = "At least one of the bash tests failed. [$total_bash_failed_tests of $total_bash_tests]"
# Write-BuildMessage -Message $errorMessage -Category Error Write-BuildMessage -Message $errorMessage -Category Error
# $AllTestsPassed = $false $AllTestsPassed = $false
# } }
# $OpenSSHTestInfo["BashTestSummaryFile"] = $Global:bash_tests_summary["BashTestSummaryFile"] $OpenSSHTestInfo["BashTestSummaryFile"] = $Global:bash_tests_summary["BashTestSummaryFile"]
# $OpenSSHTestInfo["BashTestLogFile"] = $Global:bash_tests_summary["BashTestLogFile"] $OpenSSHTestInfo["BashTestLogFile"] = $Global:bash_tests_summary["BashTestLogFile"]
# } }
# } }
# OpenSSH Uninstall Tests # OpenSSH Uninstall Tests
Invoke-OpenSSHUninstallTest Invoke-OpenSSHUninstallTest

View File

@ -689,10 +689,8 @@ function Invoke-OpenSSHE2ETest
# Discover all CI tests and run them. # Discover all CI tests and run them.
Push-Location $Script:E2ETestDirectory Push-Location $Script:E2ETestDirectory
Write-Log -Message "Running OpenSSH E2E tests..." Write-Log -Message "Running OpenSSH E2E tests..."
# $testFolders = @(Get-ChildItem *.tests.ps1 -Recurse | ForEach-Object{ Split-Path $_.FullName} | Sort-Object -Unique) $testFolders = @(Get-ChildItem *.tests.ps1 -Recurse | ForEach-Object{ Split-Path $_.FullName} | Sort-Object -Unique)
# Invoke-Pester $testFolders -OutputFormat NUnitXml -OutputFile $Script:E2ETestResultsFile -Tag $pri -PassThru Invoke-Pester $testFolders -OutputFormat NUnitXml -OutputFile $Script:E2ETestResultsFile -Tag $pri -PassThru
Invoke-Pester .\SSH.tests.ps1 -OutputFormat NUnitXml -OutputFile $Script:E2ETestResultsFile -Tag $pri -PassThru
Invoke-Pester .\ShellHost.tests.ps1 -OutputFormat NUnitXml -OutputFile $Script:E2ETestResultsFile -Tag $pri -PassThru
Pop-Location Pop-Location
} }

View File

@ -19,7 +19,7 @@ Enum PlatformType {
function Set-Platform { function Set-Platform {
# Use the .NET Core APIs to determine the current platform; if a runtime # Use the .NET Core APIs to determine the current platform; if a runtime
# exception is thrown, we are on FullCLR, not .NET Core. # exception is thrown, we are on FullCLR, not .NET Core.
if($IsOSX) { if($IsMacOS) {
[PlatformType]::OSX [PlatformType]::OSX
} elseif($IsLinux) { } elseif($IsLinux) {
[PlatformType]::Linux [PlatformType]::Linux