-
Notifications
You must be signed in to change notification settings - Fork 407
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
chore: Replaced usage of fake-collector with test-collector #2669
Conversation
@@ -55,6 +55,7 @@ module.exports = function parse(name, response, callback) { | |||
logger.trace(json, 'Deserialized from collector:') | |||
|
|||
payload = json.return_value || payload | |||
// This is ignoring any `validations` present on the returned JSON. |
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'm not sure if we want to be doing this? I just noted it because I encountered it while verifying that I migrated a test successfully. If we want to solve it, that should be a different issue.
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 have no idea what this is even talking about
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.
See:
- https://github.com/jsumners-nr/node-newrelic/blob/7876c733fe5cf90f33aca5400d274ef2eae354de/test/integration/collector-remote-method.test.js#L46-L47
- https://github.com/jsumners-nr/node-newrelic/blob/b917b3ea9416eaf64bf365f6f46a0d4eafdfc437/test/lib/fake-collector.js#L202-L235
Basically, the collector returns responses like:
{
return_value: { redirect_host: 'https://example.com' },
validations: [ {/* stuff */} ]
}
And we are completely dropping the validations
key.
|
||
const util = require('node:util') | ||
|
||
class CollectorValidators { |
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 could be convinced to make this a simple object export. I started with the class
because I assumed the validators would have been used much more thoroughly, and would have needed access to some common data. But all of them, except for the two replicated here, are completely unused.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2669 +/- ##
==========================================
- Coverage 97.21% 88.76% -8.45%
==========================================
Files 291 290 -1
Lines 45928 45914 -14
==========================================
- Hits 44650 40757 -3893
- Misses 1278 5157 +3879
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -55,6 +55,7 @@ module.exports = function parse(name, response, callback) { | |||
logger.trace(json, 'Deserialized from collector:') | |||
|
|||
payload = json.return_value || payload | |||
// This is ignoring any `validations` present on the returned JSON. |
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 have no idea what this is even talking about
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.
LGTM
This PR resolves #2592.