-
Notifications
You must be signed in to change notification settings - Fork 47
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
History tests #248
History tests #248
Conversation
@@ -263,3 +263,21 @@ def then_the_section(context, section, pkgs): | |||
return | |||
except StopIteration: | |||
raise AssertionError('section {} has not been found'.format(section)) | |||
|
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.
please, nothing in test_behave. it's deprecated
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.
Sorry I didn't know that. Will fix it...
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.
should be fine for now... I will probably add some more this week.
@@ -0,0 +1,21 @@ | |||
from behave import then | |||
from behave import when |
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.
[flake8]
- [F401] 'when' imported but unused
@@ -0,0 +1,21 @@ | |||
from behave import then | |||
from behave import when | |||
from behave import given |
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.
[flake8]
- [F401] 'given' imported but unused
980ad00
to
d4faec9
Compare
Feature: DNF/Behave test Transaction history - base | ||
|
||
Scenario: Simple transaction | ||
Given I use the repository "test-1" |
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.
This step is deprecated
|
||
Scenario: Simple transaction | ||
Given I use the repository "test-1" | ||
When I execute "dnf" command "install -y TestA" with "success" |
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.
This step is deprecated
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.
Are there any alternatives for these two? Or should I write new ones?
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.
there is, check obsoletes-reason
for example
4941cfd
to
9fb473c
Compare
Should be fine now |
Scenario: Update packages | ||
When I save rpmdb | ||
And I successfully run "dnf install -y TestA TestB TestD" | ||
When I save rpmdb |
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.
you should first check if all those packages have been installed correctly
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.
fixed
| removed | TestA, TestB | | ||
And history should contain "history undo last -y" with action "Erase" and "2" packages | ||
|
||
Scenario: Undo transaction last 2 |
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.
last 2?
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.
is Undo last transaction 2
better? 😄
5c1cab3
to
4803390
Compare
3b7cfbf
to
e8dc2b9
Compare
History tests should be complete now. Edit: added |
fixed indentation |
Then history info is broken in upstream
I have the same output in rawhide docker image
Like I said, rpm-software-management/dnf#756 should fix that issue |
@edynox Still one of the step is failing even with your patch:
|
@edynox Please can you fix that it will work with upstream version? Then I can merge it. Thanks a lot. Please if there is any problem, just let me know. |
@j-mracek Then upstream and SWDB output should be the same and I will rewrite this test so transaction merging will be tested properly (and passed by both upstream an SWDB) It is quite lot of work with proper transaction merging so I will need a few days... |
rpm-software-management/libdnf@509f859 introduces transaction merging in SWDB, I will write some tests on it here. YumMergedHistoryTransaction and YumHistoryTransaction were dropped from dnf. |
@j-mracek Merged transactions should be tested properly now. Its working on upstream for me. |
@j-mracek Can you finish the review, please? |
@edynox I am sorry but I got:
Second time that I repeated it, it passed (same container), and first test output is not reachable. The reason has be found first. |
|
Reinstall should fail when source repository is disabled.
When package is being replaced, new package must keep reason of obsoleted package.
Test whether transactions are merged properly in history info output.
This is kinda interesting. Transaction merging in DNF is not working correctly (works fine with SWDB). I tried it several times and found these problems: Caused by:
Line
is missing and
caused by
while it should be
|
Make Transaction method `__lt__` work in an expected way. True if t1.tid < t2.tid, false when t1.tid > t2.tid. This fixes the behavior of sort method (lowest/oldest first without using reverse flag). Fixes random behavior in CI tests: rpm-software-management/ci-dnf-stack#248
Make Transaction method `__lt__` work in an expected way. True if t1.tid < t2.tid, false when t1.tid > t2.tid. This fixes the behavior of sort method (lowest/oldest first without using reverse flag). Fixes random behavior in CI tests: rpm-software-management/ci-dnf-stack#248
Make Transaction method `__lt__` work in an expected way. True if t1.tid < t2.tid, false when t1.tid > t2.tid. This fixes the behavior of sort method (lowest/oldest first without using reverse flag). Fixes random behavior in CI tests: rpm-software-management/ci-dnf-stack#248 Closes: #947 Approved by: <try>
Make Transaction method `__lt__` work in an expected way. True if t1.tid < t2.tid, false when t1.tid > t2.tid. This fixes the behavior of sort method (lowest/oldest first without using reverse flag). Fixes random behavior in CI tests: rpm-software-management/ci-dnf-stack#248
It should work now |
@edynox Thanks, I will run tests several time just to ensure that it is fine. |
Thanks, no problem discovered. |
It didn't provide any information why there is any download. https://bugzilla.redhat.com/show_bug.cgi?id=1550006 Closes: #248 Approved by: m-blaha
Added some tests for dnf
history undo
andredo