sigs.k8s.io/prow@v0.0.0-20240503223140-c5e374dc7eb1/pkg/spyglass/lenses/junit/template.html (about)

     1  {{define "header"}}
     2  <link rel="stylesheet" type="text/css" href="junit.css">
     3  <script type="text/javascript" src="script_bundle.min.js"></script>
     4  {{end}}
     5  
     6  {{define "body"}}
     7  {{$numF := len .Failed}}
     8  {{$numFlk := len .Flaky}}
     9  {{$numP := len .Passed}}
    10  {{$numS := len .Skipped}}
    11  {{if eq .NumTests 0}}
    12    <div id="empty-junit-container">
    13      No tests were recorded.
    14    </div>
    15  {{else}}
    16  <div id="junit-container">
    17    <table id="junit-table" class="mdl-data-table mdl-js-data-table mdl-shadow--2dp">
    18    {{if gt $numF 0}}
    19    <tr id="failed-theader" class="header section-expander">
    20      <td class="mdl-data-table__cell--non-numeric expander failed" colspan="1"><h6>{{len .Failed}}/{{.NumTests}} Tests Failed.</h6></td>
    21      <td class="mdl-data-table__cell--non-numeric expander"><i id="failed-expander" class="icon-button material-icons arrow-icon noselect">expand_less</i></td>
    22    </tr>
    23    <tbody id="failed-tbody">
    24      {{range $ix, $test := .Failed}}
    25        {{$numTest := len $test.Junit}}
    26        {{$firstTest := index $test.Junit 0}}
    27        {{if eq $numTest 1}}
    28        <tr>
    29          <td colspan="2" style="padding: 0;">
    30            <table class="failed-layout">
    31              <tr class="failure-name">
    32                <td class="mdl-data-table__cell--non-numeric test-name">{{$firstTest.ClassName}}: {{$firstTest.Name}}&nbsp;<i class="icon-button material-icons arrow-icon">expand_more</i></td>
    33                <td class="mdl-data-table__cell--non-numeric" style="text-align: right;">{{$firstTest.Duration}}</td>
    34              </tr>
    35              <tr class="hidden failure-text">
    36                <td colspan="2" class="mdl-data-table__cell--non-numeric">
    37                  <div>{{$firstTest.Failure}}</div>
    38                  {{if $firstTest.Output}}
    39                  <a href="#" class="open-stdout-stderr">open stdout<i class="material-icons" style="font-size: 1em; vertical-align: middle; padding-left: 3px;">open_in_new</i></a>
    40                  <pre style="display: none;">{{$firstTest.Output}}</pre>
    41                  {{end}}
    42                  {{if $firstTest.Error}}
    43                  <a href="#" class="open-stdout-stderr">open stderr<i class="material-icons" style="font-size: 1em; vertical-align: middle; padding-left: 3px;">open_in_new</i></a>
    44                  <pre style="display: none;">{{$firstTest.Error}}</pre>
    45                  {{end}}
    46                </td>
    47              </tr>
    48            </table>
    49          </td>
    50        </tr>
    51        {{else}}
    52        <tr>
    53          <td colspan="2" style="padding: 0;">
    54            <table class="failed-layout">
    55              <tr class="failure-name">
    56                <td class="mdl-data-table__cell--non-numeric test-name">{{$firstTest.ClassName}}: {{$firstTest.Name}}&nbsp;<i class="icon-button material-icons arrow-icon">expand_more</i></td>
    57              </tr>
    58              <tr class="hidden">
    59                <td>
    60                  <table  class="failed-layout">
    61                    {{range $ixt, $indTest := $test.Junit}}
    62                    <tr  class="failure-text">
    63                      <td colspan="2" style="padding: 0;">
    64                        <table class="failed-layout">
    65                          <tr class="failure-name">
    66                            <td class="mdl-data-table__cell--non-numeric test-name">Run #{{$ixt}}: {{$indTest.Status}}&nbsp;<i class="icon-button material-icons arrow-icon">expand_more</i></td>
    67                            <td class="mdl-data-table__cell--non-numeric" style="text-align: right;">{{$indTest.Duration}}</td>
    68                          </tr>
    69                          <tr class="hidden failure-text">
    70                            <td colspan="2" class="mdl-data-table__cell--non-numeric">
    71                              <div>{{$indTest.Failure}}</div>
    72                              {{if $indTest.Output}}
    73                              <a href="#" class="open-stdout-stderr">open stdout<i class="material-icons" style="font-size: 1em; vertical-align: middle; padding-left: 3px;">open_in_new</i></a>
    74                              <pre style="display: none;">{{$indTest.Output}}</pre>
    75                              {{end}}
    76                              {{if $indTest.Error}}
    77                              <a href="#" class="open-stdout-stderr">open stderr<i class="material-icons" style="font-size: 1em; vertical-align: middle; padding-left: 3px;">open_in_new</i></a>
    78                              <pre style="display: none;">{{$indTest.Error}}</pre>
    79                              {{end}}
    80                            </td>
    81                          </tr>
    82                        </table>
    83                      </td>
    84                    </tr>
    85                    {{end}}
    86                  </table>
    87                </td>
    88              </tr>
    89            </table>
    90          </td>
    91        </tr>
    92        {{end}}
    93      {{end}}
    94    </tbody>
    95    {{end}}
    96    {{if gt $numFlk 0}}
    97    <tr id="flaky-theader" class="header section-expander">
    98      <td class="mdl-data-table__cell--non-numeric expander flaky" colspan="1"><h6>{{len .Flaky}}/{{.NumTests}} Tests Flaky.</h6></td>
    99      <td class="mdl-data-table__cell--non-numeric expander"><i id="flaky-expander" class="icon-button material-icons arrow-icon noselect">expand_less</i></td>
   100    </tr>
   101    <tbody id="flaky-tbody">
   102      {{range $ix, $test := .Flaky}}
   103        {{$firstTest := index $test.Junit 0}}
   104        <tr>
   105          <td colspan="2" style="padding: 0;">
   106            <table class="flaky-layout">
   107              <tr class="flaky-name">
   108                <td class="mdl-data-table__cell--non-numeric test-name">{{$firstTest.ClassName}}: {{$firstTest.Name}}&nbsp;<i class="icon-button material-icons arrow-icon">expand_more</i></td>
   109              </tr>
   110              <tr class="hidden">
   111                <td>
   112                  <table class="flaky-layout">
   113                    {{range $ixt, $indTest := $test.Junit}}
   114                    <tr  class="flaky-text">
   115                      <td colspan="2" style="padding: 0;">
   116                        <table class="flaky-layout">
   117                          <tr class="flaky-name">
   118                            <td class="mdl-data-table__cell--non-numeric test-name">Run #{{$ixt}}: {{$indTest.Status}}&nbsp;<i class="icon-button material-icons arrow-icon">expand_more</i></td>
   119                            <td class="mdl-data-table__cell--non-numeric" style="text-align: right;">{{$indTest.Duration}}</td>
   120                          </tr>
   121                          <tr class="hidden flaky-text">
   122                            <td colspan="2" class="mdl-data-table__cell--non-numeric">
   123                              <div>{{$indTest.Failure}}</div>
   124                              {{if $indTest.Output}}
   125                              <a href="#" class="open-stdout-stderr">open stdout<i class="material-icons" style="font-size: 1em; vertical-align: middle; padding-left: 3px;">open_in_new</i></a>
   126                              <pre style="display: none;">{{$indTest.Output}}</pre>
   127                              {{end}}
   128                              {{if $indTest.Error}}
   129                              <a href="#" class="open-stdout-stderr">open stderr<i class="material-icons" style="font-size: 1em; vertical-align: middle; padding-left: 3px;">open_in_new</i></a>
   130                              <pre style="display: none;">{{$indTest.Error}}</pre>
   131                              {{end}}
   132                            </td>
   133                          </tr>
   134                        </table>
   135                      </td>
   136                    </tr>
   137                    {{end}}
   138                  </table>
   139                </td>
   140              </tr>
   141            </table>
   142          </td>
   143        </tr>
   144      {{end}}
   145    </tbody>
   146    {{end}}
   147    {{if gt $numP 0}}
   148      <tr id="passed-theader" class="header section-expander">
   149        <td class="mdl-data-table__cell--non-numeric expander passed" colspan="1"><h6>{{len .Passed}}/{{.NumTests}} Tests Passed!</h6></td>
   150        <td class="mdl-data-table__cell--non-numeric expander"><i id="passed-expander" class="icon-button material-icons arrow-icon noselect">expand_more</i></td>
   151      </tr>
   152      <tbody id="passed-tbody" class="hidden-tests">
   153        {{range .Passed}}
   154          {{$firstTest := index .Junit 0}}
   155          <tr>
   156            <td class="mdl-data-table__cell--non-numeric test-name">{{$firstTest.ClassName}}: {{$firstTest.Name}}</td>
   157            <td class="mdl-data-table__cell--non-numeric">{{$firstTest.Duration}}</td>
   158          </tr>
   159        {{end}}
   160      </tbody>
   161    {{end}}
   162    {{if gt $numS 0}}
   163      <tr id="skipped-theader" class="header section-expander">
   164        <td class="mdl-data-table__cell--non-numeric expander skipped" colspan="1"><h6>{{len .Skipped}}/{{.NumTests}} Tests Skipped.</h6></td>
   165        <td class="mdl-data-table__cell--non-numeric expander"><i id="skipped-expander" class="icon-button material-icons arrow-icon noselect">expand_more</i></td>
   166      </tr>
   167      <tbody id="skipped-tbody" class="hidden-tests">
   168        {{range .Skipped}}
   169          {{$firstTest := index .Junit 0}}
   170          <tr>
   171  	   {{if eq $firstTest.SkippedReason "" }}
   172  	   <td class="mdl-data-table__cell--non-numeric test-name">{{$firstTest.ClassName}}: {{$firstTest.Name}}</td>
   173  	   {{else}}
   174  	   <td class="mdl-data-table__cell--non-numeric test-name">{{$firstTest.ClassName}}: {{$firstTest.Name}}</br> </br><b>Reason:</b> {{$firstTest.SkippedReason}}</td>
   175  	   {{end}}
   176            <td class="mdl-data-table__cell--non-numeric">{{$firstTest.Duration}}</td>
   177          </tr>
   178        {{end}}
   179      </tbody>
   180    {{end}}
   181    </table>
   182  </div>
   183  {{end}}
   184  {{end}}
   185