summaryrefslogtreecommitdiff
path: root/tests/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/base.py')
-rw-r--r--tests/base.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/base.py b/tests/base.py
index cf6296f62..b85bce504 100644
--- a/tests/base.py
+++ b/tests/base.py
@@ -125,6 +125,8 @@ from zuul.lib.logutil import get_annotated_logger
import tests.fakegithub
import tests.fakegitlab
+from tests.otlp_fixture import OTLPFixture
+import opentelemetry.sdk.trace.export
FIXTURE_DIR = os.path.join(os.path.dirname(__file__), 'fixtures')
@@ -4921,6 +4923,15 @@ class ZuulTestCase(BaseTestCase):
if 'database' in config.sections():
_setup_fixture(config, 'database')
+ if 'tracing' in config.sections():
+ self.otlp = OTLPFixture()
+ self.useFixture(self.otlp)
+ self.useFixture(fixtures.MonkeyPatch(
+ 'zuul.lib.tracing.Tracing.processor_class',
+ opentelemetry.sdk.trace.export.SimpleSpanProcessor))
+ config.set('tracing', 'endpoint',
+ f'http://localhost:{self.otlp.port}')
+
if not self.setupSimpleLayout(config):
tenant_config = None
for cfg_attr in ('tenant_config', 'tenant_config_script'):
@@ -5207,6 +5218,7 @@ class ZuulTestCase(BaseTestCase):
and not t.name.startswith('Dummy-')
and not t.name.startswith('pydevd.')
and not t.name.startswith('ptvsd.')
+ and not t.name.startswith('OTLPFixture_')
]
if len(threads) > 1:
thread_map = dict(map(lambda x: (x.ident, x.name),