TestAPI

Clean, Easy, Complete


OPNFV testing community

OPNFV Design Summit, 20/6/2016, Berlin

# Agenda * TestAPI: what for? * API overview * API evolution * Roadmap
# TestAPI: what for?
## Consistant view for * Resources (Pods) * Projects * Test cases * Results
## Status Currently * From many projects * Many formats (log, html, json, ..) * Many locations (in VM, Jumphost, external DB,...)
## Help building * Dashboards * Automatic reporting
# API overview
## Storage structure ![TestAPI](https://wiki.opnfv.org/download/attachments/2926452/results_collection_structure.png?version=1&modificationDate=1459196347000&api=v2 "OPNFV API page")
## API in Brahmaputra ![TestAPI](../../../img/testapi0.png) https://wiki.opnfv.org/display/functest/Collection+Of+Test+Results
## API status in Brahmaputra * Simple data models aggreed with the testing group * No unit tests * Wiki and rst documentation
## Lessons learned in B. * Painful wiki documentation * Simple result model * Misuse version as scenario * No version actually * No overall criteria (PASS/FAIL) * Difficult refactoring

Colorado refactoring

  • Unit tests
  • Update of the data model
  • Tornado_swagger for the documentation
  • URL and MongoDB collection renaming
  • Scripts to support databse backup/restore/update
  • Support installation

All done in Colorado!

# API Evoluation

URI changes...

testresults.opnfv.org/TestAPI =>
testresults.opnfv.org/test/api/v1

/test/api/v1/pods

/test/api/v1/projects

/test/api/v1/projects/qtip/cases

/test/api/v1/results

## One new field for pods | Field | Colorado | | :--- | :--- | | role | community_pod, ci_pod, .. |
## Changed fields for results | Item | Brahmaputra | Colorado | | :--- | :--- | :--- | | date | creation_date | start_date and stop_date | | version | used as scenario | opnfv release version |
## One new filter for results | Item | Colorado | | :--- | :--- | | last | get last N results|
http://testresults.opnfv.org/test/swagger/spec.html ![alt text](../../../img/testapi1.png "TestAPI swagger interface")

unit tests


umry8364@umry8364-Latitude-E6400:~/Dev/OPNFV/releng/utils/test/result_collection_api$ ./run_test.sh
Tests running...
WARNING:tornado.general:404 GET /dashboard/v1/results?case=vPing&pod=zte-pod1&version=C&installer=fuel&period=5 (127.0.0.1): Project name missing
WARNING:tornado.access:404 GET /dashboard/v1/results?case=vPing&pod=zte-pod1&version=C&installer=fuel&period=5 (127.0.0.1) 2.30ms
WARNING:tornado.general:400 POST /api/v1/projects (127.0.0.1): name missing
............
WARNING:tornado.access:400 POST /api/v1/projects (127.0.0.1) 1.13ms
WARNING:tornado.access:403 PUT /api/v1/projects/functest/cases/vping_1 (127.0.0.1) 2.95ms
WARNING:tornado.general:404 PUT /api/v1/projects/functest/cases/notFound (127.0.0.1): {'project_name': u'functest', 'name': u'notFound'} could not be found in table [testcases]
WARNING:tornado.access:404 PUT /api/v1/projects/functest/cases/notFound (127.0.0.1) 2.85ms

Ran 74 tests in 1.848s
OK
						
# Roadmap
## Roadmap * Dockerize TestAPI * Automatic update of TestAPI * Command Line Interface * Automatic update for pods/projects/testcases
# suggestions ...

Thank you

tests