1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
13 **Test Results Collector of OPNFV Test Projects**:
15 This project aims to provide a common way of gathering all the test results for OPNFV
16 testing projects into a single place, and a unified way of getting those results for
17 testing analysis projects, such as Reporting/Bitergia Dashboard/Qtip. It exposes
18 Restful APIs for collecting results and pushing them into a MongoDB database.
20 If you are interested in how TestAPI looks like, please visit OPNFV's official `TestAPI Server`__
22 .. __: http://testresults.opnfv.org/test
27 TestAPI leverages MongoDB as the data warehouse, in order to let it work
28 successfully, a MongoDB must be provided, the official MongoDB version in OPNFV
29 TestAPI is 3.2.6. And the database is **test_results_collection**, the five
30 collections are *users/pods/projects/testcases/scenarioes/results*. And thanks to
31 MongoDB's very user-friendly property, they don't need to be created in advance.
39 All requirements are listed in requirements.txt and should be
40 installed by 'pip install':
42 *pip install -r requirements.txt*
47 *python setup.py install*
49 After installation, configuration file etc/config.ini will be put under
50 /etc/opnfv_testapi/. And all the web relevant files under 3rd_party/static
51 will be in /user/local/share/opnfv_testapi as a totality.
56 *opnfv-testapi [--config-file <config.ini>]*
58 If --config-file is provided, the specified configuration file will be employed
59 when starting the server, or else /etc/opnfv_testapi/config.ini will be utilized
62 After executing the command successfully, a TestAPI server will be started on
63 port 8000, to visit web portal, please access http://hostname:8000
65 Regarding swagger-ui website, please visit http://hostname:8000/swagger/spec.html
67 Running with container
68 ======================
70 TestAPI has already containerized, the docker image is opnfv/testapi:latest.
72 **Running the container not behind nginx:**
76 docker run -dti --name testapi -p expose_port:8000
77 -e "mongodb_url=mongodb://mongodb_ip:27017/"
78 -e "base_url=http://host_name:expose_port"
81 **Running the container behind nginx:**
85 docker run -dti --name testapi -p expose_port:8000
86 -e "mongodb_url=mongodb://mongodb_ip:27017/"
87 -e "base_url=http://nginx_url"
93 All requirements for unit tests are outlined in test-requirements.txt, and in TestAPI project, tox is leveraged to drive the executing of unit tests and pep8 check
95 **Running unit tests**
99 **Running pep8 check**