Skip to content

Commit 46785f9

Browse files
committed
split serial e2e tests from parallel ci lane
1 parent c9ed554 commit 46785f9

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,11 @@ jobs:
176176
- name: Run the end-to-end tests
177177
run: |
178178
uv run --frozen python --version
179-
uv run --frozen pytest -n 2 --dist loadfile -s -v --log-cli-level=INFO tests/e2e
179+
uv run --frozen pytest -n 4 --dist loadfile -s -v --log-cli-level=INFO tests/e2e -m "not serial_e2e"
180+
181+
- name: Run serial end-to-end tests
182+
run: |
183+
uv run --frozen pytest -s -v --log-cli-level=INFO tests/e2e -m serial_e2e
180184
181185
all-tests-passed:
182186
# This allows us to have a branch protection rule for tests and deploys with matrix

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ log_cli = true
5555
markers = [
5656
"unit: deterministic tests that run without a Langfuse server",
5757
"e2e: tests that require a real Langfuse server or persisted backend behaviour",
58+
"serial_e2e: e2e tests that must not share server concurrency with the rest of the suite",
5859
"live_provider: tests that call live model providers and are kept out of default CI",
5960
]
6061

tests/conftest.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@
1010
from langfuse._client.client import Langfuse
1111
from langfuse._client.resource_manager import LangfuseResourceManager
1212

13+
SERIAL_E2E_NODEIDS = {
14+
"tests/e2e/test_core_sdk.py::test_create_boolean_score",
15+
"tests/e2e/test_core_sdk.py::test_create_categorical_score",
16+
"tests/e2e/test_core_sdk.py::test_create_score_with_custom_timestamp",
17+
"tests/e2e/test_decorators.py::test_return_dict_for_output",
18+
"tests/e2e/test_decorators.py::test_media",
19+
"tests/e2e/test_decorators.py::test_merge_metadata_and_tags",
20+
"tests/e2e/test_experiments.py::test_boolean_score_types",
21+
"tests/e2e/test_media.py::test_replace_media_reference_string_in_object",
22+
}
23+
1324

1425
class InMemorySpanExporter(SpanExporter):
1526
"""Simple in-memory exporter to collect spans for deterministic tests."""
@@ -45,6 +56,8 @@ def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
4556

4657
if test_group == "e2e":
4758
item.add_marker(pytest.mark.e2e)
59+
if item.nodeid in SERIAL_E2E_NODEIDS:
60+
item.add_marker(pytest.mark.serial_e2e)
4861
continue
4962

5063
if test_group == "live_provider":

0 commit comments

Comments
 (0)