Skip to content

CI: support test mode #2382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions soda-core/src/soda_core/common/env_config_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ def soda_core_telemetry_enabled(self) -> bool:
@property
def soda_core_telemetry_local_debug_mode(self) -> bool:
return strtobool(os.getenv("SODA_CORE_TELEMETRY_LOCAL_DEBUG_MODE", "false"))

@property
def soda_core_telemetry_test_mode(self) -> bool:
return strtobool(os.getenv("SODA_CORE_TELEMETRY_TEST_MODE", "false"))
9 changes: 4 additions & 5 deletions soda-core/src/soda_core/telemetry/soda_telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ class SodaTelemetry:
ENDPOINT = "https://collect.soda.io/v1/traces"
__instance = None

def __new__(cls, test_mode: bool = False):
def __new__(cls):
if cls.__instance is None:
cls.__instance = super().__new__(cls)
cls.__instance._initialize(test_mode=test_mode)
cls.__instance._initialize()
return cls.__instance

def _initialize(self, test_mode: bool):
def _initialize(self):
self.soda_config = EnvConfigHelper()

self.__send = self.soda_config.soda_core_telemetry_enabled
Expand All @@ -54,8 +54,7 @@ def _initialize(self, test_mode: bool):
}
)
)

if test_mode:
if self.soda_config.soda_core_telemetry_test_mode:
self.__setup_for_test()
else:
self.__setup()
Expand Down