adjust testAPI presentation
[functest.git] / docs / com / pres / testapi.html
1 <!doctype html>
2 <html lang="en">
3
4         <head>
5                 <meta charset="utf-8">
6
7                 <title>OPNFV presentation</title>
8
9                 <meta name="description" content="Test API">
10                 <meta name="author" content="Serena Feng">
11
12                 <meta name="apple-mobile-web-app-capable" content="yes" />
13                 <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
14
15                 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
16
17                 <link rel="stylesheet" href="../css/reveal.css">
18                 <link rel="stylesheet" href="../css/theme/OPNFV.css" id="theme">
19
20                 <!-- Code syntax highlighting -->
21                 <link rel="stylesheet" href="../lib/css/zenburn.css">
22
23                 <!-- Printing and PDF exports -->
24                 <script>
25                         var link = document.createElement( 'link' );
26                         link.rel = 'stylesheet';
27                         link.type = 'text/css';
28                         link.href = window.location.search.match( /print-pdf/gi ) ? '../css/print/pdf.css' : '../css/print/paper.css';
29                         document.getElementsByTagName( 'head' )[0].appendChild( link );
30                 </script>
31
32                 <!--[if lt IE 9]>
33                 <script src="lib/js/html5shiv.js"></script>
34                 <![endif]-->
35         </head>
36
37         <body>
38
39                 <div class="reveal">
40                         <!-- Any section element inside of this container is displayed as a slide -->
41                         <div class="slides">
42
43                                 <section data-background="../img/title-bg.png" data-background-transition="none">
44                      <h1>Test API</h1>
45                      <h3>Clean, Easy, Complete</h3>
46                      <br>
47                                          <h4>OPNFV testing community</h4>
48                                          <h5>OPNFV Design Summit, 20/6/2016, Berlin</h5>
49                                          <br>
50                                 </section>
51
52                                 <section data-markdown>
53                                         # Agenda
54                                         * A test API: what for?
55                                         * API overview
56                                         * API evolution
57                                 </section>
58
59                 <section>
60                     <section data-markdown>
61                     # A test API: what for?
62                     </section>
63                     <section data-markdown>
64                     ## Give a consistant view for
65                     * Test resources (Pods)
66                     * Test projects
67                     * Test cases
68                     * Test results
69                     </section>
70
71                     <section data-markdown>
72                     ## Unify result display
73                     * From many projects
74                     * Many formats (log, html, json, ..)
75                     * Many locations (in VM, Jumphost, external DB,...)
76                     </section>
77
78                     <section data-markdown>
79                     ## Help building
80                     * Dashboards
81                     * Automatic reporting
82                     </section>
83                 </section>
84
85                 <section>
86                     <section data-markdown>
87                     # API overview
88                     </section>
89                     <section data-markdown>
90                                         ## API storage structure
91                                         ![testapi](https://wiki.opnfv.org/download/attachments/2926452/results_collection_structure.png?version=1&modificationDate=1459196347000&api=v2 "OPNFV API page")
92                     </section>
93                     <section data-markdown>
94                                         ## API in Brahmaputra
95                                         ![testapi](../img/testapi0.png)
96                                         https://wiki.opnfv.org/display/functest/Collection+Of+Test+Results
97                     </section>
98
99                     <section data-markdown>
100                     ## API in Brahmaputra
101                     * Tornado + MongoDB
102                     * Simple data models aggreed with the testing group
103                     * No unit tests
104                     * Wiki and rst documentation
105                     </section>
106
107                     <section data-markdown>
108                     ## Lessons learned in B.
109                     * Wiki documentation is painful
110                     * Result model too simple
111                      * version used instead of scenario
112                      * no version
113                      * no overall criteria (PASS/FAIL)
114                     * need unit tests for data model evolution
115                     </section>
116                     <section data-markdown>
117                     ## Colorado refactoring
118                     * Done by Serena Feng (ZTE)
119                     * Update of the data model (based on lessons learned)
120                     * New swagger tornado framework for the doc
121                     * URL and Mongo collection renaming
122                     * Scripts to manage backup/restore/DB update
123                     * Setup scripts
124                     * Unit tests
125                     </section>
126                 </section>
127
128                 <section>
129                     <section data-markdown>
130                                                 # Result management changes
131                     </section>
132                     
133                     <section data-markdown>
134                                                 ## main changes
135                                                 An URI change...
136                                                 
137                                                 testresults.opnfv.org/test/testapi => testresults.opnfv.org/test/api/v1
138                                                 
139                                                 http://testresults.opnfv.org/test/api/v1/projects
140                                                 http://testresults.opnfv.org/test/api/v1/projects/qtip/cases
141                                                 http://testresults.opnfv.org/test/api/v1/results?case=Tempest&period=1
142                                                 </section>
143                                                 <section>
144                                                 <h3>One new field for pods</h3>
145                                                 <table>
146                                                         <thead>
147                                                                 <tr>
148                                                                         <th>Field</th>
149                                                                         <th>Brahmaputra</th>
150                                                                         <th>Colorado</th>
151                                                                 </tr>
152                                                         </thead>
153                                                         <tbody>
154                                                                 <tr>
155                                                                         <td>role</td>
156                                                                         <td>N.R</td>
157                                                                         <td>community_pod, ci_pod, ..</td>
158                                                                 </tr>
159                                                         </tbody>
160                                                 </table>                        
161                                                 </section>
162                         <section>
163                                                 <h3>New fields and filters for results</h3>
164                                                 <table>
165                                                         <thead>
166                                                                 <tr>
167                                                                         <th>Item</th>
168                                                                         <th>Brahmaputra</th>
169                                                                         <th>Colorado</th>
170                                                                 </tr>
171                                                         </thead>
172                                                         <tbody>
173                                                                 <tr>
174                                                                         <td>date</td>
175                                                                         <td>creation_date</td>
176                                                                         <td>start_date and stop_date</td>
177                                                                 </tr>
178                                                                 <tr>
179                                                                         <td>version</td>
180                                                                         <td>used as scenario</td>
181                                                                         <td>git version</td>
182                                                                 </tr>
183                                                                 <tr>
184                                                                         <td>scenario</td>
185                                                                         <td>N.R</td>
186                                                                         <td>used for scenario</td>
187                                                                 </tr>
188                                                                 <tr>
189                                                                         <td>criteria</td>
190                                                                         <td>N.R</td>
191                                                                         <td>PASS/FAILED</td>
192                                                                 </tr>
193                                                                 <tr>
194                                                                         <td>trust_indicator</td>
195                                                                         <td>N.R</td>
196                                                                         <td>between 0 and 1</td>
197                                                                 </tr>
198                                                                 <tr>
199                                                                         <td>last</td>
200                                                                         <td>N.R</td>
201                                                                         <td>get last N results</td>
202                                                                 </tr>
203                                                         </tbody>
204                                                 </table>
205                                         </section>
206                     <section data-markdown>
207                                                 http://testresults.opnfv.org/test/swagger/spec.html
208                                                 ![alt text](../img/testapi1.png "Test API swagger interface")
209                     </section>
210 <section>
211                                         <h2>unit tests</h2>
212                                         <pre><code class="hljs" data-trim contenteditable>
213 umry8364@umry8364-Latitude-E6400:~/Dev/OPNFV/releng/utils/test/result_collection_api$ ./run_test.sh 
214 Tests running...
215 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
216 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
217 WARNING:tornado.general:400 POST /api/v1/projects (127.0.0.1): name missing
218 ............
219 WARNING:tornado.access:400 POST /api/v1/projects (127.0.0.1) 1.13ms
220 WARNING:tornado.access:403 PUT /api/v1/projects/functest/cases/vping_1 (127.0.0.1) 2.95ms
221 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]
222 WARNING:tornado.access:404 PUT /api/v1/projects/functest/cases/notFound (127.0.0.1) 2.85ms
223
224 Ran 74 tests in 1.848s
225 OK
226                                         </code></pre>
227                                 </section>
228                 </section>
229                                 <section>
230                                         <h3>Thank you</h3>
231                                         <img width="600"  data-src="../img/colorado.png" alt="tests">
232                                 </section>
233
234                         </div>
235             <div class='footer'>
236                                  <img src="../img/logo-OPNFV.png" alt="OPNFV logo">
237                 </div>
238                 </div>
239
240                 <script src="../lib/js/head.min.js"></script>
241                 <script src="../js/reveal.js"></script>
242
243                 <script>
244
245                         // Full list of configuration options available at:
246                         // https://github.com/hakimel/reveal.js#configuration
247                         Reveal.initialize({
248                                 controls: true,
249                                 progress: true,
250                                 history: true,
251                                 center: true,
252
253                                 transition: 'slide', // none/fade/slide/convex/concave/zoom
254
255                                 // Optional reveal.js plugins
256                                 dependencies: [
257                                         { src: '../lib/js/classList.js', condition: function() { return !document.body.classList; } },
258                                         { src: '../plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
259                                         { src: '../plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
260                                         { src: '../plugin/highlight/highlight.js', async: true, condition: function() { return !!document.querySelector( 'pre code' ); }, callback: function() { hljs.initHighlightingOnLoad(); } },
261                                         { src: '../plugin/zoom-js/zoom.js', async: true },
262                                         { src: '../plugin/notes/notes.js', async: true }
263                                 ]
264                         });
265
266                 </script>
267
268         </body>
269 </html>