summary.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. <html>
  2. <head>
  3. <style>
  4. body {
  5. font-family: -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";
  6. margin: 0;
  7. padding: 0;
  8. box-sizing: border-box;
  9. width: 100%;
  10. }
  11. h1 {
  12. font-size: 20px;
  13. }
  14. th {
  15. text-transform: uppercase;
  16. }
  17. th, td {
  18. padding: 5px;
  19. word-break: break-word; /* Allow breaking long words */
  20. font-size: 14px;
  21. min-width: 80px;
  22. }
  23. td.test_name{
  24. min-width: 79vw;
  25. max-width: 79vw;
  26. }
  27. td.test_name.with_history{
  28. min-width: 73vw;
  29. max-width: 73vw;
  30. }
  31. table {
  32. border-collapse: collapse;
  33. width: 100%;
  34. left: 5;
  35. }
  36. span.test_status {
  37. font-weight: bold;
  38. }
  39. span.test_fail {
  40. color: red;
  41. }
  42. span.test_pass {
  43. color: green;
  44. }
  45. span.test_mute {
  46. color: blue;
  47. }
  48. .svg_passed {
  49. fill: green;
  50. }
  51. .svg_failure {
  52. fill: red;
  53. }
  54. .svg_skipped {
  55. fill: gray;
  56. }
  57. .svg_mute {
  58. fill: blue;
  59. }
  60. .svg-icon {
  61. float: left;
  62. width: 14px;
  63. height: 14px;
  64. padding-left: 1px;
  65. padding-right: 1px;
  66. margin-right: 0px;
  67. border-radius: 50%;
  68. position: relative; /* Essential for tooltips */
  69. cursor: pointer;
  70. }
  71. .tooltip {
  72. visibility: hidden;
  73. max-width: 340px;
  74. min-width: 260px;
  75. word-break: break-word;
  76. background-color: #7d7d92;
  77. color: #fff;
  78. text-align: left;
  79. border-radius: 5px;
  80. padding: 5px;
  81. position: absolute;
  82. z-index: 3;
  83. bottom: 100%; /* Positioned above the svg icon */
  84. left: 50%; /* Center the tooltip */
  85. margin-left: -95px; /* Use negative margin to actually center the tooltip */
  86. opacity: 0;
  87. transition: opacity 0.3s;
  88. overflow: hidden;
  89. white-space: nowrap; /* Don't forget this one */
  90. text-overflow: ellipsis;
  91. }
  92. .tooltip::after {
  93. content: "";
  94. position: absolute;
  95. top: 100%; /* Arrow will be positioned at the bottom of the tooltip */
  96. left: 50%;
  97. margin-left: -5px;
  98. border-width: 5px;
  99. border-style: solid;
  100. border-color: #7d7d92 transparent transparent transparent; /* Arrow color */
  101. }
  102. .tooltip.visible {
  103. visibility: visible;
  104. opacity: 1;
  105. }
  106. button.copy {
  107. float: right;
  108. position: relative; /* To hold the copied tooltip */
  109. }
  110. table > tbody > tr > td:nth-child(2),
  111. table > tbody > tr > td:nth-child(3),
  112. table > tbody > tr > td:nth-child(4) {
  113. text-align: left;
  114. }
  115. .collapsible-content {
  116. display: table-row-group;
  117. position: absolute;
  118. top: -9999px;
  119. left: -9999px;
  120. height: 0;
  121. overflow: hidden;
  122. }
  123. .collapsible-content.active {
  124. position: relative;
  125. top: 0;
  126. left: 5;
  127. height: auto;
  128. }
  129. .collapsible-header {
  130. cursor: pointer;
  131. background-color: #f2f2f2;
  132. padding: 10px;
  133. border: 1px solid #ddd;
  134. margin-bottom: 5px;
  135. }
  136. .toggle-visibility-buttons {
  137. margin-bottom: 10px;
  138. overflow:hidden;
  139. float: right;
  140. }
  141. </style>
  142. <script>
  143. function copyTestNameToClipboard(text) {
  144. const full_name = text.trim();
  145. const pieces = /(.+)\/([^$]+)$/.exec(full_name);
  146. if (!pieces) {
  147. console.error("Unable to split path/test name from %o", full_name);
  148. return;
  149. }
  150. let [path, testName] = [pieces[1], pieces[2]];
  151. const namePieces = testName.split('.');
  152. if (namePieces.length === 2) {
  153. testName = namePieces[0] + '::' + namePieces[1];
  154. } else {
  155. testName = namePieces[0] + '.' + namePieces[1] + '::' + namePieces.slice(2).join('::');
  156. }
  157. const cmdArg = `${path} -F '${testName}'`;
  158. console.log(cmdArg);
  159. navigator.clipboard.writeText(cmdArg).then(
  160. () => {
  161. console.log("Copied!");
  162. showCopiedTooltip();
  163. },
  164. () => {
  165. console.error("Unable to copy %o to clipboard", cmdArg);
  166. }
  167. );
  168. }
  169. let lastOpenedTooltip = null;
  170. function toggleTooltip(event) {
  171. event.stopPropagation();
  172. const tooltip = event.currentTarget.querySelector('.tooltip');
  173. if (tooltip.classList.contains('visible')) {
  174. tooltip.classList.remove('visible');
  175. lastOpenedTooltip = null;
  176. } else {
  177. hideTooltips();
  178. tooltip.classList.add('visible');
  179. lastOpenedTooltip = tooltip;
  180. }
  181. }
  182. function hideTooltips() {
  183. if (lastOpenedTooltip) {
  184. lastOpenedTooltip.classList.remove('visible');
  185. lastOpenedTooltip = null;
  186. }
  187. }
  188. function toggleAllTables(action) {
  189. const contents = document.querySelectorAll('.collapsible-content');
  190. if (action === 'expand') {
  191. contents.forEach(content => content.classList.add('active'));
  192. } else if (action === 'collapse') {
  193. contents.forEach(content => content.classList.remove('active'));
  194. }
  195. }
  196. document.addEventListener("DOMContentLoaded", function() {
  197. document.addEventListener('keydown', function(event) {
  198. if ((event.ctrlKey && event.keyCode == 70) || (event.metaKey && event.keyCode == 70)) {
  199. toggleAllTables('expand');
  200. }
  201. });
  202. document.addEventListener('click', function(event) {
  203. if (!event.target.closest('.svg-icon') && !event.target.classList.contains('copy')) {
  204. hideTooltips();
  205. }
  206. });
  207. const svgIcons = document.querySelectorAll('.svg-icon');
  208. svgIcons.forEach(icon => {
  209. icon.addEventListener('click', toggleTooltip);
  210. });
  211. const copyButtons = document.querySelectorAll(".copy");
  212. copyButtons.forEach(button => {
  213. button.addEventListener('click', function(event) {
  214. event.preventDefault();
  215. copyTestNameToClipboard(event.target.closest('.copy').previousElementSibling.textContent);
  216. });
  217. });
  218. const headers = document.querySelectorAll(".collapsible-header");
  219. headers.forEach(header => {
  220. header.addEventListener('click', function() {
  221. const content = this.nextElementSibling;
  222. if (content.classList.contains('active')) {
  223. content.classList.remove('active');
  224. } else {
  225. content.classList.add('active');
  226. }
  227. });
  228. });
  229. document.getElementById('expand-all').addEventListener('click', function(event) {
  230. toggleAllTables('expand');
  231. });
  232. document.getElementById('collapse-all').addEventListener('click', function(event) {
  233. toggleAllTables('collapse');
  234. });
  235. });
  236. </script>
  237. </head>
  238. <body>
  239. <div class="toggle-visibility-buttons">
  240. <button id="expand-all">Expand All</button>
  241. <button id="collapse-all">Collapse All</button>
  242. </div>
  243. {% for status in status_order %}
  244. <h1 id="{{ status.name}}" class="collapsible-header">{{ status.name }} ({{ tests[status] | length }})</h1>
  245. <table class="collapsible-content active" border="1">
  246. <thead>
  247. <tr>
  248. <th>test name</th>
  249. {% if status.is_error and history%}
  250. <th>history<br>
  251. old->new
  252. </th>
  253. {% endif %}
  254. <th>elapsed</th>
  255. <th>status</th>
  256. {% if status in has_any_log %}
  257. <th>LOG</th>
  258. {% endif %}
  259. </tr>
  260. </thead>
  261. <tbody>
  262. {% for t in tests[status] %}
  263. <tr>
  264. {% if status.is_error %}
  265. <td class="test_name with_history">
  266. {% else %}
  267. <td class="test_name">
  268. {% endif %}
  269. <span>{{ t.full_name }}</span>
  270. {% if status.is_error %}
  271. <button class="copy" title="Copy test filter to clipboard" >
  272. <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14" class="g-icon" fill="currentColor" stroke="none" aria-hidden="true">
  273. <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16">
  274. <path class="copy_svg" fill="currentColor" fill-rule="evenodd" d="M12 2.5H8A1.5 1.5 0 0 0 6.5 4v1H8a3 3 0 0 1 3 3v1.5h1A1.5 1.5 0 0 0 13.5 8V4A1.5 1.5 0 0 0 12 2.5M11 11h1a3 3 0 0 0 3-3V4a3 3 0 0 0-3-3H8a3 3 0 0 0-3 3v1H4a3 3 0 0 0-3 3v4a3 3 0 0 0 3 3h4a3 3 0 0 0 3-3zM4 6.5h4A1.5 1.5 0 0 1 9.5 8v4A1.5 1.5 0 0 1 8 13.5H4A1.5 1.5 0 0 1 2.5 12V8A1.5 1.5 0 0 1 4 6.5" clip-rule="evenodd"></path>
  275. </svg>
  276. </svg>
  277. </button>
  278. {% endif %}
  279. </td>
  280. {% if (status.is_error and t.full_name in history) %}
  281. <td>
  282. {% for h in history[t.full_name] %}
  283. <span class="svg-icon">
  284. {% if history[t.full_name][h].status == 'failure' %}
  285. <svg class="svg_failure" viewBox="0 0 16 16" >
  286. <path fill-rule="evenodd" d="M13.5 8a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0M6.53 5.47a.75.75 0 0 0-1.06 1.06L6.94 8 5.47 9.47a.75.75 0 1 0 1.06 1.06L8 9.06l1.47 1.47a.75.75 0 1 0 1.06-1.06L9.06 8l1.47-1.47a.75.75 0 1 0-1.06-1.06L8 6.94z" clip-rule="evenodd"></path>
  287. </svg>
  288. {% elif history[t.full_name][h].status == 'passed' %}
  289. <svg class="svg_passed" viewBox="0 0 16 16" >
  290. <path fill-rule="evenodd" d="M13.5 8a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0m-3.9-1.55a.75.75 0 1 0-1.2-.9L7.419 8.858 6.03 7.47a.75.75 0 0 0-1.06 1.06l2 2a.75.75 0 0 0 1.13-.08z" clip-rule="evenodd"></path>
  291. </svg>
  292. {% elif history[t.full_name][h].status == 'mute' %}
  293. <svg class="svg_mute" viewBox="0 0 17 16" >
  294. <path fill-rule="evenodd" d="M5.06 9.94A1.5 1.5 0 0 0 4 9.5H2a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h2a1.5 1.5 0 0 0 1.06-.44l2.483-2.482a.268.268 0 0 1 .457.19v8.464a.268.268 0 0 1-.457.19zM2 5h2l2.482-2.482A1.768 1.768 0 0 1 9.5 3.768v8.464a1.768 1.768 0 0 1-3.018 1.25L4 11H2a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2m10.28.72a.75.75 0 1 0-1.06 1.06L12.44 8l-1.22 1.22a.75.75 0 1 0 1.06 1.06l1.22-1.22 1.22 1.22a.75.75 0 1 0 1.06-1.06L14.56 8l1.22-1.22a.75.75 0 0 0-1.06-1.06L13.5 6.94z" clip-rule="evenodd"></path> </svg>
  295. </svg>
  296. {% endif %}
  297. <span class="tooltip">
  298. Status: {{history[t.full_name][h].status}}<br>
  299. Date: {{ history[t.full_name][h].datetime }}<br>
  300. {% if history[t.full_name][h].status_description != "" %}
  301. Info: {{ history[t.full_name][h].status_description.split(';')[0][0:100] }}<br>
  302. {% endif %}
  303. SHA: <a href="https://github.com/ydb-platform/ydb//commit/{{ history[t.full_name][h].commit }}" style="color: #00f;" target="_blank">{{history[t.full_name][h].commit[0:8]}}</a>
  304. </span>
  305. </span>
  306. {% endfor %}
  307. </td>
  308. {% elif (status.is_error and history) %}
  309. <td></td>
  310. {% elif status.is_error %}
  311. {% endif %}
  312. <td><span title="{{ t.elapsed }}s">{{ t.elapsed_display }}</span></td>
  313. <td>
  314. <span class="test_status test_{{ t.status_display }}">{{ t.status_display }}</span>
  315. </td>
  316. {% if status in has_any_log %}
  317. <td>
  318. {% if t.log_urls %}
  319. {% for log_name, log_url in t.log_urls.items() %}
  320. <a href="{{ log_url }}">{{ log_name }}</a>{% if not loop.last %} | {% endif %}
  321. {% endfor %}
  322. {% else %}
  323. &nbsp;
  324. {% endif %}
  325. </td>
  326. {% endif %}
  327. </tr>
  328. {% endfor %}
  329. </tbody>
  330. </table>
  331. {% endfor %}
  332. </body>
  333. </html>