Add presentation for test API
[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 projects
66                     * Test cases
67                     * Test resources (Pods)
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 in Brahmaputra
91                     * Tornado + MongoDB
92                     * Simple data models aggreed with the testing group
93                     * No unit tests
94                     * Wiki and rst documentation
95                     </section>
96
97                     <section data-markdown>
98                                         ## API in Brahmaputra
99                                         ![testapi](https://wiki.opnfv.org/download/attachments/2926452/results_collection_structure.png?version=1&modificationDate=1459196347000&api=v2 "OPNFV API page")
100                                         </section>
101                     <section data-markdown>
102                                         ## API in Brahmaputra
103                                         ![testapi](../img/testapi0.png)
104                                         https://wiki.opnfv.org/display/functest/Collection+Of+Test+Results
105                     </section>
106
107                     <section data-markdown>
108                     ## Lessons learned in B.
109                     * Wiki documentation is painful
110                     * result modl too simple
111                      * version used for scenario
112                      * no version
113                      * no overall criteria (passed/failed)
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 lesson learned)
120                     * creation of a swagger tornado framework for the doc
121                     * creation of unit tests
122                     </section>
123                 </section>
124
125                 <section>
126                     <section data-markdown>
127                                                 #API evolution
128                     </section>
129 <section>
130                                                 <h3>Test API evolution</h3>
131                                                 <table>
132                                                         <thead>
133                                                                 <tr>
134                                                                         <th>Field</th>
135                                                                         <th>Brahmaputra</th>
136                                                                         <th>Colorado</th>
137                                                                 </tr>
138                                                         </thead>
139                                                         <tbody>
140                                                                 <tr>
141                                                                         <td>date</td>
142                                                                         <td>creation_date</td>
143                                                                         <td>start_date and stop_date</td>
144                                                                 </tr>
145                                                                 <tr>
146                                                                         <td>version</td>
147                                                                         <td>used as scenario</td>
148                                                                         <td>git version</td>
149                                                                 </tr>
150                                                                 <tr>
151                                                                         <td>scenario</td>
152                                                                         <td>N.R</td>
153                                                                         <td>used for scenario</td>
154                                                                 </tr>
155                                                                 <tr>
156                                                                         <td>test_criteria</td>
157                                                                         <td>N.R</td>
158                                                                         <td>passed/failed</td>
159                                                                 </tr>
160                                                                 <tr>
161                                                                         <td>trust_indictator</td>
162                                                                         <td>N.R</td>
163                                                                         <td>between 0 and 1</td>
164                                                                 </tr>
165                                                                 <tr>
166                                                                         <td>last</td>
167                                                                         <td>N.R</td>
168                                                                         <td>get last N results</td>
169                                                                 </tr>
170                                                         </tbody>
171                                                 </table>
172                                         </section>
173                     <section data-markdown>
174                                                 ## Swagger doc
175                                                 ![alt text](../img/testapi1.png "Test API swagger interface")
176                     </section>
177 <section>
178                                         <h2>unit tests</h2>
179                                         <pre><code class="hljs" data-trim contenteditable>
180 umry8364@umry8364-Latitude-E6400:~/Dev/OPNFV/releng/utils/test/result_collection_api$ ./run_test.sh 
181 Tests running...
182 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
183 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
184 WARNING:tornado.general:400 POST /api/v1/projects (127.0.0.1): name missing
185 ............
186 WARNING:tornado.access:400 POST /api/v1/projects (127.0.0.1) 1.13ms
187 WARNING:tornado.access:403 PUT /api/v1/projects/functest/cases/vping_1 (127.0.0.1) 2.95ms
188 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]
189 WARNING:tornado.access:404 PUT /api/v1/projects/functest/cases/notFound (127.0.0.1) 2.85ms
190
191 Ran 74 tests in 1.848s
192 OK
193                                         </code></pre>
194                                 </section>
195                 </section>
196                                 <section>
197                                         <h3>Thank you</h3>
198                                         <img width="600"  data-src="../img/colorado.png" alt="tests">
199                                 </section>
200
201                         </div>
202             <div class='footer'>
203                                  <img src="../img/logo-OPNFV.png" alt="OPNFV logo">
204                 </div>
205                 </div>
206
207                 <script src="../lib/js/head.min.js"></script>
208                 <script src="../js/reveal.js"></script>
209
210                 <script>
211
212                         // Full list of configuration options available at:
213                         // https://github.com/hakimel/reveal.js#configuration
214                         Reveal.initialize({
215                                 controls: true,
216                                 progress: true,
217                                 history: true,
218                                 center: true,
219
220                                 transition: 'slide', // none/fade/slide/convex/concave/zoom
221
222                                 // Optional reveal.js plugins
223                                 dependencies: [
224                                         { src: '../lib/js/classList.js', condition: function() { return !document.body.classList; } },
225                                         { src: '../plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
226                                         { src: '../plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
227                                         { src: '../plugin/highlight/highlight.js', async: true, condition: function() { return !!document.querySelector( 'pre code' ); }, callback: function() { hljs.initHighlightingOnLoad(); } },
228                                         { src: '../plugin/zoom-js/zoom.js', async: true },
229                                         { src: '../plugin/notes/notes.js', async: true }
230                                 ]
231                         });
232
233                 </script>
234
235         </body>
236 </html>