Stop tests from sending telemetry to logfire
telemetry.configure() passes send_to_logfire="if-token-present", so on a machine with a logfire token the CLI tests configured a live exporter: spans and the periodic metrics export went to the developer's project, and where the export fired while a cassette was open, VCR rejected it with CannotOverwriteExistingCassetteException in record mode none. A token resolves from LOGFIRE_TOKEN or from logfire_credentials.json under LOGFIRE_CREDENTIALS_DIR (default .logfire, relative to the working directory), so an authenticated developer uploads with the variable unset. conftest drops the variable and points credentials discovery at an empty temporary directory, alongside the existing HAIKU_RAG_CONFIG_PATH setup and before any haiku.rag import. The explicit send_to_logfire argument beats LOGFIRE_SEND_TO_LOGFIRE, so denying the token is what disables the exporter.
This commit is contained in:
parent
a18bfd9781
commit
4290111333
1 changed files with 6 additions and 0 deletions
|
|
@ -21,6 +21,12 @@ embeddings:
|
|||
""")
|
||||
os.environ["HAIKU_RAG_CONFIG_PATH"] = str(_test_config_path)
|
||||
|
||||
# telemetry.configure() passes send_to_logfire="if-token-present" explicitly,
|
||||
# which beats LOGFIRE_SEND_TO_LOGFIRE, so no token must resolve: drop the
|
||||
# environment variable and point credentials discovery at an empty directory.
|
||||
os.environ.pop("LOGFIRE_TOKEN", None)
|
||||
os.environ["LOGFIRE_CREDENTIALS_DIR"] = tempfile.mkdtemp()
|
||||
|
||||
import pydantic_ai.models # noqa: E402
|
||||
import pytest # noqa: E402
|
||||
import yaml # noqa: E402
|
||||
|
|
|
|||
Loading…
Reference in a new issue