Skip to content

Commit b9b780a

Browse files
authored
Tag all tests using spans (#1482)
1 parent c5ea58d commit b9b780a

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

tests/conftest.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@
3535
from benchmark_schema import TestRun
3636
from plugins import Durations
3737

38-
logger = logging.getLogger("coiled-runtime")
38+
try:
39+
from distributed.spans import span as span_ctx
40+
except ImportError: # dask <2023.6.0
41+
from contextlib import nullcontext as span_ctx
42+
43+
44+
logger = logging.getLogger("benchmarks")
3945
logger.setLevel(logging.INFO)
4046

4147
coiled_logger = logging.getLogger("coiled")
@@ -401,13 +407,20 @@ def _get_cluster_info(cluster):
401407
yield _get_cluster_info
402408

403409

410+
@pytest.fixture(scope="function")
411+
def span(request):
412+
with span_ctx(request.node.name):
413+
yield
414+
415+
404416
@pytest.fixture(scope="function")
405417
def benchmark_all(
406418
benchmark_memory,
407419
benchmark_task_durations,
408420
benchmark_coiled_prometheus,
409421
get_cluster_info,
410422
benchmark_time,
423+
span,
411424
):
412425
"""Benchmark all available metrics and extracts cluster information
413426

tests/tpch/conftest.py

+1
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ def client(
206206
testrun_uid,
207207
cluster_kwargs,
208208
benchmark_time,
209+
span,
209210
restart,
210211
scale,
211212
local,

tests/tpch/test_correctness.py

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def client(
7070
testrun_uid,
7171
cluster_kwargs,
7272
benchmark_time,
73+
span,
7374
restart,
7475
local,
7576
query,

0 commit comments

Comments
 (0)