1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2026-06-03 18:35:08 +02:00
Files
opentelemetry-go/bridge/opencensus
Peter Bryant 9f282a1e1d Fix/issue 6560 install trace bridge test (#6814)
Fixes #6560

## Summary

Adds tests for the `InstallTraceBridge` function to verify that the
`octrace.DefaultTracer` is correctly set when the function is called
with various configuration options.

## Changes

- Added `TestInstallTraceBridge` test function in
`bridge/opencensus/trace_test.go`
- Tests cover multiple scenarios:
  - Installation with default options
  - Installation with custom tracer provider
  - Installation with tracer provider and exporter
- Verifies that `octrace.DefaultTracer` is properly updated.
- Verifies that the installed tracer can create functional spans.
- Ensures proper cleanup of global state after tests.

## Test Results

```bash
=== RUN   TestInstallTraceBridge
=== RUN   TestInstallTraceBridge/install_with_default_options
=== RUN   TestInstallTraceBridge/install_with_custom_tracer_provider
=== RUN   TestInstallTraceBridge/install_with_tracer_provider_with_exporter
--- PASS: TestInstallTraceBridge (0.00s)
```

---------

Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: dmathieu <damien.mathieu@elastic.co>
2025-05-26 09:33:04 +02:00
..
2025-05-21 09:35:39 +02:00
2025-05-05 15:51:46 -07:00
2024-03-26 20:13:54 +01:00