summary.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <html>
  2. <head>
  3. <style>
  4. th {
  5. text-transform: uppercase;
  6. }
  7. th, td {
  8. padding: 5px;
  9. }
  10. table {
  11. border-collapse: collapse;
  12. }
  13. span.test_status {
  14. font-weight: bold;
  15. }
  16. span.test_fail {
  17. color: red;
  18. }
  19. span.test_pass {
  20. color: green;
  21. }
  22. span.test_mute {
  23. color: blue;
  24. }
  25. button.copy {
  26. float: right;
  27. }
  28. table > tbody > tr > td:nth-child(2),
  29. table > tbody > tr > td:nth-child(3),
  30. table > tbody > tr > td:nth-child(4) {
  31. text-align: center;
  32. }
  33. </style>
  34. <script>
  35. function copyTestNameToClipboard(text) {
  36. const full_name = text.trim();
  37. const pieces = /(.+)\/([^$]+)$/.exec(full_name);
  38. if (!pieces) {
  39. console.error("Unable to split path/test for %o", full_name);
  40. return;
  41. }
  42. let [path, testName] = [pieces[1], pieces[2]];
  43. const namePieces = testName.split('.');
  44. if (namePieces.length === 2) {
  45. testName = namePieces[0] + '::' + namePieces[1];
  46. } else {
  47. testName = namePieces[0] + '.' + namePieces[1] + '::' + namePieces.slice(2).join('::');
  48. }
  49. const cmdArg = `${path} -F '${testName}'`;
  50. console.log(cmdArg);
  51. navigator.clipboard.writeText(cmdArg).catch(
  52. () => {
  53. console.error("Unable to copy %o to clipboard", cmdArg);
  54. }
  55. );
  56. }
  57. function copyOnPress(event) {
  58. event.preventDefault();
  59. copyTestNameToClipboard(event.target.previousElementSibling.textContent)
  60. }
  61. document.addEventListener("DOMContentLoaded", function() {
  62. const els = document.getElementsByClassName("copy");
  63. for (let i = 0; i < els.length; i++) {
  64. els[i].addEventListener('click', copyOnPress);
  65. }
  66. });
  67. </script>
  68. </head>
  69. <body>
  70. {% for status in status_order %}
  71. <h1 id="{{ status.name}}">{{ status.name }} ({{ tests[status] | length }})</h1>
  72. <table style="width:100%;" border="1">
  73. <thead>
  74. <tr>
  75. <th>test name</th>
  76. <th>elapsed</th>
  77. <th>status</th>
  78. {% if status in has_any_log %}
  79. <th>LOG</th>
  80. {% endif %}
  81. </tr>
  82. </thead>
  83. <tbody>
  84. {% for t in tests[status] %}
  85. <tr>
  86. <td>
  87. <span>{{ t.full_name }}</span>
  88. {% if status.is_error %}<button class="copy" title="Copy test filter to clipboard">Copy test filter</button>{% endif %}
  89. </td>
  90. <td><span title="{{ t.elapsed }}s">{{ t.elapsed_display }}</span></td>
  91. <td>
  92. <span class="test_status test_{{ t.status_display }}">{{ t.status_display }}</span>
  93. </td>
  94. {% if status in has_any_log %}
  95. <td>
  96. {% if t.log_urls %}
  97. {% for log_name, log_url in t.log_urls.items() %}
  98. <a href="{{ log_url }}">{{ log_name.upper() }}</a>{% if not loop.last %} | {% endif %}
  99. {% endfor %}
  100. {% else %}
  101. &nbsp;
  102. {% endif %}
  103. </td>
  104. {% endif %}
  105. </tr>
  106. {% endfor %}
  107. </tbody>
  108. </table>
  109. {% endfor %}
  110. </body>
  111. </html>