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

chore: Replaced usage of fake-collector with test-collector #2669

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

jsumners-nr
Copy link
Contributor

This PR resolves #2592.

@@ -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.
Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See:

Basically, the collector returns responses like:

{
	return_value: { redirect_host: 'https://example.com' },
	validations: [ {/* stuff */} ]
}

And we are completely dropping the validations key.

test/lib/schemas/connect.json Outdated Show resolved Hide resolved

const util = require('node:util')

class CollectorValidators {
Copy link
Contributor Author

@jsumners-nr jsumners-nr Oct 21, 2024

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.

Copy link

codecov bot commented Oct 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.76%. Comparing base (b917b3e) to head (1b6320b).
Report is 4 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (b917b3e) and HEAD (1b6320b). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (b917b3e) HEAD (1b6320b)
unit-tests-20.x 1 0
unit-tests-22.x 1 0
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     
Flag Coverage Δ
integration-tests-cjs-18.x 74.17% <100.00%> (+<0.01%) ⬆️
integration-tests-cjs-20.x 74.17% <100.00%> (-0.01%) ⬇️
integration-tests-cjs-22.x 74.21% <100.00%> (-0.01%) ⬇️
integration-tests-esm-18.x 49.70% <0.00%> (-0.01%) ⬇️
integration-tests-esm-20.x 49.71% <0.00%> (-0.01%) ⬇️
integration-tests-esm-22.x 49.73% <0.00%> (-0.01%) ⬇️
unit-tests-20.x ?
unit-tests-22.x ?
versioned-tests-18.x 78.95% <0.00%> (-0.16%) ⬇️
versioned-tests-20.x 78.95% <0.00%> (-0.17%) ⬇️
versioned-tests-22.x 78.93% <0.00%> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jsumners-nr jsumners-nr marked this pull request as ready for review October 21, 2024 16:46
@jsumners-nr jsumners-nr requested a review from bizob2828 October 21, 2024 16:51
@@ -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.
Copy link
Member

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

Copy link
Member

@bizob2828 bizob2828 left a comment

Choose a reason for hiding this comment

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

LGTM

@bizob2828 bizob2828 added the dev:tests Indicates only changes to tests label Oct 23, 2024
@jsumners-nr jsumners-nr merged commit b25cff0 into newrelic:main Oct 23, 2024
27 of 28 checks passed
@jsumners-nr jsumners-nr deleted the issue-2592 branch October 23, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev:tests Indicates only changes to tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Convert instances of fakeCollectorApi to use Collector instead
2 participants