stestr


Namestestr JSON
Version 4.1.0 PyPI version JSON
download
home_pagehttp://stestr.readthedocs.io/en/latest/
SummaryA parallel Python test runner built around subunit
upload_time2023-09-18 12:36:20
maintainer
docs_urlNone
authorMatthew Treinish
requires_python>=3.6
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            stestr
======

.. image:: https://github.com/mtreinish/stestr/actions/workflows/main.yml/badge.svg?branch=main
    :target: https://github.com/mtreinish/stestr/actions/workflows/main.yml
    :alt: CI Testing status

.. image:: https://img.shields.io/codecov/c/gh/mtreinish/stestr?style=flat-square
    :target: https://codecov.io/gh/mtreinish/stestr
    :alt: Code coverage

.. image:: https://img.shields.io/pypi/v/stestr.svg?style=flat-square
    :target: https://pypi.python.org/pypi/stestr
    :alt: Latest Version

.. image:: https://img.shields.io/github/license/mtreinish/stestr.svg?style=popout-square
    :target: https://opensource.org/licenses/Apache-2.0
    :alt: License:

* Read this in other languages: `English`_, `日本語`_
* You can see the full rendered docs at: http://stestr.readthedocs.io/en/latest/
* The code of the project is on Github: https://github.com/mtreinish/stestr

.. _English: https://github.com/mtreinish/stestr/blob/main/README.rst
.. _日本語: https://github.com/mtreinish/stestr/blob/main/README_ja.rst

.. note:: stestr v2.x.x release series will be the last series that supports
    Python 2. Support for Python 2.7 was dropped in stestr release 3.0.0.

Overview
--------

stestr is parallel Python test runner designed to execute `unittest`_ test
suites using multiple processes to split up execution of a test suite. It also
will store a history of all test runs to help in debugging failures and
optimizing the scheduler to improve speed. To accomplish this goal it uses the
`subunit`_ protocol to facilitate streaming and storing results from multiple
workers.

.. _unittest: https://docs.python.org/3/library/unittest.html
.. _subunit: https://github.com/testing-cabal/subunit

stestr originally started as a fork of the `testrepository`_ project. But,
instead of being an interface for any test runner that used subunit, like
testrepository, stestr concentrated on being a dedicated test runner for python
projects. While stestr was originally forked from testrepository it is not
backwards compatible with testrepository. At a high level the basic concepts of
operation are shared between the two projects but the actual usage is not
exactly the same.

.. _testrepository: https://testrepository.readthedocs.org/en/latest


Installing stestr
-----------------

stestr is available via pypi, so all you need to do is run::

  pip install -U stestr

to get stestr on your system. If you need to use a development version of
stestr you can clone the repo and install it locally with::

  git clone https://github.com/mtreinish/stestr.git && pip install -e stestr

which will install stestr in your python environment in editable mode for local
development

Using stestr
------------

After you install stestr to use it to run tests is pretty straightforward. The
first thing you'll want to do is create a ``.stestr.conf`` file for your
project. This file is used to tell stestr where to find tests and basic
information about how tests are run. A basic minimal example of the
contents of this is::

  [DEFAULT]
  test_path=./project_source_dir/tests

which just tells stestr the relative path for the directory to use for
test discovery. This is the same as ``--start-directory`` in the standard
`unittest discovery`_.

.. _unittest discovery: https://docs.python.org/3/library/unittest.html#test-discovery

Alternatively, if you're using stestr with
`tox <https://tox.readthedocs.io/en/latest/>`__ you can integrate your stestr
config in a ``stestr`` section in the tox.ini file, for example::

  [stestr]
  test_path=./project_source_dir/tests

After stestr is configured you should be all set to start using stestr
to run tests. To run tests just use::

    stestr run

it will first create a results repository at ``.stestr/`` in the current
working directory and then execute all the tests found by test discovery. If
you're just running a single test (or module) and want to avoid the overhead of
doing test discovery you can use the ``--no-discover``/``-n`` option to specify
that test.

For all the details on these commands and more thorough explanation of options
see the stestr manual: https://stestr.readthedocs.io/en/latest/MANUAL.html

Migrating from testrepository
-----------------------------

If you have a project that is already using testrepository stestr's source repo
contains a helper script for migrating your repo to use stestr. This script
just creates a ``.stestr.conf`` file from a ``.testr.conf`` file.
(assuming it uses a standard subunit.run test command format) To run
this from your project repo just call::

    $STESTR_SOURCE_DIR/tools/testr_to_stestr.py

and you'll have a ``.stestr.conf`` created.

Building a manpage
------------------

The stestr manual has been formatted so that it renders well as html and as a
manpage. The html output and is autogenerated and published to:
https://stestr.readthedocs.io/en/latest/MANUAL.html but the manpage has to be
generated by hand. To do this you have to manually run sphinx-build with the
manpage builder. This has been automated in a small script that should be run
from the root of the stestr repository::

  tools/build_manpage.sh

