65f0edb857ae573c4cb62d3cbc8ba9bcfa619825
[vvp/validation-scripts.git] / ice_validator / tests / report.html.jinja2
1 {## ============LICENSE_START=======================================================#}
2 {## org.onap.vvp/validation-scripts#}
3 {## ===================================================================#}
4 {## Copyright © 2019 AT&T Intellectual Property. All rights reserved.#}
5 {## ===================================================================#}
6 {###}
7 {## Unless otherwise specified, all software contained herein is licensed#}
8 {## under the Apache License, Version 2.0 (the "License");#}
9 {## you may not use this software except in compliance with the License.#}
10 {## You may obtain a copy of the License at#}
11 {###}
12 {##             http://www.apache.org/licenses/LICENSE-2.0#}
13 {###}
14 {## Unless required by applicable law or agreed to in writing, software#}
15 {## distributed under the License is distributed on an "AS IS" BASIS,#}
16 {## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.#}
17 {## See the License for the specific language governing permissions and#}
18 {## limitations under the License.#}
19 {###}
20 {###}
21 {###}
22 {## Unless otherwise specified, all documentation contained herein is licensed#}
23 {## under the Creative Commons License, Attribution 4.0 Intl. (the "License");#}
24 {## you may not use this documentation except in compliance with the License.#}
25 {## You may obtain a copy of the License at#}
26 {###}
27 {##             https://creativecommons.org/licenses/by/4.0/#}
28 {###}
29 {## Unless required by applicable law or agreed to in writing, documentation#}
30 {## distributed under the License is distributed on an "AS IS" BASIS,#}
31 {## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.#}
32 {## See the License for the specific language governing permissions and#}
33 {## limitations under the License.#}
34 {###}
35 {## ============LICENSE_END============================================#}
36 <!DOCTYPE html>
37 <html lang="en">
38 <head>
39     <meta charset="UTF-8">
40     <meta http-equiv="x-ua-compatible" content="ie=edge">
41     <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
42     <title>HEAT Validation Report</title>
43     <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
44     <link rel="stylesheet" type="text/css"
45           href="https://cdn.datatables.net/v/zf/jszip-2.5.0/dt-1.10.18/b-1.5.2/b-flash-1.5.2/b-html5-1.5.2/b-print-1.5.2/fh-3.1.4/datatables.min.css"/>
46     <link rel="stylesheet" type="text/css"
47           href="https://cdn.datatables.net/buttons/1.5.2/css/buttons.dataTables.min.css"/>
48     <link rel="stylesheet"
49           href="https://cdn.jsdelivr.net/npm/foundation-sites@6.5.0-rc.2/dist/css/foundation.min.css"
50           integrity="sha256-iJQ8dZac/jUYHxiEnZJsyVpKcdq2sQvdA7t02QFmp30= sha384-SplqNBo/0ZlvSdwrP/riIPDozO5ck8+yIm++KVqyMAC53S6m3BaV+2OLpi7ULOOh sha512-ho6hK4sAWdCeqopNZWNy1d9Ok2hzfTLQLcGSr8ZlRzDzh6tNHkVoqSl6wgLsqls3yazwiG9H9dBCtSfPuiLRCQ=="
51           crossorigin="anonymous">
52
53     <script type="text/javascript"
54             src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js"></script>
55     <script type="text/javascript"
56             src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js"></script>
57     <script type="text/javascript"
58             src="https://cdn.datatables.net/v/zf/jszip-2.5.0/dt-1.10.18/b-1.5.2/b-flash-1.5.2/b-html5-1.5.2/b-print-1.5.2/fh-3.1.4/datatables.min.js"></script>
59     <script src="https://cdn.jsdelivr.net/npm/foundation-sites@6.5.0-rc.2/dist/js/foundation.min.js"
60             integrity="sha256-G6jsRyH1fxbsvFIXSCuwYmI1aIDYBa28xscrvmYjJy0= sha384-vtoG68NvPc9azmFJr447vvY8qgdyA4FdaJ5/bqvzIM4eAdZfO0iyRRF8l2AAscYI sha512-43seCcNrHA0BQgrtyajB9sp8yOdv5c8QdYvgjP7zJ7v+dmzAcxYDQ2gupb9aztsNWBq1COIp/3NHYkQs4l/dkg=="
61             crossorigin="anonymous"></script>
62 </head>
63 <style>
64     #collection_failures {
65         table-layout: fixed;
66     }
67     .fileNames {
68         width: 25%;
69         word-wrap: break-word;
70         word-break: break-all;
71         white-space: normal;
72     }
73     .fixtures {
74         width: 10%;
75     }
76     .errorColumn {
77         width: 40%;
78     }
79     .fileLinks, .errorMessage {
80         word-wrap: break-word;
81         word-break: break-all;
82         white-space: normal;
83     }
84     .details {
85         white-space: nowrap;
86     }
87
88     .codeCell {
89         width: 100%;
90         overflow: auto;
91     }
92 </style>
93 <body>
94 <div class="grid-container fluid">
95
96     <div class="callout {{ "alert" if failures or collection_failures else "success" }}">
97         <h1>Validation Report</h1>
98         <ul>
99             <li><b>Categories:</b> {{ categories }}</li>
100             <li><b>Tool Version:</b> {{ version }}</li>
101             <li><b>Directory Validated:</b> {{ template_dir }}</li>
102             <li><b>Checksum:</b> {{ checksum }}</li>
103             <li><b>Generated:</b> {{ timestamp }}</li>
104             <li><b>Total Failures:</b> {{ num_failures }}</li>
105         </ul>
106     </div>
107     {% if collection_failures %}
108         <div class="callout alert">
109             <h2>WARNING: Errors Occurred During Validation Setup</h2>
110             <p>
111                 The following unexpected errors occurred while preparing to validate
112                 the the input files. Some validations may not have been executed.
113                 Please refer these issue to the VNF Validation Tool team.
114             </p>
115         </div>
116         <table id="collection_failures">
117             <thead>
118             <tr>
119                 <th class="fileNames">Validation File</th>
120                 <th class="fileNames">Test</th>
121                 <th class="fixtures">Fixtures</th>
122                 <th class="errorColumnn">Error</th>
123             </tr>
124             </thead>
125             <tbody>
126             {% for failure in collection_failures %}
127                 <tr>
128                     <td class="fileNames">{{ failure.module }}</td>
129                     <td class="fileNames">{{ failure.test }}</td>
130                     <td class="fixtures">{{ failure.fixtures }}</td>
131                     <td class="errorColumn">
132                         <div class="codeCell">
133                             <pre class="code">{{ failure.error }}</pre>
134                         </div>
135                     </td>
136                 </tr>
137             {% endfor %}
138             </tbody>
139         </table>
140     {% endif %}
141
142     {% if failures %}
143         <h2>Validation Failures</h2>
144         <table id="failures">
145             <thead>
146             <tr>
147                 <th>File(s)</th>
148                 <th>Error Message</th>
149                 <th>Requirement(s)</th>
150                 <th>Resolution Steps</th>
151             </tr>
152             </thead>
153             <tbody>
154             {% for failure in failures %}
155                 <tr>
156                     <td>
157                         {{ failure.file_links }}
158                     </td>
159                     <td>
160                         <p><b>Failed:</b> {{ failure.test_id }}</p>
161                         <p>{{ failure.error_message }}
162                             <a class="details" href="#"
163                                data-open="raw-output-{{ loop.index }}">Full&nbsp;Details</a>
164                         </p>
165                     </td>
166                     <td>
167                         {{ failure.requirements }}
168                     </td>
169                     <td>
170                         {{ failure.resolution_steps }}
171                     </td>
172                 </tr>
173             {% endfor %}
174             </tbody>
175             {% for failure in failures %}
176                 <div id="raw-output-{{ loop.index }}" class="large reveal" data-reveal
177                      aria-labelledby="modalTitle"
178                      aria-hidden="true" role="dialog">
179                     <h2 id="modalTitle">{{ failure.test_id }}</h2>
180                     <pre class="code">
181                             {{ failure.raw_output }}
182                         </pre>
183                     <button class="close-button" data-close aria-label="Close modal"
184                             type="button">
185                         <span aria-hidden="true">&times;</span>
186                     </button>
187                     <a class="close-reveal-modal" aria-label="Close">&#215;</a>
188                 </div>
189             {% endfor %}
190         </table>
191     {% else %}
192         <h2>No validation errors found.</h2>
193     {% endif %}
194     <script lang="javascript">
195         $(document).foundation();
196         $(document).ready(function () {
197             $('#failures').DataTable({
198                 dom: 'Bfrtip',
199                 buttons: [
200                     'csv',
201                     {
202                         extend: 'pdfHtml5',
203                         orientation: 'landscape',
204                     },
205                     'print'
206                 ],
207                 fixedHeader: true,
208                 pageLength: 50,
209                 columns: [
210                     {width: "25%", className: "fileLinks"},
211                     {width: "25%", className: "errorMessage"},
212                     {width: "25%", className: "requirements"},
213                     {width: "25%", className: "resolutionSteps"},
214                 ]
215             });
216         });
217     </script>
218 </div>
219 </body>
220 </html>