Skip to content

Improve matcher tests#39603

Merged
ravenblackx merged 3 commits into
envoyproxy:mainfrom
ravenblackx:matcher_tests
May 29, 2025
Merged

Improve matcher tests#39603
ravenblackx merged 3 commits into
envoyproxy:mainfrom
ravenblackx:matcher_tests

Conversation

@ravenblackx

@ravenblackx ravenblackx commented May 22, 2025

Copy link
Copy Markdown
Contributor

Commit Message: Improve matcher tests
Additional Description: This is how gtests are supposed to work.

NOTE: please do not merge until #38726 is in, to avoid provoking a merge conflict on a PR that's already been embattled.

Before:

./test/common/matcher/test_utility.h:290: Failure
Expected equality of these values:
  result.on_match_->action_cb_().get()->getTyped<StringAction>()
    Which is: 40-byte object <80-BA 85-24 1A-5C 00-00 58-97 EB-3F B2-72 00-00 08-00 00-00 00-00 00-00 6E-6F 5F-6D 61-74 63-68 00-00 00-00 00-00 00-00>
  *stringValue(expected_value)
    Which is: 40-byte object <80-BA 85-24 1A-5C 00-00 18-97 EB-3F B2-72 00-00 0A-00 00-00 00-00 00-00 78-78 6E-6F 5F-6D 61-74 63-68 00-00 00-00 00-00>

After:

test/common/matcher/prefix_map_matcher_test.cc:44: Failure
Value of: result
Expected: has string action (matcher: "xxno_match")
  Actual: {match_state_=MatchComplete, on_match_={action_cb_={string_value="no_match"}}}

(Note, both failures actually are on line 44 of prefix_map_matcher_test, but only the "after" version says so.)

Risk Level: None, test-only.
Testing: Yes it is.
Docs Changes: n/a
Release Notes: n/a (unless we need a release note in case someone was using these test helpers in an external extension?)
Platform Specific Features: n/a

Signed-off-by: Raven Black <[email protected]>
@kyessenov

Copy link
Copy Markdown
Contributor

/wait for #38726

@ravenblackx
ravenblackx merged commit 0ece2dc into envoyproxy:main May 29, 2025
@ravenblackx
ravenblackx deleted the matcher_tests branch May 29, 2025 18:26
phlax pushed a commit that referenced this pull request May 29, 2025
Commit Message: Fix forward on a bad merge
Additional Description: Broke a test by adding it and changing the test
format at the same time. (#38986 + #39603)
Risk Level: None
Testing: Test-only
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

Signed-off-by: Raven Black <[email protected]>
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