5 **Test Results Collector of OPNFV Test Projects**:
7 This project aims to provide a common way of gathering all the test results for OPNFV
8 testing projects into a single place, and a unified way of getting those results for
9 testing analysis projects, such as Reporting/Bitergia Dashboard/Qtip. It exposes
10 Restful APIs for collecting results and pushing them into a MongoDB database.
12 If you are interested in how TestAPI looks like, please visit OPNFV's official `TestAPI Server`__
14 .. __: http://testresults.opnfv.org/test
19 TestAPI leverages MongoDB as the data warehouse, in order to let it work
20 successfully, a MongoDB must be provided, the official MongoDB version in OPNFV
21 TestAPI is 3.2.6. And the database is **test_results_collection**, the five
22 collections are *users/pods/projects/testcases/scenarioes/results*. And thanks to
23 MongoDB's very user-friendly property, they don't need to be created in advance.
31 All requirements are listed in requirements.txt and should be
32 installed by 'pip install':
34 *pip install -r requirements.txt*
39 *python setup.py install*
41 After installation, configuration file etc/config.ini will be put under
42 /etc/opnfv_testapi/. And all the web relevant files under 3rd_party/static
43 will be in /user/local/share/opnfv_testapi as a totality.
48 *opnfv-testapi [--config-file <config.ini>]*
50 If --config-file is provided, the specified configuration file will be employed
51 when starting the server, or else /etc/opnfv_testapi/config.ini will be utilized
54 After executing the command successfully, a TestAPI server will be started on
55 port 8000, to visit web portal, please access http://hostname:8000
57 Regarding swagger-ui website, please visit http://hostname:8000/swagger/spec.html
59 Running with container
60 ======================
62 TestAPI has already containerized, the docker image is opnfv/testapi:latest.
64 **Running the container not behind nginx:**
68 docker run -dti --name testapi -p expose_port:8000
69 -e "mongodb_url=mongodb://mongodb_ip:27017/"
70 -e "base_url=http://host_name:expose_port"
73 **Running the container behind nginx:**
77 docker run -dti --name testapi -p expose_port:8000
78 -e "mongodb_url=mongodb://mongodb_ip:27017/"
79 -e "base_url=http://nginx_url"
85 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
87 **Running unit tests**
91 **Running pep8 check**