Fix LongExemplarAssert hasFilteredAttributesSatisfyingExactly to enforce exact attribute matching#8518
Draft
thswlsqls wants to merge 1 commit into
Conversation
…rce exact attribute matching
cdf0841 to
d95bcba
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8518 +/- ##
============================================
+ Coverage 78.77% 78.79% +0.02%
- Complexity 8579 8581 +2
============================================
Files 1009 1009
Lines 28993 28993
Branches 3599 3599
============================================
+ Hits 22839 22845 +6
+ Misses 5311 5306 -5
+ Partials 843 842 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes #8517
Description
LongExemplarAssert.hasFilteredAttributesSatisfyingExactly(AttributeAssertion...)delegated tohasFilteredAttributesSatisfying(the non-exact helper), so it did not reject extra filtered attributes.Iterableoverload (AssertUtil.assertAttributesExactly), matchingDoubleExemplarAssert.hasFilteredAttributesSatisfyingExactlyand the same-classIterableoverload.longGaugeFailurecases threw for other reasons and never exercised the exactness path.Testing done
MetricAssertionsTest.longGaugeFailureasserting a single filtered attribute on an exemplar that has nine; it must raiseAssertionError. Fails before the fix, passes after../gradlew :sdk:testing:check— passed (16 tests inMetricAssertionsTest).docs/apidiffsupdate.## Unreleased#### Testingentry inCHANGELOG.md(assertion now stricter; previously lax tests may newly fail).