mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 15:57:43 +03:00
use a NullTelemetryLogger during integration tests
Summary: I was looking in the `edenfs_events` table and saw that sandcastle was logging to this table. Rice was able to identify that the reason was because the integration tests were logging. So if we're on running integration tests, we should return a `NullTelemetryLogger`. The daemon currently does not log on sandcastle AFAIK. Reviewed By: simpkins Differential Revision: D20203556 fbshipit-source-id: e09175347631478cb366d4fa2c6092d976504dd8
This commit is contained in:
parent
2bbc4e5043
commit
93d6f0a3e9
@ -246,6 +246,9 @@ class EdenInstance:
|
||||
return logger
|
||||
|
||||
def _create_telemetry_logger(self) -> telemetry.TelemetryLogger:
|
||||
if "INTEGRATION_TEST" in os.environ:
|
||||
return telemetry.NullTelemetryLogger()
|
||||
|
||||
try:
|
||||
from eden.cli.facebook import scuba_telemetry
|
||||
|
||||
|
@ -82,6 +82,10 @@ class EdenTestCase(
|
||||
self.last_event = self.start
|
||||
self.system_hgrc: Optional[str] = None
|
||||
|
||||
# Set an environment variable to prevent telemetry logging
|
||||
# during integration tests
|
||||
os.environ["INTEGRATION_TEST"] = "1"
|
||||
|
||||
# Add a cleanup event just to log once the other cleanup
|
||||
# actions have completed.
|
||||
self.addCleanup(self.report_time, "clean up done")
|
||||
|
Loading…
Reference in New Issue
Block a user