123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <html>
- <head>
- <style>
- th {
- text-transform: uppercase;
- }
- th, td {
- padding: 5px;
- }
- table {
- border-collapse: collapse;
- }
- span.test_status {
- font-weight: bold;
- }
- span.test_fail {
- color: red;
- }
- span.test_pass {
- color: green;
- }
- span.test_mute {
- color: blue;
- }
- button.copy {
- float: right;
- }
- table > tbody > tr > td:nth-child(2),
- table > tbody > tr > td:nth-child(3),
- table > tbody > tr > td:nth-child(4) {
- text-align: center;
- }
- </style>
- <script>
- function copyTestNameToClipboard(text) {
- const full_name = text.trim();
- const pieces = /(.+)\/([^$]+)$/.exec(full_name);
- if (!pieces) {
- console.error("Unable to split path/test for %o", full_name);
- return;
- }
- let [path, testName] = [pieces[1], pieces[2]];
- const namePieces = testName.split('.');
- if (namePieces.length === 2) {
- testName = namePieces[0] + '::' + namePieces[1];
- } else {
- testName = namePieces[0] + '.' + namePieces[1] + '::' + namePieces.slice(2).join('::');
- }
- const cmdArg = `${path} -F '${testName}'`;
- console.log(cmdArg);
- navigator.clipboard.writeText(cmdArg).catch(
- () => {
- console.error("Unable to copy %o to clipboard", cmdArg);
- }
- );
- }
- function copyOnPress(event) {
- event.preventDefault();
- copyTestNameToClipboard(event.target.previousElementSibling.textContent)
- }
- document.addEventListener("DOMContentLoaded", function() {
- const els = document.getElementsByClassName("copy");
- for (let i = 0; i < els.length; i++) {
- els[i].addEventListener('click', copyOnPress);
- }
- });
- </script>
- </head>
- <body>
- {% for status in status_order %}
- <h1 id="{{ status.name}}">{{ status.name }} ({{ tests[status] | length }})</h1>
- <table style="width:100%;" border="1">
- <thead>
- <tr>
- <th>test name</th>
- <th>elapsed</th>
- <th>status</th>
- {% if status in has_any_log %}
- <th>LOG</th>
- {% endif %}
- </tr>
- </thead>
- <tbody>
- {% for t in tests[status] %}
- <tr>
- <td>
- <span>{{ t.full_name }}</span>
- {% if status.is_error %}<button class="copy" title="Copy test filter to clipboard">Copy test filter</button>{% endif %}
- </td>
- <td><span title="{{ t.elapsed }}s">{{ t.elapsed_display }}</span></td>
- <td>
- <span class="test_status test_{{ t.status_display }}">{{ t.status_display }}</span>
- </td>
- {% if status in has_any_log %}
- <td>
- {% if t.log_urls %}
- {% for log_name, log_url in t.log_urls.items() %}
- <a href="{{ log_url }}">{{ log_name.upper() }}</a>{% if not loop.last %} | {% endif %}
- {% endfor %}
- {% else %}
-
- {% endif %}
- </td>
- {% endif %}
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% endfor %}
- </body>
- </html>
|