Skip to content

Suppress warnings for filtered NotRun tests#1990

Draft
merill wants to merge 1 commit into
mainfrom
codex/suppress-notrun-name-warnings
Draft

Suppress warnings for filtered NotRun tests#1990
merill wants to merge 1 commit into
mainfrom
codex/suppress-notrun-name-warnings

Conversation

@merill

@merill merill commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Closes #1989

What changed

  • Suppress the generic missing-colon naming warning only when Pester marks a discovered test as NotRun.
  • Preserve conversion, IDs, titles, result details, counts, and report inclusion for those filtered tests.
  • Add focused regression coverage proving filtered NotRun tests remain quiet while malformed executed tests still warn.

Root cause

Pester discovers the full Maester suite before applying execution filters. ConvertTo-MtMaesterResult converted all discovered results and validated the TestId: TestTitle format before its NotRun handling. Inner test names such as Should pass all rules therefore produced one warning each even though they were filtered and never executed. In smoke run 30085246002 this generated 11,393 warnings while only MT.1068 was 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 failed
  • PowerShell parser checks for both changed files — passed
  • Invoke-ScriptAnalyzer for both changed files — no findings
  • git diff --check — passed

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b4a18679-ae46-470e-b550-1968676822ab

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/suppress-notrun-name-warnings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying maester with  Cloudflare Pages  Cloudflare Pages

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

View logs

$testId = $name.Substring(0, $titleStart).Trim()
$testTitle = $name.Substring($titleStart + 1).Trim()
} else {
} elseif ($test.Result -ne 'NotRun') {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suppress malformed-name warnings for filtered NotRun Pester tests

2 participants