Skip to content

Commit 6ea971f

Browse files
committed
keep e2e runs out of PostHog and Sentry
The e2e suite installs and renders for real with a real API key. Set CODEPLAIN_TELEMETRY=0 for the container and for the Windows runs so test installs and test renders do not show up as user activity.
1 parent 8b3f2d1 commit 6ea971f

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

tests/e2e/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ def e2e_container(docker_image: str, api_key: str):
4949
f"CODEPLAIN_API_KEY={api_key}",
5050
"-e",
5151
"CODEPLAIN_INSTALL_NONINTERACTIVE=1",
52+
# A test run is not a real install or a real render; keep its events
53+
# out of PostHog and its crashes out of Sentry.
54+
"-e",
55+
"CODEPLAIN_TELEMETRY=0",
5256
docker_image,
5357
],
5458
capture_output=True,
@@ -120,6 +124,8 @@ def codeplain_exe(api_key: str) -> Path:
120124
**os.environ,
121125
"CODEPLAIN_API_KEY": api_key,
122126
"CODEPLAIN_INSTALL_NONINTERACTIVE": "1",
127+
# A test run is not a real install; keep its events out of PostHog.
128+
"CODEPLAIN_TELEMETRY": "0",
123129
}
124130
result = subprocess.run(
125131
["pwsh", "-NoProfile", "-File", str(INSTALL_PS1)],

tests/e2e/test_hello_world_python_windows.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
def test_render_and_run_hello_world_python_windows(codeplain_exe: Path, api_key: str, tmp_path: Path):
1919
shutil.copy(EXAMPLE_PLAIN, tmp_path / "hello_world_python.plain")
2020

21-
env = {**os.environ, "CODEPLAIN_API_KEY": api_key}
21+
# A test render is not a real render; keep its events out of PostHog.
22+
env = {**os.environ, "CODEPLAIN_API_KEY": api_key, "CODEPLAIN_TELEMETRY": "0"}
2223

2324
result = subprocess.run(
2425
[str(codeplain_exe), "--help"],

0 commit comments

Comments
 (0)