User Tools

Site Tools


collection_of_test_results

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
collection_of_test_results [2015/07/02 09:57]
Morgan Richomme [Description]
collection_of_test_results [2015/10/12 09:49]
Morgan Richomme
Line 1: Line 1:
 ====== Description ====== ====== Description ======
-This is a purpose ​for the MongoDB structure ​for collecting test results. +The mission of this project ​is to provide ​common way for gathering all the results of OPNFV tests projects into a single place. It should expose a REST API for the collect of results ​and push them into a MongoDB database. 
-The goal is to have three main collections : + 
 +{{:​collection_of_results_api.png?​800|}} 
 + 
 + 
 +====== Database ====== 
 + 
 +The goal is to have three main collections ​in a Mongo DB
   * tests projects   * tests projects
   * test cases   * test cases
-  * test results ​related to each other by a numbering system+  * test results ​ 
 +  
 +{{:​results_collection_structure.png?800|}}
  
-The test result ​would be stored ​either as plain text or json structure ​in the test results collection ​on details field+The test result ​are stored ​in json format ​in the test results collection
 +The json format include a details field. This field shall be used to provide the details on the results. These details may be used later for the dashboard.
  
 +<code json>
 +"​details":​ {
 +
 +    "​timestart":​ 1444395967.9822,​
 +    "​duration":​ 40.9,
 +    "​status":​ "​OK"​
 +
 +}
 +</​code> ​
 +
 +====== Data model ======
  
-====== Structure ====== 
 **Test projects** **Test projects**
 <code json> <code json>
 [ [
   {   {
-    "​id": ​1+    "​id": ​""​
-    "​name":​ "functest", +    "​name":​ "",​ 
-    "testcases": ​+    "creation_date": "YYYY-MM-DD HH:MM:SS", ​   
-    { +
-                     "​id": ​1.1, +
-                     "​name"​:"", +
-                     "​description"​ +
-    }, +
-    { +
-      "​id":​ 1.2, +
-      "​name":"",​ +
-      "​description"​ +
-    } +
- ],+
     "​description":""​     "​description":""​
   },   },
Line 37: Line 45:
 <code json> <code json>
 [ [
 +
   {   {
-    "​id":​1.1,+    "​id": ​""​,
     "​name":"",​     "​name":"",​
-    "testproject": "1", +    "creation_date": "YYYY-MM-DD HH:MM:SS", 
-    "test": "test.authenticate", +    "description": "",​ 
-    "description": ""​+    "url":""​
   },   },
   {...}   {...}
Line 53: Line 62:
 [ [
   {   {
-    "id": "1.1.1", +    "_id": "",​ 
-    "testcase": "1.1", +    "project_name": "",​ 
-    "date": "",​ +    "pod_name": "",​ 
-    "platform":"",​ +    "version": "",​ 
-    "global_status":"",​ +    "installer": "",​ 
-    "hardware_details":"",​ +    "description": "",​ 
-    "​details":​{}+    "​creation_date":​ "​YYYY-MM-DD HH:​MM:​SS",​ 
 +    "​case_name":​ ""​ 
 +    "​details":​{ 
 +       <- the results to be put here -> 
 +    ​}
   },   },
-  {...} 
 ] ]
 </​code>​ </​code>​
 +
 +====== REST API ======
 +
 +The temp Mongo DB + API is hosted in an Orange public VM (http://​213.77.62.197).
 +
 +
 +==== Version ====
 +
 +^Method ^Path ^Description ^
 +| GET | /version | API version |
 +
 +
 +==== Pods ====
 +
 +^Method ^Path ^Description ^
 +| GET | /pods | Get the list of declared PODs |
 +| POST | /pods | Create a new POD  \\ Content-Type:​ application/​json \\ {  \\ "​name":​ "​pod-foo", ​ \\ "​creation_date":​ "​YYYY-MM-DD HH:​MM:​SS"​ \\ } |
 +
 +
 +==== Test projects ====
 +
 +^Method ^Path ^Description ^
 +| GET | /​test_projects | Give the list of test projects |
 +| GET | /​test_projects/​{project_name} | Give details on the selected project |
 +| POST | /​test_projects | Add a Test project \\ Content-Type:​ application/​json \\ {  \\ "​name":​ "​project-foo", ​ \\ "​description":​ "​Example with project foo" \\ } |
 +| PUT | /​test_projects/​{project_name} | Update project ​ \\ { \\ <the field(s) you want to modify> \\ } |
 +| DELETE | /​test_projects/​{project_name} | Delete project \\ Content-Type:​ application/​json \\ { \\ } |
 +
 +
 +==== Test cases ====
 +
 +^Method ^Path ^Description ^
 +| GET | /​test_projects/​{project_name}/​cases | Give details on the testcases of the foo project |
 +| POST | /​test_projects/​{project_name}/​cases | Add test cases  \\ Content-Type:​ application/​json \\ {  \\  "​url":​ "<​the url detailing the testcase>", ​ \\ "​creation_date":​ "​YYYY-MM-DD HH:​MM:​SS", ​ \\ "​name":​ "​vFoo", ​ \\ "​description":​ "vFoo use case" \\ } |
 +| PUT | /​test_projects/​{project_name}?​case_name={case_name} | Modify a test case \\ Content-Type:​ application/​json ​ \\ { \\ < the field(s) to be modified > \\ } |
 +| DELETE | | Remove a test case \\ Content-Type:​ application/​json ​ |
 +
 +==== test results ====
 +
 +^Method ^Path ^Description ^
 +| GET | /results | Get all the test results |
 +| GET | /​results?​project_name={test_project_name} | Get all the results of project {test_project_name} |
 +| GET | /​results?​pod_name={pod_name} | Get all the results executed on pod {pod_name} ​ |
 +| GET | /​results?​installer={installer_name} | Get all the results done with installer {installer_name} ​ |
 +| GET | /​results?​version={version_name} | Get all the results done with version {version_name} ​ |
 +| GET | /​results?​period={days} | Get all the results stored since {Days} days  |
 +| GET | /​results?​project_name={test_project_name}&​installer={installer_name}&​version={version_name}&​period={days} | Get all the results of project {project_name} with version {version_name} installed by installer {installer_name} on POD [pod_name} stored since {days} days  |
 +| POST |/​results ​ | Add test result in the Database ​ \\ Content-Type:​ application/​json ​ \\ {  \\ "​project_name":​ {project_name}, ​ \\ "​case_name":​ {case_name}, ​ \\ "​pod_name":​ {pod_name}, ​ \\ "​installer":​ {installer_name}, ​ \\ "​version":​{version_name}, ​ \\ "​details":​ { <your results> }  \\ } |
 +
 +
collection_of_test_results.txt · Last modified: 2016/01/08 13:57 by Nauman Ahad