swift/test
Matthew Oliver 00bfc425ce Add FakeStatsdClient to unit tests
Currently we simply mock calls in the FakeLogger for calls statsd calls,
and there are also some helper methods for counting and collating
metrics that were called. This Fakelogger is overloaded and doesn't
simulate the real world.
In real life we use a Statsdclient that is attached to the logger.

We've been in the situation where unit tests pass but the statsd client
stacktraces because we don't actually fake the statsdclient based off
the real one and let it's use its internal logic.

This patch creates a new FakeStatsdClient that is based off the real
one, this can then be used (like the real statsd client) and attached to
the FakeLogger.
There is quite a bit of churn in tests to make this work, because we now
have to looking into the fake statsd client to check the faked calls
made.
The FakeStatsdClient does everything the real one does, except overrides
the _send method and socket creation so no actual statsd metrics are
emitted.

Change-Id: I9cdf395e85ab559c2b67b0617f898ad2d6a870d4
2023-08-07 10:10:45 +01:00
..
cors s3api: Allow CORS preflights for pre-signed URLs 2021-07-14 10:52:12 -07:00
functional Fix handling of non-ASCII accounts 2023-06-13 15:28:41 -07:00
probe tests: Make dark data probe tests pass with sync_method = ssync 2023-05-17 15:25:22 -07:00
s3api Tolerate absolute-form request targets 2023-01-03 12:49:30 -08:00
unit Add FakeStatsdClient to unit tests 2023-08-07 10:10:45 +01:00
__init__.py Clean up some cruft 2023-01-19 12:56:08 -08:00
debug_logger.py Add FakeStatsdClient to unit tests 2023-08-07 10:10:45 +01:00
sample.conf fix s3api functional tests 2020-05-15 22:38:04 -07:00