Skip to content

Commit

Permalink
Merge pull request #306 from mtreinish/add-history-command
Browse files Browse the repository at this point in the history
Add history commands to stestr
  • Loading branch information
mtreinish authored Apr 21, 2021
2 parents bb3f522 + d5f46d9 commit 7d655e4
Show file tree
Hide file tree
Showing 14 changed files with 676 additions and 2 deletions.
24 changes: 24 additions & 0 deletions doc/source/MANUAL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,13 @@ that changes the default on all available options in the config file is::
abbreviate: True
suppress-attachments: True
all-attachments: True
history-list:
show-metadata: True
history-show:
no-subunit-trace: True
color: True
suppress-attachments: True
all-attachments: True

If you choose to use a user config file you can specify any subset of the
options and commands you choose.
Expand Down Expand Up @@ -579,6 +586,23 @@ runner per test it runs. To avoid cross-test-runner interactions concurrency
is disabled in this mode. ``--analyze-isolation`` supersedes ``--isolated`` if
they are both supplied.

History
-------

stestr keeps a history of all test runs in a local repository. the
``stestr history`` command is used for interacting with those old runs. The
history command has 3 sub-commands, ``list``, ``show``, and ``remove``. The
``list`` sub-command will generate a list of the previous runs in the data
repository and show some basic stats for each run. The ``show`` sub-command is
used to retreive the record of a previous run, it behaves identically to
``stestr last``, except that it takes an optional run id to show any run in the
stestr history. If a run id is not specified it will use the most recent
result. The ``remove`` sub-command will delete a specified run from the data
repository. Additionally, the keyword ``all`` can be used to remove all runs
from the repository. For example::

$ stestr history remove all

Repositories
------------

Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ stestr.cm =
list = stestr.commands.list:List
load = stestr.commands.load:Load
slowest = stestr.commands.slowest:Slowest
history_list = stestr.commands.history:HistoryList
history_show = stestr.commands.history:HistoryShow
history_remove = stestr.commands.history:HistoryRemove

[extras]
sql =
Expand Down
8 changes: 7 additions & 1 deletion stestr/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@
# under the License.

from stestr.commands.failing import failing as failing_command
from stestr.commands.history import history_list as history_list_command
from stestr.commands.history import history_remove as history_remove_command
from stestr.commands.history import history_show as history_show_command
from stestr.commands.init import init as init_command
from stestr.commands.last import last as last_command
from stestr.commands.list import list_command
from stestr.commands.load import load as load_command
from stestr.commands.run import run_command
from stestr.commands.slowest import slowest as slowest_command


__all__ = ['failing_command', 'init_command', 'last_command',
'list_command', 'load_command', 'run_command', 'slowest_command']
'list_command', 'load_command', 'run_command', 'slowest_command',
'history_show_command', 'history_list_command',
'history_remove_command']
Loading

0 comments on commit 7d655e4

Please sign in to comment.