-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix to DBM propagation - comment is injected before query is sent #2938
Conversation
Overall package sizeSelf size: 4.01 MB Dependency sizes
🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov Report
@@ Coverage Diff @@
## master #2938 +/- ##
==========================================
- Coverage 87.64% 87.64% -0.01%
==========================================
Files 329 329
Lines 11747 11750 +3
Branches 33 33
==========================================
+ Hits 10296 10298 +2
- Misses 1451 1452 +1
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
c165ffa
to
5a4d84b
Compare
}).then(done, done) | ||
|
||
client.query('SELECT $1::text as message', ['Hello World!'], (err, result) => { | ||
if (err) return done(err) | ||
expect(seenTraceParent).to.be.true | ||
net.Socket.prototype.write = originalWrite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not get restored if the assertion before it fails. This could cause other tests to fail incorrectly. It's generally best to avoid side effects potentially leaking out of tests. This could be resolved by putting the test in a describe
with before
and after
to do the environment modifications, ensuring they always happen regardless of what happens in the test.
describe('something', () => {
before(() => {
// Do your environment-changing things...
})
after(() => {
// Ensure your environment changes are restored, even if the tests failed.
})
it('should work', () => {
// Your modified environment state will be present here.
})
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, good point, will make the changes 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Qard I have added the tests to a beforeEach and and afterEach block.
5a4d84b
to
8421ebc
Compare
@@ -150,7 +148,6 @@ describe('Plugin', () => { | |||
expect(traces[0][0].meta).to.have.property(ERROR_MESSAGE, error.message) | |||
expect(traces[0][0].meta).to.have.property(ERROR_STACK, error.stack) | |||
expect(traces[0][0].meta).to.have.property('component', 'pg') | |||
expect(traces[0][0].metrics).to.have.property('network.destination.port', 5432) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any way to not remove these tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure how they were removed...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added back 👍
What does this PR do?
Motivation
Plugin Checklist
Additional Notes