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

Enable and update several history list tests and add a test with multiple args #1558

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
177 changes: 91 additions & 86 deletions dnf-behave-tests/dnf/history-list.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,84 +8,89 @@ Given I use repository "dnf-ci-fedora"
And I successfully execute dnf with args "install nodejs"


@dnf5
Scenario: history list
When I execute dnf with args "history list"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 3 | | Install | 5 |
| 2 | | Removed | 3 |
| 1 | | Install | 6 |
| 3 | | | 5 |
| 2 | | | 3 |
| 1 | | | 6 |

Scenario: history
@dnf5
Scenario: history without sub-command
When I execute dnf with args "history"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 3 | | Install | 5 |
| 2 | | Removed | 3 |
| 1 | | Install | 6 |
Then the exit code is 2
And stdout is empty
And stderr is
"""
Missing command. Add "--help" for more information about the arguments.
"""


@dnf5
# single item tests
Scenario: history list 2
When I execute dnf with args "history list 2"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 2 | | Removed | 3 |
| 2 | | | 3 |

Scenario: history list last
When I execute dnf with args "history list last"
@dnf5
Scenario: history list with mulitple args
When I execute dnf with args "history list 1 2 3"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 3 | | Install | 5 |
| 3 | | | 5 |
| 2 | | | 3 |
| 1 | | | 6 |

Scenario: history last
When I execute dnf with args "history last"
@dnf5
Scenario: history list last
When I execute dnf with args "history list last"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 3 | | Install | 5 |
| 3 | | | 5 |

@dnf5
Scenario: history last without subcommand
When I execute dnf with args "history last"
Then the exit code is 2
And stdout is empty
And stderr is
"""
Unknown argument "last" for command "history". Add "--help" for more information about the arguments.
"""

@dnf5
Scenario: history list last-1
When I execute dnf with args "history list last-1"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 2 | | Removed | 3 |

Scenario: history last-1
When I execute dnf with args "history last-1"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 2 | | Removed | 3 |

| 2 | | | 3 |

@dnf5
# range tests
Scenario: history 1..last-1
When I execute dnf with args "history 1..last-1"
Scenario: history list 1..last-1
When I execute dnf with args "history list 1..last-1"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 2 | | Removed | 3 |
| 1 | | Install | 6 |
| 2 | | | 3 |
| 1 | | | 6 |

Scenario: history 1..last-2
When I execute dnf with args "history 1..last-2"
@dnf5
Scenario: history list 1..last-2
When I execute dnf with args "history list 1..last-2"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 1 | | Install | 6 |

Scenario: history 1..last-2
When I execute dnf with args "history 1..last-2"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 1 | | Install | 6 |
| 1 | | | 6 |

Scenario: history list 1..-1
When I execute dnf with args "history 1..-1"
Expand All @@ -102,69 +107,76 @@ Scenario: history list 1..-2
| Id | Command | Action | Altered |
| 1 | | Install | 6 |

Scenario: history 2..3
When I execute dnf with args "history 2..3"
@dnf5
Scenario: history list 2..3
When I execute dnf with args "history list 2..3"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 3 | | Install | 5 |
| 2 | | Removed | 3 |
| 3 | | | 5 |
| 2 | | | 3 |

Scenario: history 10..11
When I execute dnf with args "history 10..11"
@dnf5
Scenario: history list 10..11
When I execute dnf with args "history list 10..11"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
And stdout is empty

Scenario: history last..11
When I execute dnf with args "history last..11"
@dnf5
Scenario: history list last..11
When I execute dnf with args "history list last..11"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 3 | | Install | 5 |
| 3 | | | 5 |


@dnf5
# "invalid" range tests
Scenario: history 3..2
When I execute dnf with args "history 3..2"
Scenario: history list 3..2
When I execute dnf with args "history list 3..2"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 3 | | Install | 5 |
| 2 | | Removed | 3 |
| 3 | | | 5 |
| 2 | | | 3 |

Scenario: history last-1..1
When I execute dnf with args "history last-1..1"
@dnf5
Scenario: history list last-1..1
When I execute dnf with args "history list last-1..1"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 2 | | Removed | 3 |
| 1 | | Install | 6 |
| 2 | | | 3 |
| 1 | | | 6 |

Scenario: history 11..last-1
When I execute dnf with args "history 11..last-1"
@dnf5
Scenario: history list 11..last-1
When I execute dnf with args "history list 11..last-1"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 3 | | Install | 5 |
| 2 | | Removed | 3 |
| 3 | | | 5 |
| 2 | | | 3 |

Scenario: history last-1..aaa
When I execute dnf with args "history last-1..aaa"
@dnf5
Scenario: history list last-1..aaa
When I execute dnf with args "history list last-1..aaa"
Then the exit code is 1
And stdout is empty
And stderr is
"""
Can't convert 'aaa' to transaction ID.
Use '<number>', 'last', 'last-<number>'.
Invalid transaction ID range "last-1..aaa", "ID" or "ID..ID" expected, where ID is "NUMBER", "last" or "last-NUMBER".
"""

Scenario: history 12a..bc
When I execute dnf with args "history 12a..bc"
@dnf5
Scenario: history list 12a..bc
When I execute dnf with args "history list 12a..bc"
Then the exit code is 1
And stdout is empty
And stderr is
"""
Can't convert '12a' to transaction ID.
Use '<number>', 'last', 'last-<number>'.
Invalid transaction ID range "12a..bc", "ID" or "ID..ID" expected, where ID is "NUMBER", "last" or "last-NUMBER".
"""


Expand Down Expand Up @@ -215,31 +227,24 @@ Scenario: history length is 80 chars when missing rows are queried
80
"""

@dnf5
@bz1846692
Scenario: history list --reverse
When I execute dnf with args "history list --reverse"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 1 | | Install | 6 |
| 2 | | Removed | 3 |
| 3 | | Install | 5 |
| 1 | | | 6 |
| 2 | | | 3 |
| 3 | | | 5 |

@bz1846692
Scenario: history --reverse
When I execute dnf with args "history --reverse"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 1 | | Install | 6 |
| 2 | | Removed | 3 |
| 3 | | Install | 5 |

@dnf5
@bz1846692
Scenario: history 2..3 --reverse
When I execute dnf with args "history 2..3 --reverse"
When I execute dnf with args "history list 2..3 --reverse"
Then the exit code is 0
And stdout is history list
| Id | Command | Action | Altered |
| 2 | | Removed | 3 |
| 3 | | Install | 5 |
| 2 | | | 3 |
| 3 | | | 5 |
Loading