which will generate the troff file in doc/build/man/stestr.1 which is ready to
be packaged and or put in your system's man pages.

Contributing
------------

To browse the latest code, see: https://github.com/mtreinish/stestr
To clone the latest code, use: ``git clone https://github.com/mtreinish/stestr.git``

Guidelines for contribution are documented at: http://stestr.readthedocs.io/en/latest/developer_guidelines.html

Use `github pull requests`_ to submit patches. Before you submit a pull request
ensure that all the automated testing will pass by running ``tox`` locally.
This will run the test suite and also the automated style rule checks just as
they will in CI. If CI fails on your change it will not be able to merge.

.. _github pull requests: https://help.github.com/articles/about-pull-requests/

Community
---------

Besides Github interactions there is also a stestr IRC channel:

#stestr on `OFTC <https://oftc.net/>`__

feel free to join to ask questions, or just discuss stestr.




            

Raw data

            {
    "_id": null,
    "home_page": "http://stestr.readthedocs.io/en/latest/",
    "name": "stestr",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Matthew Treinish",
    "author_email": "mtreinish@kortar.org",
    "download_url": "https://files.pythonhosted.org/packages/11/5b/59a009a34bd51ca7e7cdd476bce6c6e331a78d87017bfe932cbfeeff3784/stestr-4.1.0.tar.gz",
    "platform": null,
    "description": "stestr\n======\n\n.. image:: https://github.com/mtreinish/stestr/actions/workflows/main.yml/badge.svg?branch=main\n    :target: https://github.com/mtreinish/stestr/actions/workflows/main.yml\n    :alt: CI Testing status\n\n.. image:: https://img.shields.io/codecov/c/gh/mtreinish/stestr?style=flat-square\n    :target: https://codecov.io/gh/mtreinish/stestr\n    :alt: Code coverage\n\n.. image:: https://img.shields.io/pypi/v/stestr.svg?style=flat-square\n    :target: https://pypi.python.org/pypi/stestr\n    :alt: Latest Version\n\n.. image:: https://img.shields.io/github/license/mtreinish/stestr.svg?style=popout-square\n    :target: https://opensource.org/licenses/Apache-2.0\n    :alt: License:\n\n* Read this in other languages: `English`_, `\u65e5\u672c\u8a9e`_\n* You can see the full rendered docs at: http://stestr.readthedocs.io/en/latest/\n* The code of the project is on Github: https://github.com/mtreinish/stestr\n\n.. _English: https://github.com/mtreinish/stestr/blob/main/README.rst\n.. _\u65e5\u672c\u8a9e: https://github.com/mtreinish/stestr/blob/main/README_ja.rst\n\n.. note:: stestr v2.x.x release series will be the last series that supports\n    Python 2. Support for Python 2.7 was dropped in stestr release 3.0.0.\n\nOverview\n--------\n\nstestr is parallel Python test runner designed to execute `unittest`_ test\nsuites using multiple processes to split up execution of a test suite. It also\nwill store a history of all test runs to help in debugging failures and\noptimizing the scheduler to improve speed. To accomplish this goal it uses the\n`subunit`_ protocol to facilitate streaming and storing results from multiple\nworkers.\n\n.. _unittest: https://docs.python.org/3/library/unittest.html\n.. _subunit: https://github.com/testing-cabal/subunit\n\nstestr originally started as a fork of the `testrepository`_ project. But,\ninstead of being an interface for any test runner that used subunit, like\ntestrepository, stestr concentrated on being a dedicated test runner for python\nprojects. While stestr was originally forked from testrepository it is not\nbackwards compatible with testrepository. At a high level the basic concepts of\noperation are shared between the two projects but the actual usage is not\nexactly the same.\n\n.. _testrepository: https://testrepository.readthedocs.org/en/latest\n\n\nInstalling stestr\n-----------------\n\nstestr is available via pypi, so all you need to do is run::\n\n  pip install -U stestr\n\nto get stestr on your system. If you need to use a development version of\nstestr you can clone the repo and install it locally with::\n\n  git clone https://github.com/mtreinish/stestr.git && pip install -e stestr\n\nwhich will install stestr in your python environment in editable mode for local\ndevelopment\n\nUsing stestr\n------------\n\nAfter you install stestr to use it to run tests is pretty straightforward. The\nfirst thing you'll want to do is create a ``.stestr.conf`` file for your\nproject. This file is used to tell stestr where to find tests and basic\ninformation about how tests are run. A basic minimal example of the\ncontents of this is::\n\n  [DEFAULT]\n  test_path=./project_source_dir/tests\n\nwhich just tells stestr the relative path for the directory to use for\ntest discovery. This is the same as ``--start-directory`` in the standard\n`unittest discovery`_.\n\n.. _unittest discovery: https://docs.python.org/3/library/unittest.html#test-discovery\n\nAlternatively, if you're using stestr with\n`tox <https://tox.readthedocs.io/en/latest/>`__ you can integrate your stestr\nconfig in a ``stestr`` section in the tox.ini file, for example::\n\n  [stestr]\n  test_path=./project_source_dir/tests\n\nAfter stestr is configured you should be all set to start using stestr\nto run tests. To run tests just use::\n\n    stestr run\n\nit will first create a results repository at ``.stestr/`` in the current\nworking directory and then execute all the tests found by test discovery. If\nyou're just running a single test (or module) and want to avoid the overhead of\ndoing test discovery you can use the ``--no-discover``/``-n`` option to specify\nthat test.\n\nFor all the details on these commands and more thorough explanation of options\nsee the stestr manual: https://stestr.readthedocs.io/en/latest/MANUAL.html\n\nMigrating from testrepository\n-----------------------------\n\nIf you have a project that is already using testrepository stestr's source repo\ncontains a helper script for migrating your repo to use stestr. This script\njust creates a ``.stestr.conf`` file from a ``.testr.conf`` file.\n(assuming it uses a standard subunit.run test command format) To run\nthis from your project repo just call::\n\n    $STESTR_SOURCE_DIR/tools/testr_to_stestr.py\n\nand you'll have a ``.stestr.conf`` created.\n\nBuilding a manpage\n------------------\n\nThe stestr manual has been formatted so that it renders well as html and as a\nmanpage. The html output and is autogenerated and published to:\nhttps://stestr.readthedocs.io/en/latest/MANUAL.html but the manpage has to be\ngenerated by hand. To do this you have to manually run sphinx-build with the\nmanpage builder. This has been automated in a small script that should be run\nfrom the root of the stestr repository::\n\n  tools/build_manpage.sh\n\nwhich will generate the troff file in doc/build/man/stestr.1 which is ready to\nbe packaged and or put in your system's man pages.\n\nContributing\n------------\n\nTo browse the latest code, see: https://github.com/mtreinish/stestr\nTo clone the latest code, use: ``git clone https://github.com/mtreinish/stestr.git``\n\nGuidelines for contribution are documented at: http://stestr.readthedocs.io/en/latest/developer_guidelines.html\n\nUse `github pull requests`_ to submit patches. Before you submit a pull request\nensure that all the automated testing will pass by running ``tox`` locally.\nThis will run the test suite and also the automated style rule checks just as\nthey will in CI. If CI fails on your change it will not be able to merge.\n\n.. _github pull requests: https://help.github.com/articles/about-pull-requests/\n\nCommunity\n---------\n\nBesides Github interactions there is also a stestr IRC channel:\n\n#stestr on `OFTC <https://oftc.net/>`__\n\nfeel free to join to ask questions, or just discuss stestr.\n\n\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "A parallel Python test runner built around subunit",
    "version": "4.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/mtreinish/stestr/issues",
        "Documentation": "https://stestr.readthedocs.io",
        "Homepage": "http://stestr.readthedocs.io/en/latest/",
        "Source Code": "https://github.com/mtreinish/stestr"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6fd5ccd9012e62b46d0349f91a03d82b90f59433854f2d74a457a11b21f38b3b",
                "md5": "d6adaaf294b0c1302177424b023873ac",
                "sha256": "f319326588c39528b9a69083f0be58ab68d040de2c5dbfdc784b2de028d7d293"
            },
            "downloads": -1,
            "filename": "stestr-4.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d6adaaf294b0c1302177424b023873ac",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 117951,
            "upload_time": "2023-09-18T12:36:18",
            "upload_time_iso_8601": "2023-09-18T12:36:18.547842Z",
            "url": "https://files.pythonhosted.org/packages/6f/d5/ccd9012e62b46d0349f91a03d82b90f59433854f2d74a457a11b21f38b3b/stestr-4.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "115b59a009a34bd51ca7e7cdd476bce6c6e331a78d87017bfe932cbfeeff3784",
                "md5": "8b280f330650ec4b350fc06f62180344",
                "sha256": "5f61c369eece63c292d13599e12aa158af7685990643f24dd6fa7fabfe34e98a"
            },
            "downloads": -1,
            "filename": "stestr-4.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8b280f330650ec4b350fc06f62180344",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 113187,
            "upload_time": "2023-09-18T12:36:20",
            "upload_time_iso_8601": "2023-09-18T12:36:20.458100Z",
            "url": "https://files.pythonhosted.org/packages/11/5b/59a009a34bd51ca7e7cdd476bce6c6e331a78d87017bfe932cbfeeff3784/stestr-4.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-18 12:36:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mtreinish",
    "github_project": "stestr",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "stestr"
}
        
Elapsed time: 0.22331s