[test-improver] Improve tests for tracing.InitProvider#9606
Merged
lpcox merged 1 commit intoJul 19, 2026
Merged
Conversation
Add TestInitProvider_AllExportersFail to cover the code path in InitProvider where every OTLP exporter fails to initialize. A pre-cancelled context causes otlptracehttp.New to return an error immediately, which exercises the 'len(exporters) == 0' guard that returns an error (provider.go:177-179). Coverage: internal/tracing 96.5% → 97.8% Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds coverage for InitProvider when all OTLP exporters fail initialization.
Changes:
- Adds a pre-cancelled-context test for the zero-exporter error path.
- Verifies the provider is nil and the expected error is returned.
Show a summary per file
| File | Description |
|---|---|
internal/tracing/provider_test.go |
Tests failed OTLP exporter initialization. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Medium
lpcox
deleted the
test-improver/tracing-provider-all-exporters-fail-d2f1ae0ee81cecce
branch
July 19, 2026 06:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds test coverage for the
InitProvidererror path ininternal/tracing/provider.go.File analyzed
internal/tracing/provider_test.goImprovement made
Added
TestInitProvider_AllExportersFailwhich covers the previously untestedlen(exporters) == 0guard (lines 177-179 ofprovider.go). A pre-cancelled context causesotlptracehttp.Newto return immediately withcontext canceled, so every exporter in the loop fails and the function returns an error.Coverage
internal/tracingInitProviderTest output
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
awmgmcpgSee Network Configuration for more information.