Skip to content

Commit

Permalink
Testing that the basic live-output test execution also causes expecte…
Browse files Browse the repository at this point in the history
…d ErrorDuringSetupShouldHaltTest errrors to appear
  • Loading branch information
Piedone committed Nov 15, 2022
1 parent 82a5323 commit 0eeda56
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions .github/actions/test-dotnet/Invoke-SolutionTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,12 @@ $tests = dotnet sln list |
Select-String "\.Tests\." |
Select-String -NotMatch "Lombiq.Tests.UI.csproj" |
Select-String -NotMatch "Lombiq.Tests.csproj" |
Where-Object {
? {
$result = dotnet test --no-restore --list-tests --verbosity $Verbosity $_ 2>&1 | Out-String -Width 9999
-not [string]::IsNullOrEmpty($result) -and $result.Contains("The following Tests are available")
}

foreach ($test in $tests) {
# This could benefit from grouping, above the level of the potential groups created by the tests (the Lombiq UI
# Testing Toolbox adds per-test groups too). However, there's # no nested grouping, see
# https://github.com/actions/runner/issues/1477. See the # c341ef145d2a0898c5900f64604b67b21d2ea5db commit for a
# nested grouping implementation.

$dotnetTestSwitches = @(
'--configuration', 'Release'
'--no-restore',
Expand All @@ -56,18 +51,13 @@ foreach ($test in $tests) {
$test
)

# Filtering is necessary for annoying messages coming from UI testing but only under Ubuntu. There are no actual
# errors.
dotnet test @dotnetTestSwitches 2>&1 |
Where-Object { $_ -notlike '*Connection refused [[]::ffff:127.0.0.1[]]*' -and $_ -notlike '*ChromeDriver was started successfully*' }
dotnet test @dotnetTestSwitches

if ($?)
{
Write-Output "Test successful: $test"
Write-Output "Test Successful: $test"
continue
}

Write-Output "Test failed: $test"

exit 100
}

0 comments on commit 0eeda56

Please sign in to comment.