aboutsummaryrefslogtreecommitdiff
path: root/templates/testrunner/jenkins_build_view.html
blob: e10097382be43384f204307280c71f2851aed542 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
{% extends 'testrunner/base.html' %}


{% block maincontent %}
  <div class="row" ng-controller="JenkinsBuild">
    <div class="col-lg-12">

      <form action="/testrunner/compare_results/" method="GET">

	{% for build in jenkins_build %}
          <div class="page-header">
	    <h1> {{ build.name }}</h1>
	    <h2><a href="{{ build.job.get_absolute_url }}">{{ build.job.name }}</a></h2>
          </div>

          {% for subbuild in build.jenkinsbuild_set.all %}
	    <div class="panel panel-default">

	      <div class="panel-heading">
		<b>{{ subbuild.get_hwpack_name }}</b>
	      </div>

	      <div class="panel-body">

		<div class="row">

		  <div class="col-lg-9">

		    <table id="job-status" class="table table-striped table-condensed">
		      <thead>
			<tr>
			  <th>Build name</th>
			  <th>Build status</th>
			  <th>Build number</th>
			  <th>Date</th>
			  <th></th>
			</tr>
		      </thead>
		      <tbody id="job-status-body">
			<tr>
			  <td>{{ subbuild.name }}</td>
			  <td>{{ subbuild.status.name }}</td>
			  <td>{{ subbuild.number }}</td>
			  <td>{{ subbuild.timestamp }}</td>
			  <td>
			    <a href="{{ jjob.get_last_build.get_absolute_url }}">
			      <i class="fa fa-search"></i>
			    </a>
			  </td>
			</tr>
		      </tbody>
		    </table>

		    {% if subbuild.testruns.count %}
		      <h3>Manual test results</h3>
                      <table id="job-status" class="table table-striped table-condensed">
			<thead>
			  <tr>
		    	    <th>Testplan</th>
			    <th>Created</th>
			    {% for status in statuses %}
			      <th> {{ status.name }} </th>
			    {% endfor %}
			      <th> bugs </th>
			  </tr>
			</thead>
			<tbody id="job-status-body">
			  {% for testrun in subbuild.testruns.all %}
		    	    <tr>
		    	      <td>
				<a href="/testmanualrunner/#/testrun/{{testrun.id}}">
				  {{ testrun.test_plan.name }}
				</a>
			      </td>
			      <td> {{ testrun.created_at }}</td>
			      {% for name, count in testrun.get_results %}
				<td> {{ count }} </td>
			      {% endfor %}
				<td> {{ testrun.get_bug_count }} </td>
		    	    </tr>
			  {% endfor %}
			</tbody>
                      </table>
		    {% endif %}

		    <h3>
		      Automated test results
		    </h3>

		    <div class="row">
		      <div class="col-md-5" ng-controller="FetchLavaJob">

			  <div class="form-group" ng-class="{'has-error':lavajob_fetch_error}">
			    <p class="help-block" ng-bind="lavajob_fetch_error"></p>
			    <div class="input-group">
			      <input type="text" class="form-control input-sm" placeholder="Lava ID" 
				     ng-model="lavajob_id"/ >
				     <span class="input-group-btn">
				       <a href="" ng-click="fetch({{ subbuild.id }})" 
					       class="btn btn-default btn-sm" ng-disabled="!lavajob_id">
					       Fetch Lava Job
				       </a>
				     </span>
			    </div>
			  </div>
			
		      </div>
		    </div>

		    {% for lavajob in subbuild.lavajob_set.all %}
		      <h4>
			{{ lavajob.device_type.name }}
			<a href="{{ lavajob.get_absolute_url }}">#{{ lavajob.number }}</a>
		      </h4>
                      <table id="job-status" class="table table-striped table-condensed">
			<thead>
			  <tr>
		    	    <th>Test name</th>
		    	    <th>Test status</th>
		    	    <th>Pass</th>
		    	    <th>Fail</th>
		    	    <th>Skip</th>
		    	    <th>Compare</th>
			  </tr>
			</thead>
			<tbody id="job-status-body">
			  {% for testdef, testresult in lavajob.get_definitions_results %}
		    	    <tr>
		    	      <td>{{ testdef.name }}</td>
		    	      <td>{% if testresult %} OK {% else %} Missing {% endif %}</td>
		    	      <td>{{ testresult.get_resultset_count_by_status.pass }}</td>
		    	      <td>{{ testresult.get_resultset_count_by_status.fail }}</td>
		    	      <td>{{ testresult.get_resultset_count_by_status.skip }}</td>
		    	      <td>
		    		{% if testresult %}
		    		  <input type="checkbox" value="{{ testresult.pk }}" name="testresults"/>
		    		{% endif %}
		    	      </td>
		    	    </tr>
			  {% endfor %}
			</tbody>
                      </table>
		    {% endfor %}
		  </div>

		  <div class="col-lg-3" ng-init="_tags[{{ subbuild.id }}] = { {% for tag in subbuild.tags.all %}{{ tag.id }}:true, {% endfor %} }; build_id = {{ subbuild.id }}">

		    <div class="well">
		      <b>Tags</b>

		      <div ng-repeat="tag in tags" class="checkbox">
			<label>
		    	  <input type="checkbox" ng-model="_tags[{{ subbuild.id }}][tag.id]" />
			  //tag.name//
			</label>
		      </div>

		      <a href="" ng-click="save_tags(_tags[{{ subbuild.id }}],{{ subbuild.id }})"
			 class="btn btn-default btn-sm">Save</a>
		    </div>

		  </div>
		</div>
	      </div>

	      <div class="panel-footer">
		<div class="row">
		  <div class="col-lg-12">
		    <div class="btn-group pull-right ">
		      <a ng-href="/testmanualrunner/#/testrun/new/{{ subbuild.id }}"
			 class="btn btn-default btn-sm">Manual Tests</a>
	      		 <button type="submit" class="btn btn-default btn-sm">Compare</button>
              {% if subbuild.get_all_result_pks %}
              <a href="/testrunner/compare_results/?{{ subbuild.get_all_result_pks }}" class="btn btn-default btn-sm">Compare all</a>
              {% endif %}
		    </div>
		  </div>
		</div>
	      </div>

	    </div>
	  {% endfor %}
	{% endfor %}
      </form>
    </div>
  </div>
{% endblock %}