Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Fix logging handling in hapi log events + added tests #131

Merged
merged 4 commits into from
Mar 14, 2017

Conversation

AdriVanHoudt
Copy link
Contributor

I think I did all the tests right ^^


server.log(['error'], customError)

agent._instrumentation._queue._flush()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have to flush the transaction queue here because this test doesn't test anything related to transactions. Just remove this line and don't give any arguments to the resetAgent function. Then just move the call to server.stop() to the top of the mocked captureError function.


server.log(['error'], customError)

agent._instrumentation._queue._flush()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


server.log(['error'], customError)

agent._instrumentation._queue._flush()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t.equal(res.statusCode, 200)

res.on('data', function (chunck) {
// I need to read this to make `res` end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little cleaner to just call res.resume() (that will also put the stream into flowing mode)

…ransactions // Use res.resume to flow through stream better
t.equal(res.statusCode, 200)

res.on('data', function (chunck) {
// I need to read this to make `res` end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little cleaner to just call res.resume() (that will also put the stream into flowing mode)

t.equal(res.statusCode, 200)

res.on('data', function (chunck) {
// I need to read this to make `res` end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little cleaner to just call res.resume() (that will also put the stream into flowing mode)

@watson
Copy link
Member

watson commented Mar 14, 2017

Really awesome job with all the test @AdriVanHoudt 😃

In general they all look good. I've added a few comments with some minor changes. Nothing big - just a few things to tidy things up

@AdriVanHoudt
Copy link
Contributor Author

@watson I was just looking at this PR for comments so I fixed all the notes already 🚀

@watson watson merged commit a6cdbca into opbeat:master Mar 14, 2017
@watson
Copy link
Member

watson commented Mar 14, 2017

I'll wait releasing this until your other PR have been merged as well

@AdriVanHoudt AdriVanHoudt deleted the fix-hapi-error-logging branch March 14, 2017 16:20
@AdriVanHoudt
Copy link
Contributor Author

@watson thanks!

@watson
Copy link
Member

watson commented Mar 16, 2017

Published as v4.12.0

watson pushed a commit that referenced this pull request May 9, 2018
connectionless tests should not run before 15.0.2.
server.stop(...) requires a stop callback until 10.x.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants