-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
872 lines (709 loc) · 30.4 KB
/
index.html
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
---
title: Home Page
---
<head>
{% include common.html %}
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke: steelblue;
stroke-width: 1;
fill: none;
}
</style>
</head>
{% for post in site.posts %}
{% if post.pull_request_issue_id == "" and post.repository %}
{% capture base_repository %}{{ post.repository }}{% endcapture %}
{% capture results_repository %}{{ post.results_repository }}{% endcapture %}
{% break %}
{% endif %}
{% endfor %}
{% include common_variables.html %}
<body>
<script>
var query = $.parseQuery();
function reloadPage(linux, windows, macos, activeonly)
{
var loc = window.location.href.split('?')[0];
window.location.href=loc + "?linux=" + linux + "&windows=" + windows + "&macos=" + macos + "&activeonly=" + activeonly;
}
var linux_enabled = (query["linux"] || query["linux"] == null) && query["linux"] != "false";
var windows_enabled = (query["windows"] || query["windows"] == null) && query["windows"] != "false";
var macos_enabled = (query["macos"] || query["macos"] == null) && query["macos"] != "false";
var active_data_only = (query["activeonly"] || query["activeonly"] == null) && query["activeonly"] != "false";
if (active_data_only) {
document.writeln("<ol class='breadcrumb'><li><a href='full_dashboard.html'>Full Dashboard</a></li><li>Active Dashboard</li><li><a href='performance.html'>Performance</a></li><li><a href='bot_health.html'>Bot Health</a></li></ol>");
} else {
document.writeln("<ol class='breadcrumb'><li>Full Dashboard</li><li><a href='index.html'>Active Dashboard</a></li><li><a href='performance.html'>Performance</a></li><li><a href='bot_health.html'>Bot Health</a></li></ol>");
}
</script>
<div class="page-header">
<h1>Dashboard for {{ dashboard_title }}</h1>
</div>
<script>
document.writeln("<button type='button' onclick='reloadPage(linux_enabled, windows_enabled, macos_enabled, !active_data_only)' class='btn btn-default " + (active_data_only?'active':'') + "'>Active Data Only</button>");
document.writeln("<button type='button' onclick='reloadPage(!linux_enabled, windows_enabled, macos_enabled, active_data_only)' class='btn btn-default " + (linux_enabled?'active':'') + "'>Show Linux</button>");
document.writeln("<button type='button' onclick='reloadPage(linux_enabled, !windows_enabled, macos_enabled, active_data_only)' class='btn btn-default " + (windows_enabled?'active':'') + "'>Show Windows</button>");
document.writeln("<button type='button' onclick='reloadPage(linux_enabled, windows_enabled, !macos_enabled, active_data_only)' class='btn btn-default " + (macos_enabled?'active':'') + "'>Show MacOS</button>");
document.writeln("<br/><br/>");
</script>
<script>
var width = 80;
var height = 25;
var x = d3.scale.linear().range([0, width - 2]);
var y = d3.scale.linear().range([height - 4, 0]);
var line = d3.svg.line()
// .interpolate("basis")
.x(function(d) { return x(d.x); })
.y(function(d) { return y(d.y); });
function sparkline(elemId, indata) {
var data = [];
for (var i = 0; i < indata.length; ++i){
if (indata[i].x != null && indata[i].y != null && !isNaN(indata[i].x) && !isNaN(indata[i].y)) {
data.push(indata[i]);
}
}
x.domain(d3.extent(data, function(d) { return d.x; }));
y.domain(d3.extent(data, function(d) { return d.y; }));
var svg = d3.select(elemId)
.append('svg')
.attr('width', width)
.attr('height', height)
.append('g')
.attr('transform', 'translate(0, 2)');
svg.append('path')
.datum(data)
.attr('class', 'path')
.attr('d', line);
for (var i = 0; i < data.length; ++i)
{
svg.append('circle')
.attr('class', 'circle')
.attr('cx', x(data[i].x))
.attr('cy', y(data[i].y))
.attr('r', 1.7);
if (i == 0)
{
var url = "{{ base_commit_url }}/" + data[i].sha;
} else {
var url = "{{ base_compare_url }}/" + data[i-1].sha + "..." + data[i].sha;
}
svg.append('a').attr("xlink:href", url)
.append('circle')
.attr('class', 'mouse-over-circle')
.attr('cx', x(data[i].x))
.attr('cy', y(data[i].y))
.attr('r', 5.5)
.append('svg:title')
.text(data[i].y + " messages\nsha: " + data[i].sha);
}
}
var num_sparklines = 0;
var status_types = {
SUCCESS: 0,
FAIL: 1,
WARN: 2
}
var table_types = {
BRANCH: 0,
PULL_REQUEST: 1,
RELEASE: 2
}
function build_status_table(table_type, table_data)
{
var filtered_data = null;
var table_name = "";
var field_name = "";
var github_icon = "";
var base_url = "";
if (table_type == table_types.BRANCH) {
table_name = "Branches";
filtered_data = table_data.filter(function(o) { return o.pull_request_issue_id == "" && o.is_release == false && o.branch_name != null });
field_name = "branch_name";
github_icon = "<span class='octicon octicon-git-branch'></span>";
base_url = "{{ base_branch_url }}";
} else if (table_type == table_types.PULL_REQUEST) {
table_name = "External Pull Requests";
filtered_data = table_data.filter(function(o) { return o.pull_request_issue_id != "" && o.is_release == false });
field_name = "pull_request_issue_id";
github_icon = "<span class='octicon octicon-git-pull-request'></span>";
base_url = "{{ base_pull_request_url }}";
} else if (table_type == table_types.RELEASE) {
table_name = "Releases";
filtered_data = table_data.filter(function(o) { return o.is_release == true});
field_name = "tag_name";
github_icon = "<span class='octicon octicon-tag'></span>";
base_url = "{{ base_release_url }}";
}
filtered_data = filtered_data.filter(function(o) {
if (windows_enabled && o.device_id.indexOf("Win") != -1) {
return true;
} else if (linux_enabled && o.device_id.indexOf("Linux") != -1) {
return true;
} else if (macos_enabled && o.device_id.indexOf("Mac") != -1) {
return true;
} else {
return false;
}
}
);
for (var i = 0; i < filtered_data.length; ++i)
{
filtered_data[i].js_date = parseDate(filtered_data[i].date);
}
var min_date = new Date(0);
if (active_data_only) {
var max_date = new Date(0);
for (var i = 0; i < filtered_data.length; ++i)
{
if (filtered_data[i].js_date >= max_date) {
max_date = filtered_data[i].js_date;
}
}
min_date = new Date(max_date - 4 * 24 * 60 * 60 * 1000);
}
var allowed_devices = [];
var allowed_keys = [];
for (var i = 0; i < filtered_data.length; ++i)
{
if (filtered_data[i].js_date >= min_date) {
if (allowed_devices.indexOf(filtered_data[i].device_id) == -1) {
allowed_devices.push(filtered_data[i].device_id);
}
if (allowed_keys.indexOf(filtered_data[i][field_name]) == -1) {
allowed_keys.push(filtered_data[i][field_name]);
}
}
}
filtered_data = filtered_data.filter(function(o) {
return allowed_devices.indexOf(o.device_id) != -1 &&
allowed_keys.indexOf(o[field_name]) != -1;
});
devices = {};
for (var i = 0; i < filtered_data.length; ++i)
{
var device_id = filtered_data[i].device_id;
if (!devices.hasOwnProperty(device_id)) {
devices[device_id] = {build:false, test:false, package:false, coverage:false, performance:false};
}
devices[device_id].build = true;
devices[device_id].test = devices[device_id].test || !filtered_data[i].analyze_only;
devices[device_id].package = devices[device_id].package || (filtered_data[i].is_release && !filtered_data[i].packaging_skipped);
devices[device_id].coverage = devices[device_id].coverage || filtered_data[i].coverage_enabled;
devices[device_id].performance = devices[device_id].performance || (filtered_data[i].performance_total_time != null);
}
device_ids = [];
for (var device_id in devices) {
device_ids.push(device_id);
}
device_ids.sort();
document.writeln("<div class='alert alert-info'><h4>" + table_name + "</h4></div>");
document.writeln("<table class='table'>");
// device ids
document.writeln("<tr><th></th>");
for (var i = 0; i < device_ids.length; ++i)
{
var device_id = device_ids[i];
var colspan = (devices[device_id].build?1:0) + (devices[device_id].test?1:0) + (devices[device_id].package?1:0) + (devices[device_id].coverage?1:0) + (devices[device_id].performance?1:0);
var icon = osIcon(device_id);
document.writeln("<th style='border-left:2px solid gray' colspan=" + colspan + "><h4>" +
icon + " " + device_id.replace(/-/g, " ") +
"</h4></th>");
}
document.writeln("</tr>");
// types of builds
document.writeln("<tr><td></td>");
for (var i = 0; i < device_ids.length; ++i)
{
var device_id = device_ids[i];
document.writeln("<td style='border-left:2px solid gray'><h5>Build</h5></td>");
if (devices[device_id].test) {
document.writeln("<td><h5>Test</h5></td>");
}
if (devices[device_id].package) {
document.writeln("<td><h5>Package</h5></td>");
}
if (devices[device_id].coverage) {
document.writeln("<td><h5>Coverage</h5></td>");
}
if (devices[device_id].performance) {
document.writeln("<td><h5>Performance</h5></td>");
}
}
document.writeln("</tr>");
// builds
var keys = [];
var organized_data = {};
for (var i = 0; i < filtered_data.length; ++i)
{
var key_name = filtered_data[i][field_name];
if (keys.indexOf(key_name) == -1) {
keys.push(key_name);
}
if (!organized_data.hasOwnProperty(key_name)) {
organized_data[key_name] = {};
organized_data[key_name].last_date = new Date(0);
organized_data[key_name].last_sha = "";
}
var device_id = filtered_data[i].device_id;
if (!organized_data[key_name].hasOwnProperty(device_id)) {
organized_data[key_name][device_id] = {results: []};
}
if (organized_data[key_name].last_date < filtered_data[i].js_date) {
organized_data[key_name].last_date = filtered_data[i].js_date;
organized_data[key_name].last_sha = filtered_data[i].commit_sha;
}
var last_index = organized_data[key_name][device_id].results.push(filtered_data[i]) - 1;
if (devices[device_id].build) {
organized_data[key_name][device_id].results[last_index].build_status = function(){
if (filtered_data[i].build_error_count > 0) {
return status_types.FAIL;
} else if (filtered_data[i].build_warning_count > 0) {
return status_types.WARN;
} else {
return status_types.SUCCESS;
}
}();
}
if (devices[device_id].package) {
organized_data[key_name][device_id].results[last_index].package_status = function(){
if (filtered_data[i].package_error_count > 0) {
return status_types.FAIL;
} else if (filtered_data[i].package_warning_count > 0) {
return status_types.WARN;
} else {
return status_types.SUCCESS;
}
}();
}
if (devices[device_id].coverage) {
organized_data[key_name][device_id].results[last_index].coverage_status = function(){
var coverage_percent = 100 * (filtered_data[i].coverage_lines / filtered_data[i].coverage_total_lines);
if (coverage_percent >= filtered_data[i].coverage_pass_limit) {
return status_types.SUCCESS;
} else if (coverage_percent >= filtered_data[i].coverage_warn_limit) {
return status_types.WARN;
} else {
return status_types.FAIL;
}
}();
}
if (devices[device_id].test) {
organized_data[key_name][device_id].results[last_index].test_status = function(){
if (filtered_data[i].test_run == false) {
return status_types.FAIL;
}
var test_percent = (filtered_data[i].test_count == 0)?(100):(100 * (filtered_data[i].test_passed_count / filtered_data[i].test_count));
var test_warn_limit = filtered_data[i].hasOwnProperty("test_warn_limit")?filtered_data[i].test_warn_limit:99.99;
var test_pass_limit = filtered_data[i].hasOwnProperty("test_pass_limit")?filtered_data[i].test_pass_limit:90.00;
if (test_percent >= test_warn_limit) {
return status_types.SUCCESS;
} else if (test_percent >= test_pass_limit) {
return status_types.WARN;
} else {
return status_types.FAIL;
}
}();
}
}
keys.sort(
function(lhs, rhs) {
if (field_name != "branch_name" && $.isNumeric(lhs) && $.isNumeric(rhs)) {
return lhs - rhs;
}
if (lhs == "master" && rhs != "master") {
return -1;
} else if (lhs == "develop" && rhs != "master" && rhs != "develop") {
return -1;
} else if (lhs != "master" && rhs == "master") {
return 1;
} else if (lhs != "develop" && lhs != "master" && rhs == "develop") {
return 1;
} else if (lhs < rhs) {
return -1;
} else if (lhs == rhs) {
return 0;
} else {
return 1;
}
}
);
for (var i = 0; i < keys.length; ++i)
{
var key = keys[i];
var key_status = status_types.SUCCESS;
var key_pending = false;
for (var j = 0; j < device_ids.length; ++j) {
var device_id = device_ids[j];
if (!organized_data[key].hasOwnProperty(device_id)) {
organized_data[key][device_id] = {results: []};
}
organized_data[key][device_id].results.sort(
function(lhs, rhs) {
return lhs.js_date - rhs.js_date;
}
);
var active_result =
function(){
for (var k = 0; k < organized_data[key][device_id].results.length; ++k)
{
if (organized_data[key][device_id].results[k].commit_sha == organized_data[key].last_sha) {
return [k, false];
}
}
// else
return [organized_data[key][device_id].results.length - 1, true];
}();
organized_data[key][device_id].active_result = active_result[0];
organized_data[key][device_id].out_of_date = active_result[1];
if (active_result[0] >= 0 && devices[device_id].performance && organized_data[key][device_id].results[active_result[0]].performance_total_time > 0) {
var performance_slope = function(){
var current_test_count = organized_data[key][device_id].results[organized_data[key][device_id].results.length - 1].performance_test_count;
var values = [];
for (var i = organized_data[key][device_id].results.length - 1; i >= 0; --i) {
if (organized_data[key][device_id].results[i].performance_test_count == current_test_count) {
values.unshift(organized_data[key][device_id].results[i].performance_total_time);
} else {
break;
}
}
if (values.length <= 1) {
return null;
}
y_min = values.reduce(function(prev, cur) { return Math.min(prev, cur) }, values[0]);
values.forEach(function(element, index, array) {
array[index] = element / y_min;
});
y_mean = values.reduce(function(prev,cur) { return prev + cur; }, 0) / values.length;
x_mean = (values.length - 1) / 2;
slope_top = 0;
values.forEach(function(element, index, array) {
slope_top += (index - x_mean) * (element - y_mean);
});
slope_bottom = 0;
values.forEach(function(element, index, array) {
slope_bottom += (index - x_mean) * (index - x_mean);
});
return slope_top / slope_bottom;
}();
organized_data[key][device_id].results[active_result[0]].performance_status = function(){
var performance_slope_percent = function(){
if (performance_slope == null) return null;
return performance_slope * 100;
}();
var baseline_percent = function() {
var baseline = get_baseline(organized_data[key][device_id].results[active_result[0]]);
if (baseline == null) return null;
if (baseline.performance_total_time == null) return null;
// negative is faster, positive is slower
return (1.0 - (baseline.performance_total_time / organized_data[key][device_id].results[active_result[0]].performance_total_time )) * 100.0;
}();
var status_func = function(percent) {
if (percent == null) return status_types.SUCCESS;
if (percent > 10.0) return status_types.FAIL;
if (percent > 0.05) return status_types.WARN;
return status_types.SUCCUSS;
};
var slope_status = status_func(performance_slope_percent);
var baseline_status = status_func(baseline_percent);
if (baseline_percent == null) {
return slope_status;
} else {
return baseline_status;
}
}();
organized_data[key][device_id].results[active_result[0]].performance_slope = performance_slope;
}
key_pending = key_pending || (active_result[0] > -1 && organized_data[key][device_id].results[active_result[0]].pending);
var normalize_status = function(lhs, rhs) {
if (lhs == status_types.FAIL || rhs == status_types.FAIL) {
return status_types.FAIL;
} else if (lhs == status_types.WARN || rhs == status_types.WARN) {
return status_types.WARN;
} else {
return status_types.SUCCESS;
}
};
if (active_result[0] > -1) {
if (organized_data[key][device_id].results[active_result[0]].unhandled_failure) {
key_status = status_types.FAIL;
} else {
key_status =
normalize_status(key_status,
normalize_status(organized_data[key][device_id].results[active_result[0]].build_status,
normalize_status(organized_data[key][device_id].results[active_result[0]].test_status,
normalize_status(organized_data[key][device_id].results[active_result[0]].package_status,
normalize_status(organized_data[key][device_id].results[active_result[0]].performance_status,
organized_data[key][device_id].results[active_result[0]].coverage_status)
)
)
)
);
}
}
}
organized_data[key].status = key_status;
organized_data[key].pending = key_pending;
}
for (var i = 0; i < keys.length; ++i)
{
var key = keys[i];
var row_style = function() {
if (key == "develop" || key == "master") {
return "style='border-top:2px dashed gray; border-bottom:2px dashed gray'";
} else {
return "";
}
}();
document.writeln("<tr " + row_style + ">");
var github_status =
function() {
if (organized_data[key].status == status_types.FAIL) {
return "<p class='text-danger'><span class='octicon octicon-x'></span></p>";
} else if (organized_data[key].pending) {
return "<p class='text-warning'><fa fa-cog fa-spin'></span></p>";
} else if (organized_data[key].status == status_types.WARN) {
return "<p class='text-warning'><span class='octicon octicon-check'></span></p>";
} else {
return "<p class='text-success'><span class='octicon octicon-check'></span></p>";
}
}();
var sha_link = organized_data[key].last_sha==null?"":("<a href='{{base_commit_url}}/" + organized_data[key].last_sha + "'>" + organized_data[key].last_sha.substr(0,12) + "...</a>");
document.writeln("<td><h5>" + github_icon + "<a href='" + base_url + "/" + encodeURIComponent(key) + "'>" + key + "</a><small><br/>" + sha_link + "</small>" + github_status + "</h5></td>");
var build_status_cell = function(has_data, run_time, num_errors, num_warnings, status_type, num_passed, num_tests, failure_type, pending, is_left_cell, message_override, unhandled_failure, url, commit_url, asset_url, release_url, coverage_url, is_out_of_date, badge_override) {
var message = function(){
if (!has_data) {
return "No Data";
} else if (pending) {
return "Pending";
} else if (unhandled_failure) {
return "Unhandled Failure";
} else if (message_override != null) {
return message_override;
} else if (num_errors > 0 && num_warnings > 0) {
return failure_type + " / Warnings";
} else if (num_errors > 0) {
return failure_type;
} else if (num_warnings > 0) {
return "Warnings";
} else if (status_type == status_types.FAIL) {
return failure_type;
} else if (status_type == status_types.WARN) {
return "Warnings";
} else {
return "Success";
}
}();
var time = function(){
if (pending || run_time == null)
{
return "";
} else {
return (Math.round(run_time * 100) / 100) + "s";
}
}();
var cell_class = function(){
if (!has_data) {
return "info no-data";
} else if (unhandled_failure) {
return "Unhandled Failure";
} else if (pending) {
return "warning";
} else if (status_type == status_types.WARN) {
return "warning";
} else if (status_type == status_types.FAIL) {
return "danger";
} else {
return "success";
}
}();
var badge = function(){
if (badge_override != null) {
return badge_override;
}
if (pending || !has_data) {
return "";
} else if (num_tests != null) {
if (num_tests == 0) {
return "NA";
} else {
return Math.floor(100 * (num_passed / num_tests)) + "%";
}
} else {
return num_errors + " / " + num_warnings;
}
}();
var out_of_date = function() {
if (is_out_of_date) {
return "<span title='Build is out of date.'><i class='fa fa-clock-o'></i></span>";
} else {
return "";
}
}();
var asset = function() {
if (asset_url != null) {
return "<a href='" + asset_url + "'><i class='fa fa-file-text-o'></i></a>";
} else {
return "";
}
}();
var coverage = function() {
if (coverage_url != null) {
return "<a href='" + coverage_url + "'><i class='fa fa-eye'></i></a>";
} else {
return "";
}
}();
var release = function() {
if (release_url != null) {
return "<a href='" + release_url + "'><i class='fa fa-cloud-download'></i></a>";
} else {
return "";
}
}();
var commit = function() {
if (commit_url != null) {
return commit_url;
} else {
return "";
}
}();
return "<td " + (is_left_cell?"style='border-left:2px solid gray'":"") + " class='" + cell_class + "'>" +
"<div class='table-box'><h6><a href='"+url+"'>" + message + "<span class='badge pull-right'>" + badge + "</span></a>" +
"<br/><small>" + time + "<br/>" + commit + "</small> " + out_of_date +
"</h6>" + coverage + asset + release + "<div id='sparkline-" + (++num_sparklines) + "' class='float-bottom'></div></div></td>";
}
for (var j = 0; j < device_ids.length; ++j) {
var device_id = device_ids[j];
var result = null;
if (organized_data[key][device_id].active_result > -1) {
result = organized_data[key][device_id].results[organized_data[key][device_id].active_result];
}
var pending = result==null?false:result.pending;
var unhandled_failure = result==null?false:result.unhandled_failure;
var baseurl = result==null?".":(".") + result.url;
// has_data, run_time, num_errors, num_warnings, status_type, num_passed, num_tests, failure_type, pending, is_left_cell, message_override, unhandled_failure, url, commit_url, asset_url, release_url, coverage_url, is_out_of_date
if (devices[device_id].build) {
var error_count = result==null?0:result.build_error_count;
var warning_count = result==null?0:result.build_warning_count;
var status = result==null?null:result.build_status;
var run_time = result==null?null:result.build_time;
var commit_url = (result==null||result.commit_sha==null)?null:"<a href='{{base_commit_url}}/" + result.commit_sha + "'>" + result.commit_sha.substr(0, 11) + "</a>";
var asset_url = result==null?null:result.asset_url;
var release_url = null;
var coverage_url = null;
var is_out_of_date = result==null?false:(result.commit_sha != organized_data[key].last_sha);
document.writeln(build_status_cell(result != null, run_time, error_count, warning_count, status, null, null, "Errors", pending, true, null, unhandled_failure, baseurl+"#build", commit_url, asset_url, release_url, coverage_url, is_out_of_date, null));
if (table_type != table_types.RELEASE) {
sparkline('#sparkline-' + num_sparklines, organized_data[key][device_id].results.map(
function(element, index, array){
return { x: index, y: element.build_error_count + element.build_warning_count, sha: element.commit_sha };
})
);
}
}
if (devices[device_id].test) {
var passed_count = result==null?0:result.test_passed_count;
var status = result==null?null:result.test_status;
var test_count = result==null?null:result.test_count;
var run_time = result==null?null:result.test_time;
var commit_url = null;
var asset_url = null;
var release_url = null;
var coverage_url = null;
var is_out_of_date = false;
document.writeln(build_status_cell(result != null && !result.analyze_only, run_time, null, null, status, passed_count, test_count, "Failures", pending, false, null, unhandled_failure, baseurl+"#test", commit_url, asset_url, release_url, coverage_url, is_out_of_date, null));
if (table_type != table_types.RELEASE) {
sparkline('#sparkline-' + num_sparklines, organized_data[key][device_id].results.map(
function(element, index, array){
return { x: index, y: element.test_count - element.test_passed_count, sha: element.commit_sha };
})
);
}
}
if (devices[device_id].package) {
var error_count = result==null?0:result.package_error_count;
var warning_count = result==null?0:result.package_warning_count;
var status = result==null?null:result.package_status;
var run_time = result==null?null:result.package_time;
var commit_url = null;
var asset_url = null;
var release_url = result==null?null:("{{base_release_url}}/"+result.tag_name);
var coverage_url = null;
var is_out_of_date = false;
var message = function(){
if (result == null) {
return null;
} else if (!result.test_run) {
return "Not Run";
} else {
return null;
}
}();
document.writeln(build_status_cell(result != null && !result.packaging_skipped, run_time, error_count, warning_count, status, null, null, "Errors", pending, false, message, unhandled_failure, baseurl+"#package", commit_url, asset_url, release_url, coverage_url, is_out_of_date, null));
if (table_type != table_types.RELEASE) {
sparkline('#sparkline-' + num_sparklines, organized_data[key][device_id].results.map(
function(element, index, array){
return { x: index, y: element.package_warning_count + element.package_error_count, sha: element.commit_sha };
})
);
}
}
if (devices[device_id].coverage) {
var lines = result==null?null:result.coverage_lines;
var total_lines = result==null?null:result.coverage_total_lines;
var status = result==null?null:result.coverage_status
var commit_url = null;
var asset_url = null;
var release_url = null;
var coverage_url = result==null?null:result.coverage_url;
var is_out_of_date = false;
document.writeln(build_status_cell(result != null && result.coverage_enabled, null, 0, 0, status, lines, total_lines, "Errors", pending, false, "Percent Lines Covered", unhandled_failure, baseurl+"#coverage", commit_url, asset_url, release_url, coverage_url, is_out_of_date, null));
if (table_type != table_types.RELEASE) {
sparkline('#sparkline-' + num_sparklines, organized_data[key][device_id].results.map(
function(element, index, array){
return { x: index, y: element.coverage_lines / element.coverage_total_lines, sha: element.commit_sha };
})
);
}
}
if (devices[device_id].performance) {
var total_time = result==null?null:result.performance_total_time;
var commit_url = null;
var asset_url = null;
var release_url = null;
var status = result==null?null:result.performance_status
var coverage_url = null
var is_out_of_date = false;
var has_data = result != null && result.performance_total_time != null;
var performance_badge = function(){
if (result == null) {
return null;
} else if ( result.performance_slope == null || result.performance_status == status_types.WARN ) {
return "<i class='fa fa-meh-o'></i>";
} else if ( result.performance_status != status_types.FAIL ) {
return "<i class='fa fa-smile-o'></i>";
} else {
return "<i class='fa fa-frown-o'></i>";
}
}();
document.writeln(build_status_cell(has_data, null, 0, 0, status, null, total_time, "Errors", pending, false, "Performance Run Time", unhandled_failure, baseurl+"#performance", commit_url, asset_url, release_url, coverage_url, is_out_of_date, performance_badge));
if (has_data && table_type != table_types.RELEASE) {
sparkline('#sparkline-' + num_sparklines, organized_data[key][device_id].results.map(
function(element, index, array){
return { x: index, y: (element.performance_total_time>0 ? element.performance_total_time : null), sha: element.commit_sha };
})
);
}
}
}
document.writeln("</tr>");
}
document.writeln("</table>");
}
build_status_table(table_types.BRANCH, data);
build_status_table(table_types.PULL_REQUEST, data);
build_status_table(table_types.RELEASE, data);
</script>
</body>