statsdtest: Move mock statsd client for testing into its own package #2564
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.
What does this PR do?
Moves the mock statsd client for testing out of the
tracer
package and into its own internalstatsdtest
package.Motivation
The infrastructure for testing statsd metric submission / statsd client successes was internal and lived within the
tracer
package, in the ddtrace/tracer/metrics_test.go file. In developing valuable tests for the newStatsCarrier
type (PR), which supports the "sharing" of statsd metrics between contrib packages andtracer
package, we realized we needed access to this mock statsd client in non-tracer packages. Thus, the mock statsd client was made accessible to all packages within the repo by moving into its own internal package.Reviewer's Checklist
For Datadog employees:
@DataDog/security-design-and-guidance
.Unsure? Have a question? Request a review!