[AUR-361] Setup pre-commit, pytest, GitHub actions, ssh-secret (#3)

Co-authored-by: trducng <trungduc1992@gmail.com>
This commit is contained in:
ian_Cin
2023-08-30 07:22:01 +07:00
committed by GitHub
parent c3c25db48c
commit 5241edbc46
19 changed files with 268 additions and 54 deletions

View File

@@ -29,11 +29,14 @@ def clean_artifacts_for_telemetry():
def test_disable_telemetry_import_haystack_first():
"""Test that telemetry is disabled when kotaemon lib is initiated after"""
import os
import haystack.telemetry
assert haystack.telemetry.telemetry is not None
assert os.environ.get("HAYSTACK_TELEMETRY_ENABLED", "True") != "False"
import kotaemon # noqa: F401
import kotaemon # noqa: F401
assert haystack.telemetry.telemetry is None
assert os.environ.get("HAYSTACK_TELEMETRY_ENABLED", "True") == "False"
@@ -43,8 +46,9 @@ def test_disable_telemetry_import_haystack_after_kotaemon():
"""Test that telemetry is disabled when kotaemon lib is initiated before"""
import os
import kotaemon # noqa: F401
import haystack.telemetry
import kotaemon # noqa: F401
assert haystack.telemetry.telemetry is None
assert os.environ.get("HAYSTACK_TELEMETRY_ENABLED", "True") == "False"