stestr failing Command

Show the current failures in the repository.

class stestr.commands.failing.Failing(app, app_args, cmd_name=None)[source]

Show the current failures known by the repository.

Without –subunit, the process exit code will be non-zero if the previous test run was not successful and test failures are shown. But, with –subunit, the process exit code is non-zero only if the subunit stream could not be generated successfully from any failures. The test results and run status are included in the subunit stream emitted for the failed tests, so the stream should be used for interpretting the failing tests. If no subunit stream is emitted with –subunit and a zero exit code then there were no failures in the most recent run in the repository.

get_parser(prog_name)[source]

Return an argparse.ArgumentParser.

take_action(parsed_args)[source]

Override to do something useful.

The returned value will be returned by the program.

stestr.commands.failing.failing(repo_url=None, list_tests=False, subunit=False, stdout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]

Print the failing tests from the most recent run in the repository

This function will print to STDOUT whether there are any tests that failed in the last run. It optionally will print the test_ids for the failing tests if list_tests is true. If subunit is true a subunit stream with just the failed tests will be printed to STDOUT.

Note this function depends on the cwd for the repository if repo_url is not specified it will use the repository located at CWD/.stestr

Parameters:
  • repo_url (str) – The url of the repository to use.
  • list_test (bool) – Show only a list of failing tests.
  • subunit (bool) – Show output as a subunit stream.
  • stdout (file) – The output file to write all output to. By default this is sys.stdout
Return return_code:
 

The exit code for the command. 0 for success and > 0 for failures.

Return type:

int