Adds a diff in tests between the expected metric and the closest found match.
Example output:
E AssertionError: Needed exactly 1 candidates for 'mysql.can_connect', got 0
E Expected:
E ServiceCheckStub(check_id=None, name='mysql.can_connect', status=1, tags=['dd.internal.resource:database_instance:stubbed.hostname1', 'port:213306'], hostname=None, message=None)
E Difference to closest:
E Expected status: 1
E Found 0
E Expected tag dd.internal.resource:database_instance:stubbed.hostname1
E Found dd.internal.resource:database_instance:stubbed.hostname
E Expected tag port:213306
E Found port:13306
E
E Similar submitted:
E Score Most similar
E 0.80 ServiceCheckStub(check_id='', name='mysql.can_connect', status=0, tags=['dd.internal.resource:database_instance:stubbed.hostname', 'port:13306'], hostname='stubbed.hostname', message='')
Motivation
It can be challenging to spot the difference between an expected and a found element. Adding an explicit diff to the closest match can help.
Review checklist (to be filled by reviewers)
[ ] Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
[x] Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
[ ] If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged
What does this PR do?
Adds a diff in tests between the expected metric and the closest found match.
Example output:
Motivation
It can be challenging to spot the difference between an expected and a found element. Adding an explicit diff to the closest match can help.
Review checklist (to be filled by reviewers)
qa/skip-qa
label if the PR doesn't need to be tested during QA.backport/<branch-name>
label to the PR and it will automatically open a backport PR once this one is merged