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

Print errors after test structure in verbose mode #4438

Conversation

acamposruiz
Copy link
Contributor

@acamposruiz acamposruiz commented Sep 6, 2017

Summary

This is a fix for this issue #4264

When running a single test that has many test cases the error messages are printed before the list of failing/passing tests which makes us to scroll up every time just to see the error message.

This Pull Request change the behavior of print error messages to put them after the list of tests

So the behavior is going to switch from the actual:

image

to this:

image

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@acamposruiz acamposruiz closed this Sep 6, 2017
@acamposruiz acamposruiz reopened this Sep 6, 2017
"PASS __tests__/console.test.js
✓ works just fine
" ✓ works just fine
PASS __tests__/console.test.js
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is the right behavior. We should print the PASS message before any test results.

Copy link
Member

@cpojer cpojer left a comment

Choose a reason for hiding this comment

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

If you look at the snapshot tests, the printing is now incorrect for most cases. The test result header with the test name should come first, then the individual test names and then the errors. Would you mind making those changes? Thanks!

@acamposruiz
Copy link
Contributor Author

acamposruiz commented Sep 15, 2017

Ok @cpojer , I will working on this right away. But first I would like to get a better understanding of the right behavior:

The actual behavior on master is something like this:

image

But If we implement two different ways to print the result, depends on it's PASS or FAIL, the screen will become in something like this:

image

As you can see the "Runtime" sentence of the FAIL test result is printed just next to the previous test result. I think this looks confused so maybe we could go another way. It could be something like print the test result header of the FAIL test the first (just like is now on master branch), and so print the errors at the bottom like you can see in the screenshot posted above, but changing "FAIL" message to another thing like, for example, "ERRORS"

Becoming in something like this:

issue_4264

What do you think about that implementation @cpojer @aaronabramov ?

@cpojer
Copy link
Member

cpojer commented Sep 15, 2017

I think the task here is to literally swap the list of tests that were run with the errors. Currently the errors come first and the list second and this change should swap the two, without making any other changes. Thanks!

@acamposruiz
Copy link
Contributor Author

Thanks very much @cpojer !

So would it have to become something like this?:

issue_4264_b

@cpojer
Copy link
Member

cpojer commented Sep 15, 2017

Exactly! Can you make the minimal changes to the code to make this happen? :)

@acamposruiz
Copy link
Contributor Author

Sure! I am working on it right now :)

@acamposruiz acamposruiz force-pushed the issues/4264-print-errors-after-test branch from dd65839 to 0d5b5ee Compare September 18, 2017 19:09
@acamposruiz acamposruiz reopened this Sep 18, 2017
@acamposruiz
Copy link
Contributor Author

@cpojer , @aaronabramov, this PR continue here #4504

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants