Merge "add develop guide for testapi"
[releng.git] / utils / test / testapi / docs / developer / devguide / overview.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. (c) 2017 ZTE Corporation
4
5
6 ********
7 Overview
8 ********
9
10 TestAPI uses Python as primary programming language and build the framework from the following packages
11
12 ======== ===============================================================================================================
13 Module   Package
14 ======== ===============================================================================================================
15 api      `Tornado-Motor`_ - API applications using Motor with tornado
16 swagger  `tornado-swagger`_ - a wrapper for tornado which enables swagger-ui-v1.2 support
17 web      `angular`_ - a superheroic JavaScript MVW framework, the version is AngularJS v1.3.15
18 docs     `sphinx`_ - a tool that makes it easy to create intelligent and beautiful documentation
19 testing  `pytest`_ - a mature full-featured Python testing tool that helps you write better programs
20 ======== ===============================================================================================================
21
22
23 Source Code
24 ===========
25
26 The structure of repository is based on the recommended sample in `The Hitchhiker's Guide to Python`_
27
28 ==========================  ====================================================================================================
29 Path                        Content
30 ==========================  ====================================================================================================
31 ``./3rd_party/``            third part included in TestAPI project
32 ``./docker/``               configuration for building Docker image for TestAPI deployment
33 ``./docs/``                 user and developer documentation, design proposals
34 ``./etc/``                  configuration files used to install opnfv-testapi
35 ``./opnfv_testapi/``        the actual package
36 ``./opnfv_testapi/tests/``  package functional and unit tests
37 ``./opts/``                 optional components, e.g. one click deployment script
38 ==========================  ====================================================================================================
39
40
41 Coding Style
42 ============
43
44 TestAPI follows `OpenStack Style Guidelines`_ for source code and commit message.
45
46 Specially, it is recommended to link each patch set with a JIRA issue. Put::
47
48     JIRA: RELENG-n
49
50 in commit message to create an automatic link.
51
52
53 Testing
54 =======
55
56 All testing related code are stored in ``./opnfv_testapi/tests/``
57
58 ==================  ====================================================================================================
59 Path                Content
60 ==================  ====================================================================================================
61 ``./tests/unit/``   unit test for each module, follow the same layout as ./opnfv_testapi/
62 ``./conftest.py``   pytest configuration in project scope
63 ==================  ====================================================================================================
64
65 `tox`_ is used to automate the testing tasks
66
67 .. code-block:: shell
68
69     cd <project_root>
70     pip install tox
71     tox
72
73 The test cases are written in `pytest`_. You may run it selectively with
74
75 .. code-block:: shell
76
77     pytest opnfv_testapi/tests/unit/common/test_config.py
78
79
80 Branching
81 =========
82
83 Currently, no branching for TestAPI, only master branch
84
85
86 Releasing
87 =========
88
89 Currently, TestAPI does not follow community's milestones and releases
90
91 .. _Tornado-Motor: https://motor.readthedocs.io/en/stable/tutorial-tornado.html
92 .. _tornado-swagger: https://github.com/SerenaFeng/tornado-swagger
93 .. _angular: https://code.angularjs.org/1.3.15/docs/guide
94 .. _sphinx: http://www.sphinx-doc.org/en/stable/
95 .. _pytest: http://doc.pytest.org/
96 .. _OpenStack Style Guidelines: http://docs.openstack.org/developer/hacking/
97 .. _The Hitchhiker's Guide to Python: http://python-guide-pt-br.readthedocs.io/en/latest/writing/structure/
98 .. _tox: https://tox.readthedocs.io/