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:
Genevieve Helsel 2020-03-03 14:53:38 -08:00 committed by Facebook Github Bot
parent 2bbc4e5043
commit 93d6f0a3e9
2 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -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")