test: add option to disable `compare_stats`.
when running [failing] tests locally, extra stack traces from
`compare_stats` add unnecessary logs. add an option to disable them.
@@ -79,6 +79,7 @@ def pytest_addoption(parser: Parser) -> None:
help="Docker compose project name",
)
parser.addoption("--follow-local-logs", action="store_true", help="Follow local docker logs")
+ parser.addoption("--no-compare-stats", action="store_true", help="Disable usage stats check")
@pytest.fixture(scope="session", autouse=True)
@@ -98,6 +99,7 @@ def cluster_log_manager(request: SubRequest) -> Iterator[Optional[ClusterLogMana
det_version = request.config.getoption("--det-version")
follow_local_logs = request.config.getoption("--follow-local-logs")
compose_file = request.config.getoption("--compose-file")
+ compare_stats_enabled = not request.config.getoption("--no-compare-stats")
config.MASTER_SCHEME = master_scheme
config.MASTER_IP = master_host
@@ -117,6 +119,7 @@ def cluster_log_manager(request: SubRequest) -> Iterator[Optional[ClusterLogMana
# Yield `None` so that pytest handles the no log manager case correctly.
yield None
+ if compare_stats_enabled:
compare_stats()
