Query Store - Silence the expected warnings of the system database tests - #10535
Merged
Conversation
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>
Member
|
thank you kindly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #10533, found by a full lab run of the merged branch.
The integration tests added by #10533 assert on their own
-WarningVariablebut never set-WarningAction, so the warnings they expect still reach the warning stream. The run ended withfive warnings - three from
Get-DbaDbQueryStoreOption, two fromSet-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 anunexpected 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 - thewarnings are still captured in the same
-WarningVariableand 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-DbaDbQueryStoreOption4/4 andSet-DbaDbQueryStoreOption8/8, with no warnings on the stream.馃 Generated with Claude Code