Skip to content

Commit bae9b0c

Browse files
🪲 [Fix]: Don't count filtered tests as failed tests (#7)
## Description This pull request simplifies the test result handling logic in the `scripts/main.ps1` file by removing all checks and reporting related to tests that were "NotRun". The script now only considers passed, failed, and inconclusive tests when determining test failures and reporting errors. Test result handling simplification: * Removed all logic related to the `NotRun` test status, including the `$hasNotRunValue` variable, checks for `NotRun` in test failure conditions, and error reporting for tests that were not run. [[1]](diffhunk://#diff-dc2e5a659836b1b73abb03421c567f5018c2755677c4a0aa764cb26117b68011L117) [[2]](diffhunk://#diff-dc2e5a659836b1b73abb03421c567f5018c2755677c4a0aa764cb26117b68011L126-R125) [[3]](diffhunk://#diff-dc2e5a659836b1b73abb03421c567f5018c2755677c4a0aa764cb26117b68011L182-L185)
1 parent d9fbbed commit bae9b0c

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

scripts/main.ps1

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ foreach ($expected in $expectedTestSuites) {
114114
$hasPassedValue = $null -ne $result.Passed
115115
$hasFailedValue = $null -ne $result.Failed
116116
$hasInconclusiveValue = $null -ne $result.Inconclusive
117-
$hasNotRunValue = $null -ne $result.NotRun
118117

119118
$testFailure = (
120119
$result.Result -ne 'Passed' -or
@@ -123,8 +122,7 @@ foreach ($expected in $expectedTestSuites) {
123122
($hasTestsValue -and $result.Tests -eq 0) -or
124123
($hasPassedValue -and $hasTestsValue -and $result.Tests -gt 0 -and $result.Passed -eq 0) -or
125124
($hasFailedValue -and $result.Failed -gt 0) -or
126-
($hasInconclusiveValue -and $result.Inconclusive -gt 0) -or
127-
($hasNotRunValue -and $result.NotRun -gt 0)
125+
($hasInconclusiveValue -and $result.Inconclusive -gt 0)
128126
)
129127

130128
if ($testFailure) {
@@ -179,10 +177,6 @@ foreach ($expected in $expectedTestSuites) {
179177
$null = $failureReasons.Add("$($result.Inconclusive) tests were inconclusive in file: $($expected.Name)")
180178
}
181179

182-
if ($hasNotRunValue -and $result.NotRun -gt 0) {
183-
$null = $failureReasons.Add("$($result.NotRun) tests were not run in file: $($expected.Name)")
184-
}
185-
186180
foreach ($reason in $failureReasons) {
187181
Write-GitHubError $reason
188182
$totalErrors++

0 commit comments

Comments
 (0)