yyqdbngt opened a new pull request, #3775: URL: https://github.com/apache/rocketmq-dashboard/pull/3775
### Motivation The existing `NativeAlertRuleScopeMatcherTest` covers exact broker/cluster matching, wildcards and topic/group selectors, but the instance guard, fully-blank selectors, label-less samples and whitespace trimming remain untested. ### Changes - `requiresMatchingInstanceIdAndRejectsBlankRuleInstance`: a rule without a usable instance id never matches, and a different instance id is rejected even when all resources align. - `matchesWhenAllOptionalSelectorsAreBlank`: a rule scoped only to the instance matches any sample on that instance. - `emptyLabelsOnlyFailForRulesWithSelectors`: a label-less sample still matches when no resource selectors are set, and is rejected when a topic selector is configured. - `trimsSelectorsAndInstanceIdBeforeMatching`: surrounding whitespace on the instance id and resource selectors does not change the outcome. ### Verification ``` mvn -B test -Dtest=NativeAlertRuleScopeMatcherTest [INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0 [INFO] BUILD SUCCESS ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
