Skip to content

Query Store - Silence the expected warnings of the system database tests - #10535

Merged
potatoqualitee merged 2 commits into
developmentfrom
fix-querystore-test-warnings
Aug 9, 2026
Merged

Query Store - Silence the expected warnings of the system database tests#10535
potatoqualitee merged 2 commits into
developmentfrom
fix-querystore-test-warnings

Conversation

@andreasjordan

Copy link
Copy Markdown
Collaborator

Follow-up to #10533, found by a full lab run of the merged branch.

The integration tests added by #10533 assert on their own -WarningVariable but never set
-WarningAction, so the warnings they expect still reach the warning stream. The run ended with
five warnings - three from Get-DbaDbQueryStoreOption, two from Set-DbaDbQueryStoreOption -
that all had to be traced back by hand before they could be dismissed as expected. That is the
noise the warning-free rule exists to prevent: the tests run without EnableException, so an
unexpected warning is the only signal that something went wrong inside a command, and that signal
is worth nothing while expected warnings print next to it.

Four calls now carry -WarningAction SilentlyContinue. The assertions are unchanged - the
warnings are still captured in the same -WarningVariable and still checked.

The two calls that are asserted not to warn deliberately stay unsilenced, so a regression still
shows up as an unexpected warning in the run.

Verified against SQL Server 2019 and 2025: Get-DbaDbQueryStoreOption 4/4 and
Set-DbaDbQueryStoreOption 8/8, with no warnings on the stream.

馃 Generated with Claude Code

andreasjordan and others added 2 commits August 8, 2026 17:18
The tests added by #10533 assert on their own -WarningVariable but never set
-WarningAction, so the warnings they expect still reach the warning stream. A
full lab run therefore ended with five warnings that all had to be checked by
hand before they could be dismissed as expected.

The two calls that are asserted not to warn stay unsilenced, so a regression
still shows up as an unexpected warning.

(do *QueryStore*)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@potatoqualitee

Copy link
Copy Markdown
Member

thank you kindly

@potatoqualitee
potatoqualitee merged commit 1f8d7a3 into development Aug 9, 2026
21 checks passed
@potatoqualitee
potatoqualitee deleted the fix-querystore-test-warnings branch August 9, 2026 05:38
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.

2 participants