tests(sdk-node, sdk-trace-node, sdk-trace-web): 6077 refactor test global providers#6319
Merged
pichlermarc merged 4 commits intoopen-telemetry:mainfrom Jan 20, 2026
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6319 +/- ##
=======================================
Coverage 95.46% 95.46%
=======================================
Files 317 317
Lines 9599 9599
Branches 2218 2218
=======================================
Hits 9164 9164
Misses 435 435 🚀 New features to boost your workflow:
|
pichlermarc
approved these changes
Jan 20, 2026
Member
pichlermarc
left a comment
There was a problem hiding this comment.
looks good, thanks for working on it 🙌
The current assertions fit in with the rest of this test, but long-term it may be simpler to use sinon assertions. that's non-blocking though, could be a good-first-issue follow-up. 🙂
Comment on lines
+144
to
147
| assert.ok( | ||
| setGlobalTracerProviderSpy.called === false, | ||
| 'tracer provider should not have changed' | ||
| ); |
Member
There was a problem hiding this comment.
nit: we could probably use
Sinon.assert.notCalled(setGlobalTracerProviderSpy);for this type of assertion.
Contributor
Author
There was a problem hiding this comment.
I kept using assert so we keep the error message but I agree maybe it's not necessary.
Comment on lines
+201
to
+205
| assert.strictEqual(setGlobalTracerProviderSpy.callCount, 1); | ||
| assert.ok( | ||
| setGlobalTracerProviderSpy.lastCall.args[0] instanceof | ||
| NodeTracerProvider | ||
| ); |
Member
There was a problem hiding this comment.
nit: we could probably use
Sinon.assert.calledOnceWithMatch(
setGlobalTracerProviderSpy,
(arg: any) => {
return arg instanceof NodeTracerProvider;
}
);for this type of assertion.
overbalance
approved these changes
Jan 20, 2026
This was referenced Jan 20, 2026
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.
Which problem is this PR solving?
Refactor SDK tests to not assert on
Proxy*Providerbut do it insetGlobal*Providercalls.Closes #6077
Short description of the changes
Type of change
How Has This Been Tested?
Checklist: