{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "==========\nnose-knows\n==========\n\n**nose-knows** is a nose plugin for figuring out which unit tests you should\nrun after modifying code. It works by tracing your code while you run unit\ntests, and creating an output file that can be used later.\n\nInstalling\n==========\n\nYou can install **nose-knows** through ``pip`` or ``easy-install``::\n\n pip install nose-knows\n\nOr you can download the `latest development version`_, which may\ncontain new features.\n\nUsing nose-knows\n================\n\n**nose-knows** can be invoked in either input or output mode. In output mode\n(``--knows-out``) it will generate a ``.knows`` file that contains the mapping\nfrom a file in your code tree to the set of unit tests that run it. In input\nmode, it uses the ``.knows`` file to selectively run unit tests based on the\nfiles you pass in. Note: here, ``$BASE_DIR`` is the name of the base project\ndirectory, not the (direct / relative) path to it. It is used to figure out how\nto rename the file names in the output file to make it more portable.\n\nCreating a ``.knows`` file::\n\n eyal-01575:src eyal$ nosetests --with-knows --knows-dir=$BASE_DIR --knows-out\n .....................................................................\n ----------------------------------------------------------------------\n Ran 62 tests in 0.444s\n\n OK\n\nThe ``.knows`` file now contains the following::\n\n warehouse/src/load_data/sql_utils/checkpoints.py:\n src.tests.test_load_data_statements:TestSQLStatement.test_finalize\n src.tests.test_load_data_checkpoints:TestCheckpoints.test_checkpoint_finalize_with_delete\n src.tests.test_load_data_checkpoints:TestCheckpoints.test_checkpoint_finalize\n src.tests.test_load_data_checkpoints:TestCheckpoints.test_checkpoint_with_previous_checkin\n src.tests.test_load_data_checkpoints:TestCheckpoints.test_checkpoint\n src.tests.test_load_data_statements:TestSQLStatement.test_to_sql_import\n src.tests.test_load_data_statements:TestSQLStatement.test_to_sql_schema_update\n\nYou can now run **nose-knows** in input mode, passing in\n``load_data/sql_utils/checkpoints.py``::\n\n eyal-01575:src eyal$ nosetests --with-knows --knows-dir=$BASE_DIR load_data/sql_utils/checkpoints.py\n .......\n ----------------------------------------------------------------------\n Ran 7 tests in 0.003s\n\n OK\n\nThere is also (experimental at this point) support for py.test. You can\ngenerate your ``.knows`` file via::\n\n eyal-01575:src eyal$ py.test --with-knows --knows-dir=$BASE_DIR --knows-out\n ===================== test session starts ======================\n platform darwin -- Python 2.7.1 -- pytest-2.3.4\n plugins: nose-knows\n collected 62 items\n\n tests/test_load_data_checkpoints.py ....\n tests/test_load_data_from_mysql.py ..\n tests/test_load_data_statements.py .....\n tests/test_process_data_denormalize.py ........\n tests/test_process_data_mapping.py .....\n tests/test_transform_data_daemon.py .\n tests/test_transform_data_table_follower.py .................\n tests/test_transformers/test_avg_data.py ..\n tests/test_transformers/test_count.py ...\n tests/test_transformers/test_join.py ....\n tests/test_transformers/test_json_data.py .....\n tests/test_transformers/test_min_data.py ..\n tests/test_transformers/test_std_data.py ..\n tests/test_transformers/test_sum_data.py ..\n\n ================== 62 passed in 2.18 seconds ===================\n\nAnd selectively run specific unit tests like so::\n\n eyal-01575:src eyal$ py.test --with-knows --knows-dir=$BASE_DIR load_data/sql_utils/checkpoints.py\n ===================== test session starts ======================\n platform darwin -- Python 2.7.1 -- pytest-2.3.4\n plugins: nose-knows\n collected 62 items\n\n tests/test_load_data_checkpoints.py ....\n tests/test_load_data_statements.py ...\n\n =================== 7 passed in 0.30 seconds ===================\n\nThe best practice here is to have a system like Jenkins run the unit test suite\nonce in a while to create this map (we have it running daily), and then\ncreating a bash function/script to download the knows output file from Jenkins\nand run it against the set of changed files from a commit. Ours looks like::\n\n function grab_latest_knows_output() {\n NOW=`date +%s`\n if [ ! -f $KNOWS_FILE_TMP ] ; then\n curl --compressed $KNOWS_FILE_URL > $KNOWS_FILE_TMP\n else\n KNOWS_FILE_AGE=`stat -c %Y $KNOWS_FILE_TMP`\n if [ `expr $NOW - $KNOWS_FILE_AGE` -gt \"86400\" ] ; then\n curl --compressed $KNOWS_FILE_URL > $KNOWS_FILE_TMP\n else\n echo \"Using latest knows output file.\"\n fi\n fi\n }\n\n function test_changed() {\n grab_latest_knows_output\n nosetests $KNOWS_FLAGS `git diff --name-only --cached origin | xargs`\n }\n\n function run_tests_for() {\n grab_latest_knows_output\n nosetests $KNOWS_FLAGS $@\n }\n\nLicense\n========\n\n**nose-knows** is copyright 2013 Eventbrite and Contributors, and is made\navailable under BSD-style license; see LICENSE for details.\n\n.. _`latest development version`: https://github.com/eventbrite/nose-knows/tarball/master#egg=nose-nose\n\n\nNews\n====\n\n0.1.2\n-----\n\nAdding support for non-unittest based tests with nose.\n\n0.1.1\n-----\n\nMinor bug fix to make the nose plugin more resilient to bad test names.\n\n0.1\n-----\n\n*Release date: April 2nd, 2012*\n\n* Initial write of nose-knows, including support for nose and experimental\n support for py.test\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/eventbrite/nose-knows", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "nose-knows", "package_url": "https://pypi.org/project/nose-knows/", "platform": "", "project_url": "https://pypi.org/project/nose-knows/", "project_urls": { "Homepage": "https://github.com/eventbrite/nose-knows" }, "release_url": "https://pypi.org/project/nose-knows/0.2/", "requires_dist": null, "requires_python": "", "summary": "", "version": "0.2" }, "last_serial": 2913964, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "87195be8ea0b029013d121514e0caec3", "sha256": "eab423ecb6eed02c86fdc3ad7abdca505c507f00ae87e57f37314b4e59e3f3fe" }, "downloads": -1, "filename": "nose-knows-0.1.tar.gz", "has_sig": false, "md5_digest": "87195be8ea0b029013d121514e0caec3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5534, "upload_time": "2013-04-02T17:32:49", "url": "https://files.pythonhosted.org/packages/74/48/5085065469c927b051c6dcb7d370a9c70730fffd8720e72df52c6ec9e311/nose-knows-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "1f815b310502f46b0fca4b5135c1f09a", "sha256": "810b89f009c09b55ddcee79fb3d5590b8def9cc17e6824aa9e6d7ca3ca0576a5" }, "downloads": -1, "filename": "nose-knows-0.1.1.tar.gz", "has_sig": false, "md5_digest": "1f815b310502f46b0fca4b5135c1f09a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5653, "upload_time": "2013-04-23T21:08:55", "url": "https://files.pythonhosted.org/packages/73/27/1f83e1c750c01d02e937f3a2d281d422e2229add260db320fcc29486c161/nose-knows-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "33b0305acc778ecbd47796acd8717d2b", "sha256": "83765cfea91af6eb3ac922e631e09c9ec545fbafae1c58ef0a386df5f30fbb6f" }, "downloads": -1, "filename": "nose_knows-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "33b0305acc778ecbd47796acd8717d2b", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9623, "upload_time": "2015-01-20T19:33:53", "url": "https://files.pythonhosted.org/packages/c7/ce/2f987fbbbe87ffe41a222052d22c616c6532a0ccc1aedaedbd9efe611068/nose_knows-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "30ea7dfe90a18823f1d96215bf77d658", "sha256": "a28bc962785de60a89374a4100415748e31df88c2ecd3e8f08a4ebb6eeb20f72" }, "downloads": -1, "filename": "nose-knows-0.1.2.tar.gz", "has_sig": false, "md5_digest": "30ea7dfe90a18823f1d96215bf77d658", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6907, "upload_time": "2015-01-20T19:33:51", "url": "https://files.pythonhosted.org/packages/ed/2a/0cbb40526809262c04e855fa4fd6f70aeb175a56be2746bf997630659285/nose-knows-0.1.2.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "b92a10caf848ffee70db91d7981ab6fd", "sha256": "caaaa2138d0d7e9c1a17f19a7479dd9507749a69d91aaeec83569c09386d9cea" }, "downloads": -1, "filename": "nose_knows-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b92a10caf848ffee70db91d7981ab6fd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9705, "upload_time": "2017-05-31T16:44:18", "url": "https://files.pythonhosted.org/packages/e6/72/50246fec1c2db153fc67760eed0749d0ffc7ebb91065e611acc3c016c631/nose_knows-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "76e9130354d70f3a946d00a365d68fe7", "sha256": "3ac979adb044ffc8b0a33a357c34dc255ed91141857be5c1755906880b8a1b75" }, "downloads": -1, "filename": "nose-knows-0.2.tar.gz", "has_sig": false, "md5_digest": "76e9130354d70f3a946d00a365d68fe7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7019, "upload_time": "2017-05-31T16:44:19", "url": "https://files.pythonhosted.org/packages/44/99/d2dfbd0ec485069b54cb420fd1f1e57c918818d675600000171cf505fdd1/nose-knows-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b92a10caf848ffee70db91d7981ab6fd", "sha256": "caaaa2138d0d7e9c1a17f19a7479dd9507749a69d91aaeec83569c09386d9cea" }, "downloads": -1, "filename": "nose_knows-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b92a10caf848ffee70db91d7981ab6fd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9705, "upload_time": "2017-05-31T16:44:18", "url": "https://files.pythonhosted.org/packages/e6/72/50246fec1c2db153fc67760eed0749d0ffc7ebb91065e611acc3c016c631/nose_knows-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "76e9130354d70f3a946d00a365d68fe7", "sha256": "3ac979adb044ffc8b0a33a357c34dc255ed91141857be5c1755906880b8a1b75" }, "downloads": -1, "filename": "nose-knows-0.2.tar.gz", "has_sig": false, "md5_digest": "76e9130354d70f3a946d00a365d68fe7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7019, "upload_time": "2017-05-31T16:44:19", "url": "https://files.pythonhosted.org/packages/44/99/d2dfbd0ec485069b54cb420fd1f1e57c918818d675600000171cf505fdd1/nose-knows-0.2.tar.gz" } ] }