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

test: update assert messages to show expected and actual values #19420

Closed
wants to merge 4 commits into from

Conversation

domahony
Copy link
Contributor

The test-fs-readfile-pipe unit test has been updated to display the actual and expected values when the assertion fires. The test has also been updated to use a string of regularly formatted x characters as test data so that differences between the actual and expected values are easier to spot.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Mar 17, 2018
@domahony domahony changed the title Pr fix readfile pipe test test: update assert messages to show expected and actual values Mar 17, 2018
xxxxxxxxxx xxxxxxxxxx
xxxxxxxxxx xxxxxxxxxx`
tmpdir.refresh();
fs.writeFileSync(filename, dataExpected);
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Instead of creating the file in the tmpdir, maybe it would be better to put the file permanently in test/fixtures and read it from there?

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 agree. I'll make this change.

Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

LGTM if CI is green/yellow

@Trott
Copy link
Member

Trott commented Mar 18, 2018

@domahony domahony force-pushed the pr-fix-readfile-pipe-test branch from 1acb95a to 97bd124 Compare March 18, 2018 11:58
@domahony
Copy link
Contributor Author

I amended the commit because the node-test-linter test failed.
The node-test-commit-aix test also failed, however, I'm not sure how to resolve this problem (shouldn't this test be ignored for the aix platform?). The logs appear to indicate it might have been a transient problem, or perhaps it was a result of the previous lint problems?

@Trott
Copy link
Member

Trott commented Mar 18, 2018

Agreed that AIX failure seems unrelated. Let's run again to get a clean lint run and see if AIX is building OK now.

CI: https://ci.nodejs.org/job/node-test-pull-request/13734/

@Trott
Copy link
Member

Trott commented Mar 18, 2018

AIX failed again but I think I fixed the build problem. One more time on AIX only: https://ci.nodejs.org/job/node-test-commit-aix/13420/

@domahony domahony force-pushed the pr-fix-readfile-pipe-test branch from 97bd124 to 104ff10 Compare March 22, 2018 22:31
uses the same approach as in test-fs-readfile-pipe-large
The test originally used the contents of the test file as test data.
However, if the assertion fires, the resulting message is
difficult to comprehend. The test now uses a short string of
regularly formatted x characters that make it easier to spot
differences in the expected and actual values.
The test originally used the contents of the test file as test data.
However, if the assertion fires, the resulting message is
difficult to comprehend. The test now uses a short string of
regularly formatted x characters that make it easier to spot
differences in the expected and actual values.
The test has been updated to read a test file from the
test/fixtures folder.  This makes the source of the test
less cluttered.
@domahony domahony force-pushed the pr-fix-readfile-pipe-test branch from 104ff10 to cfb0cc3 Compare March 24, 2018 11:40
@Trott
Copy link
Member

Trott commented Mar 27, 2018

Hmmm...looks like the AIX results have expired. OK, let's try this again:

CI: https://ci.nodejs.org/job/node-test-pull-request/13879/

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 27, 2018
@trivikr
Copy link
Member

trivikr commented Apr 3, 2018

@Trott
Copy link
Member

Trott commented Apr 4, 2018

@Trott
Copy link
Member

Trott commented Apr 4, 2018

trivikr pushed a commit that referenced this pull request Apr 7, 2018
uses the same approach as in test-fs-readfile-pipe-large

PR-URL: #19420
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@trivikr
Copy link
Member

trivikr commented Apr 7, 2018

Landed in 3217c70

Congratulations @domahony for your first commit to Node.js core! 🎉🎉🎉

@trivikr trivikr closed this Apr 7, 2018
targos pushed a commit that referenced this pull request Apr 12, 2018
uses the same approach as in test-fs-readfile-pipe-large

PR-URL: #19420
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants