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

Better assert message when dealing with functional tests messages #3918

Conversation

Pierre-Sassoulas
Copy link
Member

Use sets here to show full diffs in functional tests

Co-authored-by: Ethan Leba [email protected]

Description

This change was hidden in #3821 and was not related to the MR that is taking some time because I must handle function and it's hard to do it properly. This was detrimental because tjhe error message was modified again in #3906 although a clearer error message already existed.

Type of Changes

Type
✨ New feature

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 90.749% when pulling cfee05e on Pierre-Sassoulas:better-assert-message-in-functional-tests into fed4438 on PyCQA:master.

@coveralls
Copy link

coveralls commented Oct 24, 2020

Coverage Status

Coverage decreased (-0.1%) to 90.75% when pulling 923745c on Pierre-Sassoulas:better-assert-message-in-functional-tests into fb6fa45 on PyCQA:master.

@Pierre-Sassoulas
Copy link
Member Author

Changed to work in progress, because I'm going to refactor testutil.py a bit and #3919 need to be merged first.

@hippo91
Copy link
Contributor

hippo91 commented Nov 26, 2020

@Pierre-Sassoulas let me know when you want me to do the review.

@hippo91 hippo91 added the Waiting on author Indicate that maintainers are waiting for a message of the author label Nov 26, 2020
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the better-assert-message-in-functional-tests branch from a397c79 to b7b643e Compare November 28, 2020 22:42
@Pierre-Sassoulas
Copy link
Member Author

Hey @hippo91 , so I worked on this MR as it's the next one for #3821. The idea was to create unittest for testutils but frankly I don't think I'll have the time to do that properly in a reasonable time. But I have some good news : I fixed a bug in the functional tests and the check we were doing on the txt output. Also made the error message clearer when a functional test fail. But the bad news is, ...as you will surely see once the test run in CI... that it revealed a dozen existing errors or checkers that never worked and that we'll have to fix those before being able to merge the fix.

@Pierre-Sassoulas Pierre-Sassoulas added Blocked 🚧 Blocked by a particular issue and removed Waiting on author Indicate that maintainers are waiting for a message of the author labels Nov 29, 2020
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the better-assert-message-in-functional-tests branch 2 times, most recently from 3b6a10c to 1557c8b Compare November 29, 2020 11:01
@hippo91
Copy link
Contributor

hippo91 commented Nov 29, 2020

Hey @hippo91 , so I worked on this MR as it's the next one for #3821. The idea was to create unittest for testutils but frankly I don't think I'll have the time to do that properly in a reasonable time. But I have some good news : I fixed a bug in the functional tests and the check we were doing on the txt output. Also made the error message clearer when a functional test fail. But the bad news is, ...as you will surely see once the test run in CI... that it revealed a dozen existing errors or checkers that never worked and that we'll have to fix those before being able to merge the fix.

Thanks @Pierre-Sassoulas for your investigations! What was exactly the origin of the bug (didn't have time to investigate myself)?
I think we have to correct all the failing tests ASAP and before releasing the future version.
What do you think about it?

@Pierre-Sassoulas
Copy link
Member Author

It was possible to add garbage lines that were not taken into account in the test in the .txt output file, I think it was signaled by the "TODO exhaustivity tests" (?). So for example if the checker wasn't doing anything and the output text had 5 lines of good looking result, the test is green but nothing is done.

For example we have this in the functional test:

use-symbolic-message-instead:2::"Id 'C0111' is used to disable 'missing-docstring' message emission"
use-symbolic-message-instead:3::"Id 'C0102' is used to disable 'blacklisted-name' message emission"
use-symbolic-message-instead:6::"Id 'C0102' is used to disable 'blacklisted-name' message emission"
use-symbolic-message-instead:6::"Id 'R1711' is used to disable 'useless-return' message emission"
use-symbolic-message-instead:10::"Id 'C0111' is used to enable 'missing-docstring' message emission"
missing-function-docstring:10:test_enabled_by_id_msg:"Missing function or method docstring"

But only the missing-function docstring is really reported, the other one are not. So if we want to merge the fix and not regress, we need to retroactively implement all those checkers that we thought were working but are not.

@hippo91
Copy link
Contributor

hippo91 commented Dec 5, 2020

@Pierre-Sassoulas thanks for your explanation. I think, indeed, that we have to fix all the false negative before merging.
I'll try to look at them ASAP but i'm a but busy right now.

@Pierre-Sassoulas
Copy link
Member Author

Maybe a reasonable thing to do would be to fix functional tests and to remove failing tests on the master branch while creating a feature branch to add them back by reverting the suppression ? That way no new problems get introduced.

@hippo91
Copy link
Contributor

hippo91 commented Dec 8, 2020

@Pierre-Sassoulas seems to be a good idea. Let's do this!

Pierre-Sassoulas referenced this pull request in Pierre-Sassoulas/pylint Dec 12, 2020
Pierre-Sassoulas referenced this pull request in Pierre-Sassoulas/pylint Dec 12, 2020
Pierre-Sassoulas referenced this pull request in Pierre-Sassoulas/pylint Dec 12, 2020
Pierre-Sassoulas referenced this pull request in Pierre-Sassoulas/pylint Dec 12, 2020
Pierre-Sassoulas referenced this pull request in Pierre-Sassoulas/pylint Dec 12, 2020
Pierre-Sassoulas referenced this pull request in Pierre-Sassoulas/pylint Dec 12, 2020
We do that because there was a problem with functional test see https://github.com/PyCQA/pylint/pull/3918\#issuecomment-735446281

We might need a mechanism for various result with different interpreters
We do that because there was a problem with functional test see https://github.com/PyCQA/pylint/pull/3918\#issuecomment-735446281

We might need a mechanism for various result with different interpreters
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the better-assert-message-in-functional-tests branch from 33d1259 to 923745c Compare December 14, 2020 08:35
@Pierre-Sassoulas Pierre-Sassoulas added Bug 🪲 Needs review 🔍 Needs to be reviewed by one or multiple more persons and removed Blocked 🚧 Blocked by a particular issue Work in progress labels Dec 14, 2020
@Pierre-Sassoulas
Copy link
Member Author

@hippo91 the tests are passing again, I created #3981 in order to follow the reintegration of removed test. Could you check that the revert are really required, maybe some of those are actually not wanted results ? (That would be in commits from "Remove functional test for message manager by id" to the latest)

@Pierre-Sassoulas Pierre-Sassoulas merged commit 973cdeb into pylint-dev:master Dec 31, 2020
Pierre-Sassoulas referenced this pull request Dec 31, 2020
We do that because there was a problem with functional test see https://github.com/PyCQA/pylint/pull/3918\#issuecomment-735446281

We might need a mechanism for various result with different interpreters
@Pierre-Sassoulas Pierre-Sassoulas deleted the better-assert-message-in-functional-tests branch December 31, 2020 09:41
@hippo91
Copy link
Contributor

hippo91 commented Dec 31, 2020

@Pierre-Sassoulas sorry i totally forgot to answer your last comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 Needs review 🔍 Needs to be reviewed by one or multiple more persons
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants