nose-parallel


Namenose-parallel JSON
Version 0.4.0 PyPI version JSON
download
home_pagehttps://github.com/dlanger/nose-parallel
SummaryA nosetests plugin to split test suites to run in parallel
upload_time2020-05-01 21:14:31
maintainer
docs_urlNone
authorDaniel Langer
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            nose-parallel
=============

A plugin to help split up your tests runs across multiple machines.

In an ideal world, test suites should be fast enough that they can
be run locally on a single machine without extra engineering. This
plugin is there to help when you can't make that to happen.

This **won't** help you run tests in parallel on one machine in different
threads; that's what the built-in `multiprocess
<http://nose.readthedocs.org/en/latest/plugins/multiprocess.html>`_ plugin
is for.

This **will** help you split up your test suites so that you can run the
suites on multiple machines and not have the same test run twice - think
Jenkins with the
`multijob <https://wiki.jenkins-ci.org/display/JENKINS/Multijob+Plugin>`_
plugin, or CI services like `CircleCI <https://circleci.com/docs/parallel-manual-setup>`_.


Install
-------

.. code:: bash

   pip install nose-parallel


Usage
-----

On each machine:

#. Export environment variables ``NODE_TOTAL`` (the number of machines on which the suite will be run) and and ``NODE_INDEX`` (the 0-based index of the current machine)
#. Run nosetests with the ``--with-parallel`` flag
#. Do something to join the results from all the machines back together

For example, this is how we'd run nosetests on the second machine in a
four-machine testing cluster:

.. code:: bash

   NODE_TOTAL=4 NODE_INDEX=1 nosetests --with-parallel


If you don't set those variables, ``nose-parallel`` will do the right thing and run all your tests.
It also supports natively the default environment variables from:

- CircleCI
- Buildkite
- GitLab CI

We welcome PRs that add native support for other CI alternatives.

If you want to further randomize the distribution of tests, so
that the same test cases don't always run together on the same node, you may
use the ``--parallel-salt`` option or ``NOSE_PARALLEL_SALT`` environment variable 
to specify a salt value for the randomization (e.g. a build number, the day of the month). 
The salt must be the same on each node during a parallel build, otherwise some test cases might be missed. 

For example, on CircleCI you could do:

.. code:: bash

    nosetests --with-parallel --parallel-salt-env CIRCLE_BUILD_NUM

By default ``nose-parallel`` will split tests based on method and function names. You can customize this strategy by setting the ``--parallel-strategy`` option. Supported strategies are: 'CLASS', 'DIRECTORY', 'FILE', 'METHOD', 'FUNCTION' and 'MODULE'.

For example, to split tests based on the file names:

.. code:: bash

    nosetests --with-parallel --parallel-strategy=FILE

License
-------

``nose-parallel`` is released under the MIT license.


Contribute
----------

- Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
- Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).
- Send a pull request and bug the maintainer until it gets merged and published.


Thanks To
---------

