Suppress warnings for filtered NotRun tests#1990
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
Deploying maester with
|
| Latest commit: |
108007d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://58271ade.maester.pages.dev |
| Branch Preview URL: | https://codex-suppress-notrun-name-w.maester.pages.dev |
| $testId = $name.Substring(0, $titleStart).Trim() | ||
| $testTitle = $name.Substring($titleStart + 1).Trim() | ||
| } else { | ||
| } elseif ($test.Result -ne 'NotRun') { |
There was a problem hiding this comment.
Just thinking "out loud" -- should this if/else block have a final else statement to cover edge cases as a best practice, or would that be unnecessary engineering?
Closes #1989
What changed
NotRun.NotRuntests remain quiet while malformed executed tests still warn.Root cause
Pester discovers the full Maester suite before applying execution filters.
ConvertTo-MtMaesterResultconverted all discovered results and validated theTestId: TestTitleformat before itsNotRunhandling. Inner test names such asShould pass all rulestherefore produced one warning each even though they were filtered and never executed. In smoke run 30085246002 this generated 11,393 warnings while onlyMT.1068was selected.User impact
Filtered smoke and targeted runs no longer flood Actions logs with misleading naming warnings. Malformed tests that actually execute continue to surface the warning, so the validation signal is retained.
Validation
Invoke-Pester -Path ./powershell/tests/functions/ConvertTo-MtMaesterResult.Tests.ps1 -Output Detailed— 3 passed, 0 failedInvoke-ScriptAnalyzerfor both changed files — no findingsgit diff --check— passed