fix: add the dogstatsd url validator call in dd url tests#143
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR strengthens the existing DD_URL / DD_DD_URL trailing-slash trimming unit tests by additionally validating that the trimmed URLs are accepted by dogstatsd’s strict prefix validators (DdUrl / DdDdUrl). This ensures the tests catch regressions where trimming behavior might still leave a value that the downstream validator rejects.
Changes:
- In the
DD_DD_URLtrailing-slash test, add adogstatsd::datadog::DdDdUrl::new(...)assertion to ensure the trimmed value passes strict URL-prefix validation. - In the
DD_URLtrailing-slash test, add adogstatsd::datadog::DdUrl::new(...)assertion for the same reason.
duncanista
approved these changes
Jul 7, 2026
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 #142, which trimmed trailing slashes from dd_url/url because dogstatsd's DdUrl/DdDdUrl reject a trailing slash with UrlPrefixError. The tests asserted that the trimmed string matched the expected value. This adds dogstatsd::datadog::DdDdUrl::new(...)/DdUrl::new(...) calls to the earlier unit tests, so the tests fail if trim_url ever regresses in a way that still gets rejected by the prefix validator, instead of only checking the trim behavior.