- `@mahmoudimus <https://github.com/mahmoudimus>`_, whose `nose-timer <https://github.com/mahmoudimus/nose-timer>`_ plugin this is based off of



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dlanger/nose-parallel",
    "name": "nose-parallel",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Daniel Langer",
    "author_email": "daniel@langer.me",
    "download_url": "https://files.pythonhosted.org/packages/70/60/039898d68516d2086db9b8ec8e318f84f44a15a8584b2abdfc2d97980a68/nose-parallel-0.4.0.tar.gz",
    "platform": "",
    "description": "nose-parallel\n=============\n\nA plugin to help split up your tests runs across multiple machines.\n\nIn an ideal world, test suites should be fast enough that they can\nbe run locally on a single machine without extra engineering. This\nplugin is there to help when you can't make that to happen.\n\nThis **won't** help you run tests in parallel on one machine in different\nthreads; that's what the built-in `multiprocess\n<http://nose.readthedocs.org/en/latest/plugins/multiprocess.html>`_ plugin\nis for.\n\nThis **will** help you split up your test suites so that you can run the\nsuites on multiple machines and not have the same test run twice - think\nJenkins with the\n`multijob <https://wiki.jenkins-ci.org/display/JENKINS/Multijob+Plugin>`_\nplugin, or CI services like `CircleCI <https://circleci.com/docs/parallel-manual-setup>`_.\n\n\nInstall\n-------\n\n.. code:: bash\n\n   pip install nose-parallel\n\n\nUsage\n-----\n\nOn each machine:\n\n#. Export environment variables ``NODE_TOTAL`` (the number of machines on which the suite will be run) and and ``NODE_INDEX`` (the 0-based index of the current machine)\n#. Run nosetests with the ``--with-parallel`` flag\n#. Do something to join the results from all the machines back together\n\nFor example, this is how we'd run nosetests on the second machine in a\nfour-machine testing cluster:\n\n.. code:: bash\n\n   NODE_TOTAL=4 NODE_INDEX=1 nosetests --with-parallel\n\n\nIf you don't set those variables, ``nose-parallel`` will do the right thing and run all your tests.\nIt also supports natively the default environment variables from:\n\n- CircleCI\n- Buildkite\n- GitLab CI\n\nWe welcome PRs that add native support for other CI alternatives.\n\nIf you want to further randomize the distribution of tests, so\nthat the same test cases don't always run together on the same node, you may\nuse the ``--parallel-salt`` option or ``NOSE_PARALLEL_SALT`` environment variable \nto specify a salt value for the randomization (e.g. a build number, the day of the month). \nThe salt must be the same on each node during a parallel build, otherwise some test cases might be missed. \n\nFor example, on CircleCI you could do:\n\n.. code:: bash\n\n    nosetests --with-parallel --parallel-salt-env CIRCLE_BUILD_NUM\n\nBy default ``nose-parallel`` will split tests based on method and function names. You can customize this strategy by setting the ``--parallel-strategy`` option. Supported strategies are: 'CLASS', 'DIRECTORY', 'FILE', 'METHOD', 'FUNCTION' and 'MODULE'.\n\nFor example, to split tests based on the file names:\n\n.. code:: bash\n\n    nosetests --with-parallel --parallel-strategy=FILE\n\nLicense\n-------\n\n``nose-parallel`` is released under the MIT license.\n\n\nContribute\n----------\n\n- Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.\n- Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).\n- Send a pull request and bug the maintainer until it gets merged and published.\n\n\nThanks To\n---------\n\n- `@mahmoudimus <https://github.com/mahmoudimus>`_, whose `nose-timer <https://github.com/mahmoudimus/nose-timer>`_ plugin this is based off of\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A nosetests plugin to split test suites to run in parallel",
    "version": "0.4.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "7f5dab96cd569f40a1e6458adc518f05",
                "sha256": "3f7c48d7aa5030fe872211cbffc6852e64e4e356ddbac5958a35796bf15dc225"
            },
            "downloads": -1,
            "filename": "nose_parallel-0.4.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7f5dab96cd569f40a1e6458adc518f05",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 5125,
            "upload_time": "2020-05-01T21:14:30",
            "upload_time_iso_8601": "2020-05-01T21:14:30.689431Z",
            "url": "https://files.pythonhosted.org/packages/64/08/9968ef72b3ee8f3243e1f300219afdfb753a3432b203afe9bef56e34ce95/nose_parallel-0.4.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "adaf1b0da5a84b0f24ee692917872a8e",
                "sha256": "e4e6d6891a4bb417f09abf1f400554f557f0a9df3fdaed6517d4236e87ed0f51"
            },
            "downloads": -1,
            "filename": "nose-parallel-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "adaf1b0da5a84b0f24ee692917872a8e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4594,
            "upload_time": "2020-05-01T21:14:31",
            "upload_time_iso_8601": "2020-05-01T21:14:31.708973Z",
            "url": "https://files.pythonhosted.org/packages/70/60/039898d68516d2086db9b8ec8e318f84f44a15a8584b2abdfc2d97980a68/nose-parallel-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-05-01 21:14:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "dlanger",
    "github_project": "nose-parallel",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nose-parallel"
}
        
Elapsed time: 0.01950s