github.com/yrj2011/jx-test-infra@v0.0.0-20190529031832-7a2065ee98eb/gubernator/templates/build.html (about)

     1  % extends 'base.html'
     2  {% block title %}{{job}} #{{build}} Results{% endblock %}
     3  % block head
     4  {{super()}}
     5  % if not finished
     6  <link rel="icon" type="image/png" href="{{'favicon-yellow.png'|static}}" />
     7  % elif finished and finished['passed'] and not res['failed']
     8  <link rel="icon" type="image/png" href="{{'favicon-green.png'|static}}" />
     9  % endif
    10  % endblock
    11  % block header
    12  <h1>{% if pr and pr != "batch"  %}<a href="/pr/{{pr_path}}{{pr}}">{% if repo != "kubernetes/kubernetes"%}{{repo}} {% endif %}PR #{{pr}}</a> {% endif %}
    13  	% if testgrid_query
    14  		<a href="{{testgrid_query|tg_url}}">{{job}}</a>
    15  	% else
    16  		{{job}}
    17  	% endif
    18  	#{{build}}</h1>
    19  	<p><a href="/builds{{job_dir}}">Recent runs</a><br>
    20  % endblock
    21  % block content
    22  <div id="summary">
    23  	<table class="build-meta">
    24  	% if pr and pr_digest
    25  		% set pl = pr_digest.payload
    26  		<tr><td>PR<td><a href="/pr/{{pl['author']}}">{{pl['author']}}</a>: {{pl['title']}}
    27  	% endif
    28  		% if finished
    29  			% set result = finished['result']
    30  		% else
    31  			% set result = 'Not Finished'
    32  		% endif
    33  		<tr><td>Result<td><span class="build-{{result | slugify}}">{{result}}</span>
    34  	% if started
    35  		% if finished
    36  			<tr><td>Tests<td>
    37  			% if res['failed']
    38  				<span class="text-failure">{{res['failed']|length}} failed</span>
    39  			% else
    40  				{{res['failed']|length}} failed
    41  			% endif
    42  			/ {{res['passed']|length}} succeeded
    43  		% endif
    44  		<tr><td>Started<td>{{started['timestamp']|timestamp}}
    45  		{% if finished %}<tr><td>Elapsed<td>{{(finished['timestamp']-started['timestamp'])|duration}}{% endif %}
    46  		<tr><td>Version<td><a href="https://github.com/{{repo}}/commit/{{commit}}">{{started['version'] or finished['version']}}</a>
    47  		% if 'node' in started
    48  			<tr><td>Builder<td>{{started['node']}}
    49  		% endif
    50  		% if refs
    51  			<tr><td>Refs<td>
    52  			% for name, sha in refs
    53  				{%- if name.isdigit() -%}
    54  					<a href="https://github.com/{{repo}}/pull/{{name}}">{{name}}</a>
    55  				{%- else -%}
    56  					{{name}}
    57  				{%- endif -%}
    58  				{%- if sha %}:{{sha|github_commit_link(repo)}}{% endif %}<br>
    59  			{%- endfor %}
    60  		% endif
    61  		% if 'metadata' in started
    62  			% for k, v in started['metadata']|dictsort
    63  			<tr><td>{{k}}<td>{{v|maybe_linkify}}
    64  			% endfor
    65  		% endif
    66  		% if finished and 'metadata' in finished
    67  			% for k, v in finished['metadata']|dictsort
    68  			<tr><td>{{k}}<td>{{v|maybe_linkify}}
    69  			% endfor
    70  		% endif
    71  	% endif
    72  	</table>
    73  	<ul class="nav">
    74  		<li class="nav"><a href="{{build_dir | gcs_browse_url}}">artifacts</a></li>
    75  		<li class="nav"><a href="?log#log">build log</a></li>
    76  	</ul>
    77  	</div>
    78  	<div id="failures">
    79  	% if issues
    80  		<h4>References</h4>
    81  		% for issue in issues
    82  		<a href="{{issue.url}}">
    83  		{% if issue.is_pr %}PR{% else %}Issue{% endif %} #{{issue.number}} {{issue.payload['title']}}</a>
    84  		<br>
    85  		% endfor
    86  		<hr>
    87  	% endif
    88  	% if res['failed']
    89  		<h2>Test Failures</h2>
    90  		% for name, time, text, filename, output in res['failed']
    91  			<hr>
    92  			<h3><a class="anchor" id="{{name|slugify}}" href="#{{name|slugify}}">{{name}}<span class="time"> {{time|duration}}</span></h3></a>
    93  			% if 'junit_runner' not in filename
    94  				<pre class="cmd" onclick="select(this)">{{name | testcmd}}</pre>
    95  			% endif
    96  			% if text
    97  				<pre class="error">{{text|linkify_stacktrace(commit, repo)}}
    98  				% if output
    99  				<div class="hidden"><hr>{{output|linkify_stacktrace(commit, repo)}}</div>
   100  				<span class="expand inset-expand">Click to see stdout/stderr</span><span class="inset-filename">from <a href="https://storage.googleapis.com{{filename}}">{{filename|basename}}</a></span></pre>
   101  				% else
   102  				<span class="inset-filename">from <a href="https://storage.googleapis.com{{filename}}">{{filename|basename}}</a></span></pre>
   103  				% endif
   104  				% set pod_name = text|parse_pod_name
   105  				% if pod_name
   106  					<p>Find <tt>{{pod_name}}</tt> mentions in <a id="{{pod_name|slugify}}" href="/build{{build_dir}}/nodelog?pod={{pod_name}}&junit={{filename|basename}}&wrap=on">log files</a>
   107  				% else
   108  					<p>Filter through <a href="/build{{build_dir}}/nodelog?junit={{filename|basename}}&wrap=on">log files</a>
   109  				% endif
   110  				% if testgrid_query
   111  					| View <a href="{{testgrid_query|tg_url(name)}}">test history</a> on testgrid
   112  				% endif
   113  			% else
   114  				<span class="inset-filename">from <a href="https://storage.googleapis.com{{filename}}">{{filename|basename}}</a></span>
   115  			% endif
   116  		% endfor
   117  	% else
   118  		<h2>{{"No Test Failures!" if finished else "Build Still Running!"}}</h2>
   119  	% endif
   120  	</div>
   121  	% for kind in ['passed', 'skipped']
   122  		% if res[kind]
   123  			<hr>
   124  			<div id="{{kind}}" class="testlist">
   125  			<span class="expand">Show {{res[kind]|length}} {{kind|title}} Tests</span>
   126  			<h2 class="hidden">{{kind|title}}</h2>
   127  			% for name in res[kind]
   128  				<p class="hidden">{{name}}
   129  			% endfor
   130  			</div>
   131  		% endif
   132  	% endfor
   133  	% if build_log
   134  	<div id="log">
   135  		<a name="log"></a>
   136  		<hr>
   137  		<h2 id="log">Error lines from build-log.txt</h2>
   138  		<ul class="log">
   139  			<li class="log"><button onclick="javascript:expand_all(this.parentElement)">Expand Skipped Lines</button></li>
   140  			<li class="log"><a id="rawloglink" href="{{build_log_src or "https://storage.googleapis.com%s/build-log.txt" % build_dir}}">Raw build-log.txt</a></li>
   141  		</ul>
   142  		<pre data-src="{{build_log_src or "%s/build-log.txt" % build_dir}}">{{build_log | safe}}</pre>
   143  	</div>
   144  	% endif
   145  % endblock