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
tests: news: refactor, add cases #989
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is some prep work to modernise the tests a bit by using dataclasses and idiomatic Python string/template substitution. The key point here is the changes facilitate testing with various combinations of fields, including multiple e.g. Display-If-Installed, which we couldn't do cleanly before. Bug: https://bugs.gentoo.org/889330 Signed-off-by: Sam James <sam@gentoo.org>
Previously, we'd ignore invalid news items in these tests because they're intended to check for the respective 'relevance' field. Fix that. Bug: https://bugs.gentoo.org/889330 Signed-off-by: Sam James <sam@gentoo.org>
Bug: https://bugs.gentoo.org/889330 Signed-off-by: Sam James <sam@gentoo.org>
Add a basic test case for when no filter fields are used (no Display-If-*). Bug: https://bugs.gentoo.org/889330
This shows that our current Display-If-Installed test doesn't work properly, as it'll pass with any package value. Bug: https://bugs.gentoo.org/889330 Signed-off-by: Sam James <sam@gentoo.org>
It's been TODO for many years (see a4acda0) and it covered up a problem with Display-If-Installed's test not actually asserting if the package was installed or not. Now e.g. dbapi.match() gives a proper result. Bug: https://bugs.gentoo.org/889330 Signed-off-by: Sam James <sam@gentoo.org>
thesamesam
force-pushed
the
news
branch
4 times, most recently
from
February 16, 2023 12:00
df8d4ed
to
17f078e
Compare
This eliminates a lot of boilerplate from each test. Bug: https://bugs.gentoo.org/889330 Signed-off-by: Sam James <sam@gentoo.org>
thesamesam
force-pushed
the
news
branch
4 times, most recently
from
February 16, 2023 12:12
5a5ef34
to
6942ea1
Compare
rndxelement
reviewed
Feb 16, 2023
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.
Greetings, the news item test rework looks great! I came across a few questions and thought that I might share them through this review
These tests would've caught the 3 previous regressions we had in the news feature over the last year. Verified by reverting each of the relevant fix commits (see below) and confirming the relevant tests start to fail then pass again once the fix is cherry-picked in isolation. See: 0e56f99 See: f1d98b6 See: 1ffaa70 Bug: https://bugs.gentoo.org/857669 Bug: https://bugs.gentoo.org/889330 Signed-off-by: Sam James <sam@gentoo.org>
Bug: https://bugs.gentoo.org/889330 Signed-off-by: Sam James <sam@gentoo.org>
Thanks for the review @rndxelement! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This would've caught the various news regressions we had over the last year.