Skip to content
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

fixed fastify spec builders, added unit tests for code as well #933

Merged
merged 4 commits into from
Sep 28, 2021

Conversation

bizob2828
Copy link
Member

Proposed Release Notes

  • Fixed the WebFramework spec definitions for Fastify middleware and route handlers to properly retrieve the IncomingMessage from a request object. Also, added proper definition to middleware handlers so that the relationship to consecutive middleware and route handler are siblings and not direct children.

Links

Closes #926

Details

There is overlap with this PR and https://github.com/newrelic/node-newrelic/pull/931/files. The tests will need to be reconciled. We also will be adding more test cases scenarios when this MMF is close to being done in #928

michaelgoin
michaelgoin previously approved these changes Sep 28, 2021
Copy link
Member

@michaelgoin michaelgoin left a comment

Choose a reason for hiding this comment

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

👍

@@ -63,16 +64,24 @@ let testCount = 0
const testUri = (uri, agent, test, port) => {
agent.on('transactionFinished', (transaction) => {
testCount++
test.equals(
test.equal(
Copy link
Member

Choose a reason for hiding this comment

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

Do we have any tests that verify we are not going to end up with any raw route parameters or query string items in the naming?

I'm assuming this works but not sure if we have any coverage. These seem to just be hitting simple defined routes VS say '/person/111222333/' and ensuring we end up with '/person/:id' as the name (or whatever matches fastify-style).

If we don't have any coverage, perhaps should have a story for that.

Copy link
Member Author

Choose a reason for hiding this comment

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

we don't but i'll add to this #928 which was to flesh out our integration tests for fastify

@@ -47,9 +47,12 @@ const setupMiddlewareHandlers = (shim, fastify) => {
return function wrappedFastifyUser() {
const args = shim.argsToArray.apply(shim, arguments)
const middlewareFunction = args[0]
Copy link
Member

Choose a reason for hiding this comment

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

You seem to be using destructuring everywhere else so just mentioning you could do that here too (but I don't care if you do or don't).

@michaelgoin michaelgoin merged commit 2726542 into newrelic:main Sep 28, 2021
@github-actions github-actions bot mentioned this pull request Oct 12, 2021
@bizob2828 bizob2828 deleted the fix-fastify-specs branch August 28, 2024 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Fastify GA: Fix the spec builders to properly define the keys
2 participants