{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "# Wooqi test sequencer\n\n[![PyPI version fury.io](https://img.shields.io/pypi/v/wooqi.png)](https://pypi.python.org/pypi/wooqi/)\n[![PyPI license](https://img.shields.io/pypi/l/wooqi.svg)](https://pypi.python.org/pypi/wooqi/)\n[![Build Status](https://travis-ci.org/aldebaran/wooqi.svg?branch=master)](https://travis-ci.org/aldebaran/wooqi)\n\n## Introduction\n\n**Wooqi** is a fork of the [Python](https://www.python.org) module named\n[pytest](http://pytest.org). It allows to code tests in a very special way. It is a usefull tool to\nmanage a big database of tests, as it simplifies their creation, their maintenance, and their\nexecution.\n\nWooqi hacks the standard use of pytest to introduce new mechanics, in order to apply a precise\ntesting methodology which can be described by the following key points:\n\n* There is a *test steps* database.\n* There is a *test sequences* database, where each sequence is\ncomposed of one or several test steps picked from the *test steps* database.\n* There are some *common tools* (custom python classes or functions)\nand *fixtures* which all can be used by any test step.\n* Users can execute a single test sequence with a single command line.\n* All reports and logs of test sequences are saved in a common *reports* database.\n\nCreation of logs, parametrization of tests, report reading, and tests scheduling are some examples\nof the things which are simplified with wooqi. Moreover, the generic aspect of this tool allows to\nuse it for any kind of target under test, as long as you can respect its methodology.\n\nFinally, it is important to note that **Wooqi** does not contain any test itself. It is a just a\ntool to execute tests which are written in what we call a **Wooqi project**. In this way, you can\nhave several **Wooqi projects** on your machine, each one having its own specific features, while\nusing only one tool (the **Wooqi** plugin) to execute any test in any project.\n\nFor the reasons listed above, Wooqi can be considered as an independant tool instead of a simple\npytest plugin.\n\n## Installation\n\nYou can install wooqi as a pip package.\n\n pip install wooqi --user\n\nOr you can clone the depository, and manually build and install the package:\n\n python setup.py bdist\n pip install dist/\n\nWhere `` is the name of the wooqi package with its version\n\n## Your wooqi project\n\nWooqi is only a test sequencer and does not contain some tests itself. It means that you must create\nyour own project containing your own tests, which will be read and executed by Wooqi.\n\n### Create a new project\n\nTo automatically initialize a new Wooqi project, use the following command line:\n\n wooqi --init-project MY_PROJECT\n\nReplace MY_PROJECT by the path of your project directory (can be relative or absolute). This\ncreates the necessary sub-directories and files for your project. Most of the files are empty, as\nthey are just some examples.\n\nThe tree view of the created project is just a suggestion and is not mandatory for Wooqi to work.\nYou can customize your Wooqi project as you like, as long as you respect the following rules (please\nread the next sections to fully understand these rules):\n\n1. Fixtures must be imported in *conftest.py* at the root of the project.\n2. *setup.cfg* must be at\nthe root of the project. (Please see **Advanced functionalities** section)\n3. Test steps, actions, and sequences must respect the rules that are given in their dedicated section.\n\n### Write tests\n\n#### Write a test step\n\nA test step is simply a python function with an **assertion** in it. The following rules must be\nobserved:\n\n* One test step is represented by one function.\n* A test step can be written in a file in any directory (default directory is *test_steps*).\n* The name of this file must start with \"*test_*\".\n* A test step name must start with \"*test_*\" Assertions in a test step must observe the [guidelines\nof the pytest module](https://docs.pytest.org/en/latest/assert.html).\n* Arguments of a test step must be picked from [existing fixtures](#write-your-own-fixtures) and the **Wooqi** special\narguments given below.\n For more information about these special arguments, please see the \"*test sequences*\" section of\n this documentation.\n * uut\n * uut2\n * test_info\n* A test step can use any python function from any other file as long as it is\nimported. It is standard python !\n\n#### Write an action\n\nAn action is almost the same than a test step, except it does not necessarily have an assertion.\nThe following rules must be observed:\n\n* One action is represented by one function.\n* An action can be written in a file in any directory (default directory is *actions_step*).\n* The name of this file must start with \"*actions_*\".\n* An action name must start with \"*action_*\".\n* An action can contain an assertion like a test step but this is not mandatory.\n* Arguments of an action follow the same rule than for a test step.\n* An action can use any python function from any other file as long as it is imported.\nIt is standard python !\n\n#### Write a test sequence\n\n##### Basics\n\n A test is described in a configuration file (*.ini*). This file can be in any directory (default is\n *sequences*). As a result this file contains several sections with some attributes, like this:\n\n```ini\n[my_section]\nattr1=value1\nattr2=value2\n```\n\nThere is one initial section that could be present in these configuration files:\n\n* **[test_info]** It contains information about the sequence itself.\n Following attributes can be present in this section:\n * **loop_tests**: Used to make loops in the sequence.\n Please refer to the [dedicated section](#make-loops-in-the-test-sequence)\n * **loop_iter**: Used to make loops in the sequence.\n Please refer to the [dedicated section](#make-loops-in-the-test-sequence)\n\nOther sections are referring to test steps or actions. Any step or action can be picked from the\ntest_steps directory simply by writing its name as the section name.\n\n**Example:**\n`[test_battery_charge]`. Some attributes of this section are used to organize this step in the test,\nand some others are given to the step function as parameters. The step order is defined by the\norder of definition in the .ini\n\nHere is a list of attributes that could be written in step/action sections:\n\n* **post_fail**: *TBC*\n* **reruns**: *TBC*\n* **uut**: *TBC*\n* **uut2**: *TBC*\n* *[...TBC...]*\n\n##### Call the same step several times in a single sequence\n\nIf you need to call the same test step several times, there is a special syntax. You must add \"\\_X\"\nat the end of the test name, increasing the number \"X from \"0\" as follow :\n\n```ini\n[test_foo_0] ; Start with 0\nuut=dummy1\n\n[test_foo_1] ; Continue with 1\nuut=dummy2\n\n[test_foo_X] ; and so on...\nuut=dummy3\n```\n\n##### Make loops in the test sequence\n\nYou must add two attributes in the `[test_info]` section:\n\n* **loop_tests=a|b** where a and b are the names of the first and the last steps of the loop.\n* **loop_iter=k** where k is the number of iterations of the loop.\n\nIn the following example, the sequence *test_b --> test_c --> test_d* will be repeated 2 times:\n\n```ini\n[test_info]\nloop_tests=test_b|test_d\nloop_iter=2\n\n[test_a]\n\n[test_b]\n\n[test_c]\n\n[test_d]\n\n[test_e]\n```\n\n### Run a test sequence\n\nTo launch a test, move to the root of your project depository and run the following command:\n\n wooqi --seq-config TEST_SEQUENCE_FILE --sn SAMPLE_NAME [-s] [-k TEST_NAME] [--lf]\n\nWhere:\n\n* **[--seq-config TEST_SEQUENCE_FILE]** (required) relative path to the .ini file of the test sequence.\n* **[--sn SAMPLE_NAME]** (required) Sample Name. Used to name the logs.\n* **[-s]** Display logs and print output in the console.\n* **[-k TEST_NAME]** Execute the specified tests only (name can be incomplete).\n* **[-lf]** Execute the last failed test only.\n\nExample:\n\n wooqi --seq-config test_sequences/folder1/seq1.ini --sn mySample\n\n### Rerun a test sequence since the first fail\n\nTo rerun sequence since the first test failed, use the same command and add --ff option\n(--failed-first):\n\n wooqi --seq-config TEST_SEQUENCE_FILE --sn SAMPLE_NAME --ff\n\nIf sequence fail in loop, all test of the loop are rerun.\n\nYou can defined a previous test or action required. If the test failed has a requirement, the\nsequence rerun since the test defined to the .ini file.\n\n```ini\n[test_a]\n\n[test_b]\n\n[test_c]\ntest_required='test_b'\n\n[test_d]\ntest_required='test_b'\n\n[test_e]\n```\n\n### Advanced functionalities\n\n\n#### Write tools\n\nSteps may need external functions that are useful for several of them. These functions, that we call\n\"tools\" can be written in any python files. Afterwards they can be imported in python files which\ncontain steps and/or fixtures, and called within the steps. The only rule that is mandatory not to\nconfuse wooqi is to avoid naming these functions with a name that starts with \"test_\" or \"action_\",\nas these names are only used for steps and actions.\n\n#### Configure wooqi\n\nCopy the file `wooqi_conf_template.cfg` at the root of your project directory, and rename it\n`wooqi_conf.cfg`.\n\nThis file will be read by *wooqi* and allows you to customize several features of it. All the\navailable parameters and their use are explained in this template.\n\n#### Write your own fixtures\n\nThe concept of fixtures is a nice feature provided by Py.test. To get more information about it,\nplease read the official [documentation](https://docs.pytest.org/en/latest/fixture.html).\nThe only difference with Wooqi, it's just that you have to import the custom pytest module included in Wooqi:\n\n```python\nimport wooqi_pytest\n\n@wooqi_pytest.fixture()\ndef my_fixture():\n \"\"\"Example of wooqi fixture.\"\"\"\n pass\n```\n\n\nYou can add your own fixtures to your project in any file you want. Then, each one of your steps can\ncall a fixture as one of its arguments. These fixtures will be called before and/or after the\nexecution of the step in the sequence.\n\n#### Write your own wooqi hooks\n\nWooqi offers all the pytest hooks that allow to insert custom code in the middle of the\nexecution of wooqi. To get more information about these, please read the official\n[documentation](https://docs.pytest.org/en/latest/writing_plugins.html#writinghooks).\n\nYou can add your own custom hooks in your wooqi project.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://pypi.org/project/wooqi/", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/aldebaran/wooqi", "keywords": "", "license": "BSD-3", "maintainer": "", "maintainer_email": "", "name": "wooqi", "package_url": "https://pypi.org/project/wooqi/", "platform": "unix", "project_url": "https://pypi.org/project/wooqi/", "project_urls": { "Download": "https://pypi.org/project/wooqi/", "Homepage": "https://github.com/aldebaran/wooqi" }, "release_url": "https://pypi.org/project/wooqi/2.0.1/", "requires_dist": null, "requires_python": "", "summary": "Python module allowing to parametrize all a test sequence thanks to a config file", "version": "2.0.1" }, "last_serial": 4677635, "releases": { "1.2.0": [ { "comment_text": "", "digests": { "md5": "2018f7e066486d6dabac46d19aad67ae", "sha256": "02b05812fb49f46ee31b34345d0d8cf707762183f65eef48620554da5093af85" }, "downloads": -1, "filename": "wooqi-1.2.0.tar.gz", "has_sig": false, "md5_digest": "2018f7e066486d6dabac46d19aad67ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11856, "upload_time": "2017-11-14T14:58:19", "url": "https://files.pythonhosted.org/packages/8b/8d/d58854778d55aa6bce23fc5f083e7c381b98f677ea8baf29f2a983b2612f/wooqi-1.2.0.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "e0250e471d6c6291a30796710743ca35", "sha256": "7878110d38337a669cdc81a102eacea726ad3054bc5a4a13219db3181505814c" }, "downloads": -1, "filename": "wooqi-1.2.2.tar.gz", "has_sig": false, "md5_digest": "e0250e471d6c6291a30796710743ca35", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26538, "upload_time": "2018-10-26T09:19:28", "url": "https://files.pythonhosted.org/packages/a7/15/501aaa73f7fe942be03c8f8a18625e13c7409bf35d41e2e416170a375688/wooqi-1.2.2.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "1c0860d1fd7c6aa7f77141a65e5f5b14", "sha256": "21d452f32953ebf24ebbcddfe2ec179b98713bac40e8c467710f0f5978381e91" }, "downloads": -1, "filename": "wooqi-2.0.1.tar.gz", "has_sig": false, "md5_digest": "1c0860d1fd7c6aa7f77141a65e5f5b14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 191449, "upload_time": "2019-01-09T17:12:46", "url": "https://files.pythonhosted.org/packages/fb/c3/a41b0754a2a34d900ca618079ac384fbf86cb6c2c213bd9157bf96c233f3/wooqi-2.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1c0860d1fd7c6aa7f77141a65e5f5b14", "sha256": "21d452f32953ebf24ebbcddfe2ec179b98713bac40e8c467710f0f5978381e91" }, "downloads": -1, "filename": "wooqi-2.0.1.tar.gz", "has_sig": false, "md5_digest": "1c0860d1fd7c6aa7f77141a65e5f5b14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 191449, "upload_time": "2019-01-09T17:12:46", "url": "https://files.pythonhosted.org/packages/fb/c3/a41b0754a2a34d900ca618079ac384fbf86cb6c2c213bd9157bf96c233f3/wooqi-2.0.1.tar.gz" } ] }