Report page prototype
This patch provides templates (Jinja-like) for single test run report and for comparison of two test runs. By default these templates display demo results. https://storyboard.openstack.org/#!/story/111 Change-Id: Icde3559216d3a7a38c7a8e6a54e7a53300d309e9
This commit is contained in:
parent
d9731e6819
commit
b04873c70c
@ -9,8 +9,6 @@
|
||||
<h2> {{release}} Tracked Capabilities</h2>
|
||||
</script>
|
||||
<script id="capabilities_template" type="x-tmpl-mustache">
|
||||
|
||||
|
||||
{{#capabilities}}
|
||||
<ul>
|
||||
<li> <a onclick="$('#{{class}}_tests').toggle(500);return false;" href="#"> {{class}} capabilities ({{count}} of {{total}} total) </a>
|
||||
@ -25,10 +23,10 @@
|
||||
<li>Achievements (met {{achievements_count}} of {{criteria_count}} total): {{#achievements}} <a href="#{{.}}">{{.}}</a> {{/achievements}}
|
||||
{{#admin}}<li>Admin rights required</li>{{/admin}}
|
||||
{{#core}}<li>Core test</li>{{/core}}</li>
|
||||
<li> <a onclick="$('#{{name}}').toggle(500);return false;" href="#"> Tests ({{tests_count}}) </a>
|
||||
<div id="{{name}}" style="display:none;">
|
||||
<li> <a onclick="toggle_one_item('{{class}}', '{{id}}', 'tests_list');return false;" href="#"> Tests ({{tests_count}}) </a>
|
||||
<div id="{{id}}_tests_list" class="{{class}}_tests_list" style="display:none;">
|
||||
<ul>
|
||||
{{#tests}} <li> {{.}} {{#code_url}} {{.}} {{/code_url}} </li> {{/tests}}
|
||||
{{#tests}} <li> {{.}} <a href="javascript:void(get_code_url('{{.}}'));"> [github] </a> </li> {{/tests}}
|
||||
</ul>
|
||||
<div>
|
||||
</li>
|
||||
@ -58,19 +56,23 @@
|
||||
{{/criteria}}
|
||||
</script>
|
||||
<script src="/js/helpers.js"></script>
|
||||
<script>
|
||||
window.render_page = function(){render_capabilities_page()};
|
||||
$(document).ready(window.render_page);
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="header"></div>
|
||||
|
||||
<input id="only_core" name="only_core" type="checkbox" checked onclick="create_caps()" />
|
||||
<input id="only_core" name="only_core" type="checkbox" checked onclick="render_page()" />
|
||||
<label for="only_core">Show only core tests</label>
|
||||
<br>
|
||||
<select id="admin" onclick="create_caps()">
|
||||
<option>All tests</option>
|
||||
<option>Tests require admin rights</option>
|
||||
<option>Tests don't require admin rights</option>
|
||||
<select id="admin" onchange="render_page()">
|
||||
<option value="all" >All tests</option>
|
||||
<option value="admin" >Tests require admin rights</option>
|
||||
<option value="noadmin">Tests don't require admin rights</option>
|
||||
</select>
|
||||
<div id="capabilities"></div>
|
||||
|
||||
@ -80,4 +82,4 @@
|
||||
|
||||
<div>Copyright OpenStack Foundation, 2014. Apache 2 License.</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
@ -1,140 +1,181 @@
|
||||
function has_upper_case(str) {
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
// not use this file except in compliance with the License. You may obtain
|
||||
// a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
// License for the specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
/*global $:false */
|
||||
/*global Mustache:false */
|
||||
/*global window:false */
|
||||
/*global document:false */
|
||||
/*jslint devel: true*/
|
||||
/* jshint -W097 */
|
||||
/*jslint node: true */
|
||||
|
||||
'use strict';
|
||||
|
||||
var has_upper_case = function (str) {
|
||||
return (/[A-Z]/.test(str));
|
||||
}
|
||||
};
|
||||
|
||||
function capitaliseFirstLetter(string){
|
||||
var capitaliseFirstLetter = function (string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
};
|
||||
|
||||
function code_url(text, render){
|
||||
return render( '<a href="javascript:void(get_code_url(\'' +
|
||||
text + '\'));"> [github] </a>' );
|
||||
}
|
||||
|
||||
function get_code_url (test_id) {
|
||||
var id = test_id.split('/').join('.');
|
||||
var parts = id.split('.');
|
||||
var path_array = [];
|
||||
for (var i in parts){
|
||||
if (has_upper_case(parts[i])) { break }
|
||||
path_array.push(parts[i])
|
||||
}
|
||||
// Function searches for test with specified test_id on github and opens result in new window
|
||||
var get_code_url = function (test_id) {
|
||||
var id = test_id.split('/').join('.'),
|
||||
parts = id.split('.'),
|
||||
path_array = [],
|
||||
path,
|
||||
test,
|
||||
url;
|
||||
$(parts).each(function (i, part) {
|
||||
if (has_upper_case(part)) {return false; }
|
||||
path_array.push(part);
|
||||
});
|
||||
path_array.pop();
|
||||
var path = path_array.join('/');
|
||||
var test = parts.slice(-1)[0] + '(';
|
||||
path = path_array.join('/');
|
||||
test = parts.slice(-1)[0] + '(';
|
||||
test = test.replace(/\s+/g, '');
|
||||
path = path.replace(/\s+/g, '');
|
||||
var url = 'https://api.github.com/search/code?q=' + test +
|
||||
url = 'https://api.github.com/search/code?q=' + test +
|
||||
' repo:openstack/tempest extension:py path:' + path;
|
||||
console.log(url);
|
||||
$.when($.ajax({type: 'GET', url: url, dataType: 'json'})).done(
|
||||
function (data, status, xhr) {
|
||||
if (data['items'].length < 1) {
|
||||
alert('No test found !')
|
||||
}
|
||||
var html_url = data['items'][0]['html_url'];
|
||||
console.log(data['items'][0]['git_url']);
|
||||
$.when($.ajax({type: 'GET', url: data['items'][0]['git_url'], dataType: 'json'})).done(
|
||||
function (data, status, xhr) {
|
||||
var content = window.atob(data['content'].replace(/\s+/g, '')).split('\n');
|
||||
for (var i in content) {
|
||||
if (content[i].indexOf(test) > -1) {
|
||||
var line = parseInt(i) + 1;
|
||||
var url = html_url + '#L' + line;
|
||||
var win = window.open(url, '_blank');
|
||||
win.focus();
|
||||
}
|
||||
}
|
||||
function (data, status, xhr) {
|
||||
if (data.items.length < 1) {
|
||||
alert('No test found !');
|
||||
}
|
||||
var html_url = data.items[0].html_url;
|
||||
console.log(data.items[0].git_url);
|
||||
$.when($.ajax({type: 'GET', url: data.items[0].git_url, dataType: 'json'})).done(
|
||||
function (data, status, xhr) {
|
||||
var content = window.atob(data.content.replace(/\s+/g, '')).split('\n');
|
||||
content.forEach(function (line, i) {
|
||||
if (line.indexOf(test) > -1) {
|
||||
var github_url = html_url + '#L' + i.toString(),
|
||||
win = window.open(github_url, '_blank');
|
||||
win.focus();
|
||||
}
|
||||
)
|
||||
});
|
||||
|
||||
}
|
||||
function render_header(data){
|
||||
var template = $('#header_template').html();
|
||||
data["release"] = capitaliseFirstLetter(data["release"]);
|
||||
var rendered = Mustache.render(template, data);
|
||||
$("div#header").html(rendered);
|
||||
}
|
||||
|
||||
function render_caps(only_core, admin_filter, data){
|
||||
var template = $('#capabilities_template').html();
|
||||
var criteria_count = Object.keys(data['criteria']).length;
|
||||
var caps_dict = {'capabilities': {}};
|
||||
var capabilities_count = 0;
|
||||
for(var id in data['capabilities']){
|
||||
var capability = data['capabilities'][id];
|
||||
capability['class'] = id.split('-')[0];
|
||||
capability['id'] = id;
|
||||
if (!(capability['class'] in caps_dict['capabilities'])){
|
||||
caps_dict['capabilities'][capability['class']] = {
|
||||
'items': [],
|
||||
'total': 0
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
caps_dict['capabilities'][capability['class']]['total'] += 1;
|
||||
if (only_core == true && (capability['core'] !== true)) {continue}
|
||||
if (admin_filter == 'Tests require admin rights' && (capability['admin'] !== true)) {continue}
|
||||
if (admin_filter == "Tests don't require admin rights" && (capability['admin'] == true)) {continue}
|
||||
capability['code_url'] = function(){
|
||||
return code_url
|
||||
);
|
||||
};
|
||||
|
||||
// Function builds list of capabilities from json schema and applies filters to this list
|
||||
var build_caps_list = function (data, filters) {
|
||||
var criteria_count = Object.keys(data.criteria).length,
|
||||
caps_dict = {'capabilities': {}},
|
||||
caps_list = {
|
||||
'release': data.release,
|
||||
'capabilities': [],
|
||||
'criteria_count': criteria_count,
|
||||
'global_test_list': [],
|
||||
"scope_tests_list": []
|
||||
};
|
||||
capability['achievements_count'] = capability['achievements'].length;
|
||||
capability['tests_count'] = capability['tests'].length;
|
||||
caps_dict['capabilities'][capability['class']]['items'].push(capability)
|
||||
}
|
||||
var caps_list={
|
||||
'capabilities': [],
|
||||
'criteria_count': criteria_count
|
||||
};
|
||||
for (var cls in caps_dict['capabilities']){
|
||||
if (caps_dict['capabilities'][cls]['items'].length == 0) {
|
||||
continue
|
||||
}
|
||||
caps_list['capabilities'].push({
|
||||
'class': cls,
|
||||
'items': caps_dict['capabilities'][cls]['items'],
|
||||
'count': caps_dict['capabilities'][cls]['items'].length,
|
||||
'total': caps_dict['capabilities'][cls]['total']
|
||||
})
|
||||
}
|
||||
var rendered = Mustache.render(template, caps_list);
|
||||
|
||||
$("div#capabilities").html(rendered);
|
||||
}
|
||||
|
||||
function render_criteria(data){
|
||||
var template = $('#criteria_template').html();
|
||||
var crits = {'criteria': []};
|
||||
for(var tag in data['criteria']){
|
||||
var criterion = data['criteria'][tag];
|
||||
criterion['tag'] = tag;
|
||||
crits['criteria'].push(criterion);
|
||||
}
|
||||
var rendered = Mustache.render(template, crits);
|
||||
|
||||
$("ul#criteria").html(rendered);
|
||||
}
|
||||
|
||||
function create_caps() {
|
||||
|
||||
if (document.getElementById('only_core')){
|
||||
only_core = document.getElementById('only_core').checked
|
||||
}
|
||||
else only_core = true;
|
||||
if (document.getElementById('admin')){
|
||||
admin_filter = document.getElementById('admin').value
|
||||
}
|
||||
else admin_filter = 'All tests';
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
url: 'havanacore.json',
|
||||
success: function(data, status, xhr) {
|
||||
render_caps(only_core, admin_filter, data);
|
||||
render_criteria(data);
|
||||
render_header(data)
|
||||
$.each(data.capabilities, function (id, capability) {
|
||||
capability.class = id.split('-')[0];
|
||||
capability.id = id;
|
||||
if (!(caps_dict.capabilities.hasOwnProperty(capability.class))) {
|
||||
caps_dict.capabilities[capability.class] = {
|
||||
'items': [],
|
||||
'total': 0
|
||||
};
|
||||
}
|
||||
capability.tests.forEach(function (test) {
|
||||
if (caps_list.global_test_list.indexOf(test) < 0) {
|
||||
caps_list.global_test_list.push(test);
|
||||
}
|
||||
});
|
||||
caps_dict.capabilities[capability.class].total += 1;
|
||||
if (filters.only_core === true && (capability.core !== true)) {return; }
|
||||
if (filters.admin_filter === 'admin' && (capability.admin !== true)) {return; }
|
||||
if (filters.admin_filter === 'noadmin' && (capability.admin === true)) {return; }
|
||||
capability.tests.forEach(function (test) {
|
||||
if (caps_list.scope_tests_list.indexOf(test) < 0) {
|
||||
caps_list.scope_tests_list.push(test);
|
||||
}
|
||||
});
|
||||
capability.achievements_count = capability.achievements.length;
|
||||
capability.tests_count = capability.tests.length;
|
||||
caps_dict.capabilities[capability.class].items.push(capability);
|
||||
});
|
||||
}
|
||||
window.onload = create_caps();
|
||||
caps_list.scope_tests_count = caps_list.scope_tests_list.length;
|
||||
$.each(caps_dict.capabilities, function (class_id, cap_class) {
|
||||
if (cap_class.items.length === 0) {return; }
|
||||
caps_list.capabilities.push({
|
||||
'class': class_id,
|
||||
'items': cap_class.items,
|
||||
'count': cap_class.items.length,
|
||||
'total': cap_class.total
|
||||
});
|
||||
});
|
||||
return caps_list;
|
||||
};
|
||||
|
||||
//Get admin and core filter values
|
||||
var get_filters_local = function () {
|
||||
if (document.getElementById('only_core')) {
|
||||
window.only_core = document.getElementById('only_core').checked;
|
||||
} else {
|
||||
window.only_core = true;
|
||||
}
|
||||
if (document.getElementById('admin')) {
|
||||
window.admin_filter = document.getElementById('admin').value;
|
||||
} else {
|
||||
window.admin_filter = 'all';
|
||||
}
|
||||
return {only_core: window.only_core, admin_filter: window.admin_filter};
|
||||
};
|
||||
|
||||
//Rendering page header
|
||||
var render_header = function (data) {
|
||||
var template = $('#header_template').html();
|
||||
data.release = capitaliseFirstLetter(data.release);
|
||||
$("div#header").html(Mustache.render(template, data));
|
||||
};
|
||||
|
||||
//Rendeirng capabilities list
|
||||
var render_caps = function (data) {
|
||||
var filters = get_filters_local(),
|
||||
template = $('#capabilities_template').html(),
|
||||
caps_list = build_caps_list(data, filters),
|
||||
rendered = Mustache.render(template, caps_list);
|
||||
$("div#capabilities").html(rendered);
|
||||
};
|
||||
|
||||
//Rendering criteria section
|
||||
var render_criteria = function (data) {
|
||||
var template = $('#criteria_template').html(),
|
||||
crits = {'criteria': []};
|
||||
$.map(data.criteria, function (criterion, tag) {
|
||||
criterion.tag = tag;
|
||||
crits.criteria.push(criterion);
|
||||
});
|
||||
|
||||
$("ul#criteria").html(Mustache.render(template, crits));
|
||||
};
|
||||
|
||||
//Rendering page
|
||||
var render_capabilities_page = function () {
|
||||
$.get('capabilities/havanacore.json').done(function (data) {
|
||||
render_caps(data);
|
||||
render_criteria(data);
|
||||
render_header(data);
|
||||
});
|
||||
};
|
||||
|
||||
//Helper for toggling one item in list
|
||||
var toggle_one_item = function (klass, id, postfix) {
|
||||
$('div.' + klass + '_' + postfix + ':not(div#' + id + '_' + postfix + ')').slideUp();
|
||||
$('div#' + id + '_' + postfix).slideToggle();
|
||||
};
|
1
refstack/static/capabilities/havanacore.json
Symbolic link
1
refstack/static/capabilities/havanacore.json
Symbolic link
@ -0,0 +1 @@
|
||||
../../../defcore/havanacore.json
|
5160
refstack/static/capabilities/icehouse_mockup.json
Normal file
5160
refstack/static/capabilities/icehouse_mockup.json
Normal file
File diff suppressed because it is too large
Load Diff
1
refstack/static/comparison.html
Symbolic link
1
refstack/static/comparison.html
Symbolic link
@ -0,0 +1 @@
|
||||
../templates/comparison.html
|
117
refstack/static/js/jquery.cookie.js
Normal file
117
refstack/static/js/jquery.cookie.js
Normal file
@ -0,0 +1,117 @@
|
||||
/*!
|
||||
* jQuery Cookie Plugin v1.4.1
|
||||
* https://github.com/carhartl/jquery-cookie
|
||||
*
|
||||
* Copyright 2006, 2014 Klaus Hartl
|
||||
* Released under the MIT license
|
||||
*/
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// CommonJS
|
||||
factory(require('jquery'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
|
||||
var pluses = /\+/g;
|
||||
|
||||
function encode(s) {
|
||||
return config.raw ? s : encodeURIComponent(s);
|
||||
}
|
||||
|
||||
function decode(s) {
|
||||
return config.raw ? s : decodeURIComponent(s);
|
||||
}
|
||||
|
||||
function stringifyCookieValue(value) {
|
||||
return encode(config.json ? JSON.stringify(value) : String(value));
|
||||
}
|
||||
|
||||
function parseCookieValue(s) {
|
||||
if (s.indexOf('"') === 0) {
|
||||
// This is a quoted cookie as according to RFC2068, unescape...
|
||||
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
||||
}
|
||||
|
||||
try {
|
||||
// Replace server-side written pluses with spaces.
|
||||
// If we can't decode the cookie, ignore it, it's unusable.
|
||||
// If we can't parse the cookie, ignore it, it's unusable.
|
||||
s = decodeURIComponent(s.replace(pluses, ' '));
|
||||
return config.json ? JSON.parse(s) : s;
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
function read(s, converter) {
|
||||
var value = config.raw ? s : parseCookieValue(s);
|
||||
return $.isFunction(converter) ? converter(value) : value;
|
||||
}
|
||||
|
||||
var config = $.cookie = function (key, value, options) {
|
||||
|
||||
// Write
|
||||
|
||||
if (arguments.length > 1 && !$.isFunction(value)) {
|
||||
options = $.extend({}, config.defaults, options);
|
||||
|
||||
if (typeof options.expires === 'number') {
|
||||
var days = options.expires, t = options.expires = new Date();
|
||||
t.setTime(+t + days * 864e+5);
|
||||
}
|
||||
|
||||
return (document.cookie = [
|
||||
encode(key), '=', stringifyCookieValue(value),
|
||||
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
||||
options.path ? '; path=' + options.path : '',
|
||||
options.domain ? '; domain=' + options.domain : '',
|
||||
options.secure ? '; secure' : ''
|
||||
].join(''));
|
||||
}
|
||||
|
||||
// Read
|
||||
|
||||
var result = key ? undefined : {};
|
||||
|
||||
// To prevent the for loop in the first place assign an empty array
|
||||
// in case there are no cookies at all. Also prevents odd result when
|
||||
// calling $.cookie().
|
||||
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
||||
|
||||
for (var i = 0, l = cookies.length; i < l; i++) {
|
||||
var parts = cookies[i].split('=');
|
||||
var name = decode(parts.shift());
|
||||
var cookie = parts.join('=');
|
||||
|
||||
if (key && key === name) {
|
||||
// If second argument (value) is a function it's a converter...
|
||||
result = read(cookie, value);
|
||||
break;
|
||||
}
|
||||
|
||||
// Prevent storing a cookie that we couldn't decode.
|
||||
if (!key && (cookie = read(cookie)) !== undefined) {
|
||||
result[name] = cookie;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
config.defaults = {};
|
||||
|
||||
$.removeCookie = function (key, options) {
|
||||
if ($.cookie(key) === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Must not alter options, thus extending a fresh object...
|
||||
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
|
||||
return !$.cookie(key);
|
||||
};
|
||||
|
||||
}));
|
339
refstack/static/js/refstack.js
Normal file
339
refstack/static/js/refstack.js
Normal file
@ -0,0 +1,339 @@
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
// not use this file except in compliance with the License. You may obtain
|
||||
// a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
// License for the specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
/*global $:false */
|
||||
/*global Mustache:false */
|
||||
/*global window:false */
|
||||
/*jslint devel: true*/
|
||||
/* jshint -W097 */
|
||||
/*jslint node: true */
|
||||
|
||||
'use strict';
|
||||
|
||||
// Format time (numbers of seconds) in format xx h xx m xx s
|
||||
// with_sign flag forces to add sign to result
|
||||
var pretty_time_format = function (time_in, with_sign) {
|
||||
var time = Math.abs(time_in),
|
||||
hours = Math.floor(time / 3600),
|
||||
minutes = Math.floor((time - (hours * 3600)) / 60),
|
||||
seconds = time - (hours * 3600) - (minutes * 60),
|
||||
result;
|
||||
|
||||
if (hours < 10) {hours = '0' + hours; }
|
||||
if (minutes < 10) {minutes = '0' + minutes; }
|
||||
if (seconds < 10) {seconds = '0' + seconds; }
|
||||
result = minutes + 'm ' + seconds + 's';
|
||||
if (hours > 0) {
|
||||
return hours + 'h ' + result;
|
||||
}
|
||||
if (with_sign) {
|
||||
if (time_in >= 0) {
|
||||
result = '+ ' + result;
|
||||
} else {
|
||||
result = '- ' + result;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
// Used in templates for rendering custom bullets in capabilities support list
|
||||
var caps_support = function (text, render) {
|
||||
if (this.fully_supported) {
|
||||
return render('<span class="fa fa-check cap-passed" title="Fully supported"></span>');
|
||||
}
|
||||
if (this.partial_supported) {
|
||||
return render('<span class="fa fa-question-circle cap-part-passed" title="Partial supported"></span>');
|
||||
}
|
||||
return render('<span class="fa fa-times cap-failed" title="Unsupported"></span>');
|
||||
};
|
||||
|
||||
// Building data for rendering report for a single test run
|
||||
// Requires capabilities list. It can be build by "build_caps_list" function
|
||||
var build_report = function (caps_list, test_result) {
|
||||
var other_tests = test_result.results.slice(0),
|
||||
result = {
|
||||
'only_core': $.cookie('only_core_flag') === 'true',
|
||||
'all': $.cookie('admin_filter_flag') === 'all',
|
||||
'admin': $.cookie('admin_filter_flag') === 'admin',
|
||||
'noadmin': $.cookie('admin_filter_flag') === 'noadmin',
|
||||
'cpid': test_result.cpid,
|
||||
'duration_seconds': pretty_time_format(test_result.duration_seconds),
|
||||
'defcore_tests': {
|
||||
capabilities: caps_list.capabilities,
|
||||
list: test_result.results.filter(function (test) {
|
||||
return caps_list.global_test_list.indexOf(test) >= 0;
|
||||
}),
|
||||
passed_tests: test_result.results.filter(function (test) {
|
||||
return caps_list.scope_tests_list.indexOf(test) >= 0;
|
||||
}),
|
||||
failed_tests: caps_list.scope_tests_list.filter(function (test) {
|
||||
return test_result.results.indexOf(test) < 0;
|
||||
}),
|
||||
scope_tests_count: caps_list.scope_tests_count
|
||||
}
|
||||
};
|
||||
result.defcore_tests.count = result.defcore_tests.list.length;
|
||||
result.defcore_tests.capabilities = caps_list.capabilities.map(function (capability_class) {
|
||||
var ext_capability_class = {
|
||||
class: capability_class.class,
|
||||
count: capability_class.count,
|
||||
items : capability_class.items.map(function (capability) {
|
||||
return {
|
||||
class: capability.class,
|
||||
description: capability.description,
|
||||
id: capability.id,
|
||||
name: capability.name,
|
||||
tests: capability.tests,
|
||||
tests_count: capability.tests_count
|
||||
};
|
||||
})
|
||||
|
||||
};
|
||||
ext_capability_class.full_support_count = 0;
|
||||
ext_capability_class.partial_support_count = 0;
|
||||
ext_capability_class.items = ext_capability_class.items.map(function (capability) {
|
||||
capability.passed_tests = [];
|
||||
capability.failed_tests = [];
|
||||
capability.test_chart = [];
|
||||
capability.fully_supported = true;
|
||||
capability.partial_supported = false;
|
||||
capability.tests.forEach(function (test) {
|
||||
var passed = test_result.results.indexOf(test) >= 0,
|
||||
test_index = other_tests.indexOf(test);
|
||||
if (passed) {
|
||||
capability.partial_supported = true;
|
||||
capability.passed_tests.push(test);
|
||||
if (test_index >= 0) {
|
||||
other_tests.splice(test_index, 1);
|
||||
}
|
||||
} else {
|
||||
capability.fully_supported = false;
|
||||
capability.failed_tests.push(test);
|
||||
|
||||
}
|
||||
});
|
||||
capability.passed_count = capability.passed_tests.length;
|
||||
capability.failed_count = capability.failed_tests.length;
|
||||
if (capability.fully_supported) {
|
||||
capability.partial_supported = false;
|
||||
}
|
||||
capability.caps_support = function () {return caps_support; };
|
||||
if (capability.fully_supported) {
|
||||
ext_capability_class.full_support_count += 1;
|
||||
}
|
||||
if (capability.partial_supported) {
|
||||
ext_capability_class.partial_support_count += 1;
|
||||
}
|
||||
return capability;
|
||||
});
|
||||
ext_capability_class.items.sort(function (a, b) {
|
||||
var ai = 0,
|
||||
bi = 0;
|
||||
if (a.fully_supported) {ai = 0; } else if (a.partial_supported) {ai = 1; } else {ai = 2; }
|
||||
if (b.fully_supported) {bi = 0; } else if (b.partial_supported) {bi = 1; } else {bi = 2; }
|
||||
return ((ai > bi) ? -1 : ((ai < bi) ? 1 : 0));
|
||||
});
|
||||
ext_capability_class.full_unsupport_count = ext_capability_class.count - (ext_capability_class.partial_support_count + ext_capability_class.full_support_count);
|
||||
return ext_capability_class;
|
||||
});
|
||||
result.defcore_tests.total_passed_count = result.defcore_tests.passed_tests.length;
|
||||
result.defcore_tests.total_failed_count = result.defcore_tests.failed_tests.length;
|
||||
result.other_tests = {
|
||||
'list': other_tests,
|
||||
'count': other_tests.length
|
||||
};
|
||||
return result;
|
||||
};
|
||||
|
||||
// Building data for rendering report for comparison two test runs.
|
||||
// Requires capabilities list. It can be build by "build_caps_list" function
|
||||
var build_diff_report = function (caps_list, test_result, prev_test_result) {
|
||||
var diff_report = build_report(caps_list, test_result),
|
||||
other_tests = prev_test_result.results.slice(0);
|
||||
diff_report.current_run = test_result;
|
||||
diff_report.previous_run = prev_test_result;
|
||||
diff_report.time_diff = pretty_time_format(diff_report.current_run.duration_seconds - diff_report.previous_run.duration_seconds, true);
|
||||
diff_report.current_run.duration_seconds = pretty_time_format(diff_report.current_run.duration_seconds);
|
||||
diff_report.previous_run.duration_seconds = pretty_time_format(diff_report.previous_run.duration_seconds);
|
||||
diff_report.same_clouds = diff_report.current_run.cpid === diff_report.previous_run.cpid;
|
||||
diff_report.defcore_tests.fixed_tests = [];
|
||||
diff_report.defcore_tests.broken_tests = [];
|
||||
diff_report.defcore_tests.capabilities = diff_report.defcore_tests.capabilities.map(function (capability_class) {
|
||||
capability_class.items = capability_class.items.map(function (capability) {
|
||||
capability.fixed_tests = [];
|
||||
capability.broken_tests = [];
|
||||
capability.tests.forEach(function (test) {
|
||||
var passed = prev_test_result.results.indexOf(test) >= 0,
|
||||
test_index = other_tests.indexOf(test),
|
||||
failed_index = 0,
|
||||
passed_index = 0;
|
||||
if (passed) {
|
||||
if (capability.passed_tests.indexOf(test) < 0) {
|
||||
capability.broken_tests.push(test);
|
||||
if (diff_report.defcore_tests.broken_tests.indexOf(test) < 0) {
|
||||
diff_report.defcore_tests.broken_tests.push(test);
|
||||
}
|
||||
failed_index = capability.failed_tests.indexOf(test);
|
||||
if (failed_index < 0) {
|
||||
alert('Comparison is incorrect!');
|
||||
throw new Error('Comparison is incorrect!');
|
||||
}
|
||||
capability.failed_tests.splice(failed_index, 1);
|
||||
}
|
||||
if (test_index >= 0) {
|
||||
other_tests.splice(test_index, 1);
|
||||
}
|
||||
} else {
|
||||
if (capability.failed_tests.indexOf(test) < 0) {
|
||||
capability.fixed_tests.push(test);
|
||||
if (diff_report.defcore_tests.fixed_tests.indexOf(test) < 0) {
|
||||
diff_report.defcore_tests.fixed_tests.push(test);
|
||||
}
|
||||
passed_index = capability.passed_tests.indexOf(test);
|
||||
if (passed_index < 0) {
|
||||
alert('Comparison is incorrect!');
|
||||
throw new Error('Comparison is incorrect!');
|
||||
}
|
||||
capability.passed_tests.splice(passed_index, 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
capability.broken_count = capability.broken_tests.length;
|
||||
capability.fixed_count = capability.fixed_tests.length;
|
||||
return capability;
|
||||
});
|
||||
return capability_class;
|
||||
});
|
||||
diff_report.defcore_tests.passed_tests = diff_report.defcore_tests.passed_tests.filter(function (test) {
|
||||
return diff_report.defcore_tests.fixed_tests.indexOf(test) < 0;
|
||||
});
|
||||
diff_report.defcore_tests.failed_tests = diff_report.defcore_tests.failed_tests.filter(function (test) {
|
||||
return diff_report.defcore_tests.broken_tests.indexOf(test) < 0;
|
||||
});
|
||||
diff_report.defcore_tests.total_failed_count = diff_report.defcore_tests.failed_tests.length;
|
||||
diff_report.defcore_tests.total_passed_count = diff_report.defcore_tests.passed_tests.length;
|
||||
diff_report.defcore_tests.total_fixed_count = diff_report.defcore_tests.fixed_tests.length;
|
||||
diff_report.defcore_tests.total_broken_count = diff_report.defcore_tests.broken_tests.length;
|
||||
return diff_report;
|
||||
};
|
||||
|
||||
// Updating admin filter value and render page
|
||||
var admin_filter_update = function (item) {
|
||||
$.cookie('admin_filter_flag', item.name);
|
||||
window.render_page();
|
||||
};
|
||||
|
||||
// Updating core filter value and render page
|
||||
var core_filter_update = function (item) {
|
||||
$.cookie('only_core_flag', item.name === 'true');
|
||||
window.render_page();
|
||||
};
|
||||
|
||||
// Get filter values (admin and core)
|
||||
var get_filters_cookie = function () {
|
||||
if ($('input#only_core').length === 0) {
|
||||
if (!$.cookie('only_core_flag')) {$.cookie('only_core_flag', 'true'); }
|
||||
}
|
||||
if ($('div#admin_filter').length === 0) {
|
||||
if (!$.cookie('admin_filter_flag')) {$.cookie('admin_filter_flag', 'all'); }
|
||||
}
|
||||
return {only_core: $.cookie('only_core_flag') === 'true', admin_filter: $.cookie('admin_filter_flag')};
|
||||
};
|
||||
|
||||
// Init page spinner
|
||||
var loading_spin = function () {
|
||||
var opts = { lines: 17, length: 40, width: 11, radius: 32, corners: 1,
|
||||
rotate: 0, direction: 1, color: '#000', speed: 1, trail: 33,
|
||||
shadow: false, hwaccel: false, className: 'spinner', zIndex: 2e9,
|
||||
top: '50%', left: '50%' },
|
||||
target = document.getElementById('test_results');
|
||||
new Spinner(opts).spin(target);
|
||||
};
|
||||
|
||||
// Page post processing for jquery stuff
|
||||
var post_processing = function post_processing() {
|
||||
$('div.cap_shot:odd').addClass('zebra_odd');
|
||||
$('div.cap_shot:even').addClass('zebra_even');
|
||||
$('div#core_filter').buttonset();
|
||||
$('div#admin_filter').buttonset();
|
||||
$('#schema_selector').selectmenu({change: function () {window.render_page(); } });
|
||||
|
||||
};
|
||||
|
||||
// Render page for report from single test run
|
||||
var render_defcore_report_page = function () {
|
||||
var filters = get_filters_cookie(),
|
||||
schema = '',
|
||||
schema_selector = $('select#schema_selector');
|
||||
|
||||
if (window.result_source === '{{result_source}}') {
|
||||
window.result_source = 'sample_test_result.json';
|
||||
}
|
||||
if (schema_selector.length === 0) {
|
||||
schema = 'havanacore.json';
|
||||
} else {
|
||||
schema = schema_selector[0].value;
|
||||
}
|
||||
console.log(schema);
|
||||
$.when(
|
||||
$.get('mustache/report_base.mst', undefined, undefined, 'html'),
|
||||
$.get('mustache/single_header.mst', undefined, undefined, 'html'),
|
||||
$.get('mustache/single_capabilities_details.mst', undefined, undefined, 'html'),
|
||||
$.get('capabilities/' + schema, undefined, undefined, 'json'),
|
||||
$.get(window.result_source, undefined, undefined, 'json')
|
||||
).done(function (base_template, header_template, caps_template, schema, test_result) {
|
||||
var caps_list = window.build_caps_list(schema[0], filters),
|
||||
report = build_report(caps_list, test_result[0]);
|
||||
$("div#test_results").html(Mustache.render(base_template[0], report, {
|
||||
header: header_template[0],
|
||||
caps_details: caps_template[0]
|
||||
}));
|
||||
post_processing();
|
||||
});
|
||||
};
|
||||
|
||||
// Render page for report for comparison two test run
|
||||
var render_defcore_diff_report_page = function () {
|
||||
var filters = get_filters_cookie(),
|
||||
schema = '',
|
||||
schema_selector = $('select#schema_selector');
|
||||
|
||||
if (window.result_source === '{{result_source}}') {
|
||||
window.result_source = 'sample_test_result.json';
|
||||
}
|
||||
if (window.prev_result_source === '{{prev_result_source}}') {
|
||||
window.prev_result_source = 'other_test_result.json';
|
||||
}
|
||||
if (schema_selector.length === 0) {
|
||||
schema = 'havanacore.json';
|
||||
} else {
|
||||
schema = schema_selector[0].value;
|
||||
}
|
||||
$.when(
|
||||
$.get('mustache/report_base.mst', undefined, undefined, 'html'),
|
||||
$.get('mustache/diff_header.mst', undefined, undefined, 'html'),
|
||||
$.get('mustache/diff_capabilities_details.mst', undefined, undefined, 'html'),
|
||||
$.get('capabilities/' + schema, undefined, undefined, 'json'),
|
||||
$.get(window.result_source, undefined, undefined, 'json'),
|
||||
$.get(window.prev_result_source, undefined, undefined, 'json')
|
||||
).done(function (base_template, header_template, caps_template, schema,
|
||||
test_result, prev_result) {
|
||||
var caps_list = window.build_caps_list(schema[0], filters),
|
||||
diff_report = build_diff_report(caps_list, test_result[0], prev_result[0]);
|
||||
$("div#test_results").html(Mustache.render(base_template[0], diff_report, {
|
||||
header: header_template[0],
|
||||
caps_details: caps_template[0]
|
||||
}));
|
||||
post_processing();
|
||||
});
|
||||
};
|
349
refstack/static/js/spin.js
Normal file
349
refstack/static/js/spin.js
Normal file
@ -0,0 +1,349 @@
|
||||
/**
|
||||
* Copyright (c) 2011-2014 Felix Gnass
|
||||
* Licensed under the MIT license
|
||||
*/
|
||||
(function(root, factory) {
|
||||
|
||||
/* CommonJS */
|
||||
if (typeof exports == 'object') module.exports = factory()
|
||||
|
||||
/* AMD module */
|
||||
else if (typeof define == 'function' && define.amd) define(factory)
|
||||
|
||||
/* Browser global */
|
||||
else root.Spinner = factory()
|
||||
}
|
||||
(this, function() {
|
||||
"use strict";
|
||||
|
||||
var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */
|
||||
, animations = {} /* Animation rules keyed by their name */
|
||||
, useCssAnimations /* Whether to use CSS animations or setTimeout */
|
||||
|
||||
/**
|
||||
* Utility function to create elements. If no tag name is given,
|
||||
* a DIV is created. Optionally properties can be passed.
|
||||
*/
|
||||
function createEl(tag, prop) {
|
||||
var el = document.createElement(tag || 'div')
|
||||
, n
|
||||
|
||||
for(n in prop) el[n] = prop[n]
|
||||
return el
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends children and returns the parent.
|
||||
*/
|
||||
function ins(parent /* child1, child2, ...*/) {
|
||||
for (var i=1, n=arguments.length; i<n; i++)
|
||||
parent.appendChild(arguments[i])
|
||||
|
||||
return parent
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert a new stylesheet to hold the @keyframe or VML rules.
|
||||
*/
|
||||
var sheet = (function() {
|
||||
var el = createEl('style', {type : 'text/css'})
|
||||
ins(document.getElementsByTagName('head')[0], el)
|
||||
return el.sheet || el.styleSheet
|
||||
}())
|
||||
|
||||
/**
|
||||
* Creates an opacity keyframe animation rule and returns its name.
|
||||
* Since most mobile Webkits have timing issues with animation-delay,
|
||||
* we create separate rules for each line/segment.
|
||||
*/
|
||||
function addAnimation(alpha, trail, i, lines) {
|
||||
var name = ['opacity', trail, ~~(alpha*100), i, lines].join('-')
|
||||
, start = 0.01 + i/lines * 100
|
||||
, z = Math.max(1 - (1-alpha) / trail * (100-start), alpha)
|
||||
, prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase()
|
||||
, pre = prefix && '-' + prefix + '-' || ''
|
||||
|
||||
if (!animations[name]) {
|
||||
sheet.insertRule(
|
||||
'@' + pre + 'keyframes ' + name + '{' +
|
||||
'0%{opacity:' + z + '}' +
|
||||
start + '%{opacity:' + alpha + '}' +
|
||||
(start+0.01) + '%{opacity:1}' +
|
||||
(start+trail) % 100 + '%{opacity:' + alpha + '}' +
|
||||
'100%{opacity:' + z + '}' +
|
||||
'}', sheet.cssRules.length)
|
||||
|
||||
animations[name] = 1
|
||||
}
|
||||
|
||||
return name
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries various vendor prefixes and returns the first supported property.
|
||||
*/
|
||||
function vendor(el, prop) {
|
||||
var s = el.style
|
||||
, pp
|
||||
, i
|
||||
|
||||
prop = prop.charAt(0).toUpperCase() + prop.slice(1)
|
||||
for(i=0; i<prefixes.length; i++) {
|
||||
pp = prefixes[i]+prop
|
||||
if(s[pp] !== undefined) return pp
|
||||
}
|
||||
if(s[prop] !== undefined) return prop
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets multiple style properties at once.
|
||||
*/
|
||||
function css(el, prop) {
|
||||
for (var n in prop)
|
||||
el.style[vendor(el, n)||n] = prop[n]
|
||||
|
||||
return el
|
||||
}
|
||||
|
||||
/**
|
||||
* Fills in default values.
|
||||
*/
|
||||
function merge(obj) {
|
||||
for (var i=1; i < arguments.length; i++) {
|
||||
var def = arguments[i]
|
||||
for (var n in def)
|
||||
if (obj[n] === undefined) obj[n] = def[n]
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the absolute page-offset of the given element.
|
||||
*/
|
||||
function pos(el) {
|
||||
var o = { x:el.offsetLeft, y:el.offsetTop }
|
||||
while((el = el.offsetParent))
|
||||
o.x+=el.offsetLeft, o.y+=el.offsetTop
|
||||
|
||||
return o
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the line color from the given string or array.
|
||||
*/
|
||||
function getColor(color, idx) {
|
||||
return typeof color == 'string' ? color : color[idx % color.length]
|
||||
}
|
||||
|
||||
// Built-in defaults
|
||||
|
||||
var defaults = {
|
||||
lines: 12, // The number of lines to draw
|
||||
length: 7, // The length of each line
|
||||
width: 5, // The line thickness
|
||||
radius: 10, // The radius of the inner circle
|
||||
rotate: 0, // Rotation offset
|
||||
corners: 1, // Roundness (0..1)
|
||||
color: '#000', // #rgb or #rrggbb
|
||||
direction: 1, // 1: clockwise, -1: counterclockwise
|
||||
speed: 1, // Rounds per second
|
||||
trail: 100, // Afterglow percentage
|
||||
opacity: 1/4, // Opacity of the lines
|
||||
fps: 20, // Frames per second when using setTimeout()
|
||||
zIndex: 2e9, // Use a high z-index by default
|
||||
className: 'spinner', // CSS class to assign to the element
|
||||
top: '50%', // center vertically
|
||||
left: '50%', // center horizontally
|
||||
position: 'absolute' // element position
|
||||
}
|
||||
|
||||
/** The constructor */
|
||||
function Spinner(o) {
|
||||
this.opts = merge(o || {}, Spinner.defaults, defaults)
|
||||
}
|
||||
|
||||
// Global defaults that override the built-ins:
|
||||
Spinner.defaults = {}
|
||||
|
||||
merge(Spinner.prototype, {
|
||||
|
||||
/**
|
||||
* Adds the spinner to the given target element. If this instance is already
|
||||
* spinning, it is automatically removed from its previous target b calling
|
||||
* stop() internally.
|
||||
*/
|
||||
spin: function(target) {
|
||||
this.stop()
|
||||
|
||||
var self = this
|
||||
, o = self.opts
|
||||
, el = self.el = css(createEl(0, {className: o.className}), {position: o.position, width: 0, zIndex: o.zIndex})
|
||||
, mid = o.radius+o.length+o.width
|
||||
|
||||
css(el, {
|
||||
left: o.left,
|
||||
top: o.top
|
||||
})
|
||||
|
||||
if (target) {
|
||||
target.insertBefore(el, target.firstChild||null)
|
||||
}
|
||||
|
||||
el.setAttribute('role', 'progressbar')
|
||||
self.lines(el, self.opts)
|
||||
|
||||
if (!useCssAnimations) {
|
||||
// No CSS animation support, use setTimeout() instead
|
||||
var i = 0
|
||||
, start = (o.lines - 1) * (1 - o.direction) / 2
|
||||
, alpha
|
||||
, fps = o.fps
|
||||
, f = fps/o.speed
|
||||
, ostep = (1-o.opacity) / (f*o.trail / 100)
|
||||
, astep = f/o.lines
|
||||
|
||||
;(function anim() {
|
||||
i++;
|
||||
for (var j = 0; j < o.lines; j++) {
|
||||
alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity)
|
||||
|
||||
self.opacity(el, j * o.direction + start, alpha, o)
|
||||
}
|
||||
self.timeout = self.el && setTimeout(anim, ~~(1000/fps))
|
||||
})()
|
||||
}
|
||||
return self
|
||||
},
|
||||
|
||||
/**
|
||||
* Stops and removes the Spinner.
|
||||
*/
|
||||
stop: function() {
|
||||
var el = this.el
|
||||
if (el) {
|
||||
clearTimeout(this.timeout)
|
||||
if (el.parentNode) el.parentNode.removeChild(el)
|
||||
this.el = undefined
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
/**
|
||||
* Internal method that draws the individual lines. Will be overwritten
|
||||
* in VML fallback mode below.
|
||||
*/
|
||||
lines: function(el, o) {
|
||||
var i = 0
|
||||
, start = (o.lines - 1) * (1 - o.direction) / 2
|
||||
, seg
|
||||
|
||||
function fill(color, shadow) {
|
||||
return css(createEl(), {
|
||||
position: 'absolute',
|
||||
width: (o.length+o.width) + 'px',
|
||||
height: o.width + 'px',
|
||||
background: color,
|
||||
boxShadow: shadow,
|
||||
transformOrigin: 'left',
|
||||
transform: 'rotate(' + ~~(360/o.lines*i+o.rotate) + 'deg) translate(' + o.radius+'px' +',0)',
|
||||
borderRadius: (o.corners * o.width>>1) + 'px'
|
||||
})
|
||||
}
|
||||
|
||||
for (; i < o.lines; i++) {
|
||||
seg = css(createEl(), {
|
||||
position: 'absolute',
|
||||
top: 1+~(o.width/2) + 'px',
|
||||
transform: o.hwaccel ? 'translate3d(0,0,0)' : '',
|
||||
opacity: o.opacity,
|
||||
animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1/o.speed + 's linear infinite'
|
||||
})
|
||||
|
||||
if (o.shadow) ins(seg, css(fill('#000', '0 0 4px ' + '#000'), {top: 2+'px'}))
|
||||
ins(el, ins(seg, fill(getColor(o.color, i), '0 0 1px rgba(0,0,0,.1)')))
|
||||
}
|
||||
return el
|
||||
},
|
||||
|
||||
/**
|
||||
* Internal method that adjusts the opacity of a single line.
|
||||
* Will be overwritten in VML fallback mode below.
|
||||
*/
|
||||
opacity: function(el, i, val) {
|
||||
if (i < el.childNodes.length) el.childNodes[i].style.opacity = val
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
function initVML() {
|
||||
|
||||
/* Utility function to create a VML tag */
|
||||
function vml(tag, attr) {
|
||||
return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr)
|
||||
}
|
||||
|
||||
// No CSS transforms but VML support, add a CSS rule for VML elements:
|
||||
sheet.addRule('.spin-vml', 'behavior:url(#default#VML)')
|
||||
|
||||
Spinner.prototype.lines = function(el, o) {
|
||||
var r = o.length+o.width
|
||||
, s = 2*r
|
||||
|
||||
function grp() {
|
||||
return css(
|
||||
vml('group', {
|
||||
coordsize: s + ' ' + s,
|
||||
coordorigin: -r + ' ' + -r
|
||||
}),
|
||||
{ width: s, height: s }
|
||||
)
|
||||
}
|
||||
|
||||
var margin = -(o.width+o.length)*2 + 'px'
|
||||
, g = css(grp(), {position: 'absolute', top: margin, left: margin})
|
||||
, i
|
||||
|
||||
function seg(i, dx, filter) {
|
||||
ins(g,
|
||||
ins(css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx}),
|
||||
ins(css(vml('roundrect', {arcsize: o.corners}), {
|
||||
width: r,
|
||||
height: o.width,
|
||||
left: o.radius,
|
||||
top: -o.width>>1,
|
||||
filter: filter
|
||||
}),
|
||||
vml('fill', {color: getColor(o.color, i), opacity: o.opacity}),
|
||||
vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
if (o.shadow)
|
||||
for (i = 1; i <= o.lines; i++)
|
||||
seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)')
|
||||
|
||||
for (i = 1; i <= o.lines; i++) seg(i)
|
||||
return ins(el, g)
|
||||
}
|
||||
|
||||
Spinner.prototype.opacity = function(el, i, val, o) {
|
||||
var c = el.firstChild
|
||||
o = o.shadow && o.lines || 0
|
||||
if (c && i+o < c.childNodes.length) {
|
||||
c = c.childNodes[i+o]; c = c && c.firstChild; c = c && c.firstChild
|
||||
if (c) c.opacity = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var probe = css(createEl('group'), {behavior: 'url(#default#VML)'})
|
||||
|
||||
if (!vendor(probe, 'transform') && probe.adj) initVML()
|
||||
else useCssAnimations = vendor(probe, 'animation')
|
||||
|
||||
return Spinner
|
||||
|
||||
}));
|
60
refstack/static/mustache/diff_capabilities_details.mst
Normal file
60
refstack/static/mustache/diff_capabilities_details.mst
Normal file
@ -0,0 +1,60 @@
|
||||
{{#items}}
|
||||
<div class="cap_item">
|
||||
<div class="cap_shot">
|
||||
<div style="width: 2em; display: table-cell;"> {{#caps_support}}{{/caps_support}} </div>
|
||||
<div style="width: 30em; display: table-cell;">
|
||||
<a onclick="toggle_one_item('{{class}}', '{{id}}', 'detailed_results'); return false; " title="Description: {{description}}" href="#" > {{name}} </a>
|
||||
</div>
|
||||
<div style="width: 3em; display: table-cell; ">
|
||||
<span class="passed">{{passed_count}}</span>
|
||||
</div>
|
||||
<div style="width: 3em; display: table-cell; ">
|
||||
<span class="passed">{{#fixed_count}}+{{fixed_count}}{{/fixed_count}}</span>
|
||||
</div>
|
||||
<div style="width: 3em; display: table-cell; ">
|
||||
<span class="failed">{{#broken_count}}-{{broken_count}}{{/broken_count}}</span>
|
||||
</div>
|
||||
<div style="width: 3em; display: table-cell; ">
|
||||
<span class="failed">{{failed_count}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{id}}_detailed_results" class="{{class}}_detailed_results" style="display:none;">
|
||||
<ul class="fa-ul test_results">
|
||||
{{#broken_tests}}
|
||||
<li class="fa fa-exclamation-circle failed">
|
||||
<span>
|
||||
{{.}} <a href="javascript:void(window.get_code_url('{{.}}'));"> [github] </a>
|
||||
</span>
|
||||
</li>
|
||||
{{/broken_tests}}
|
||||
</ul>
|
||||
<ul class="fa-ul test_results">
|
||||
{{#fixed_tests}}
|
||||
<li class="fa fa-wrench passed">
|
||||
<span>
|
||||
{{.}} <a href="javascript:void(window.get_code_url('{{.}}'));"> [github] </a>
|
||||
</span>
|
||||
</li>
|
||||
{{/fixed_tests}}
|
||||
</ul>
|
||||
<ul class="fa-ul test_results">
|
||||
{{#failed_tests}}
|
||||
<li class="fa fa-times failed">
|
||||
<span>
|
||||
{{.}} <a href="javascript:void(window.get_code_url('{{.}}'));"> [github] </a>
|
||||
</span>
|
||||
</li>
|
||||
{{/failed_tests}}
|
||||
</ul>
|
||||
<ul class="fa-ul test_results">
|
||||
{{#passed_tests}}
|
||||
<li class="fa fa-check passed">
|
||||
<span>
|
||||
{{.}} <a href="javascript:void(window.get_code_url('{{.}}'));"> [github] </a>
|
||||
</span>
|
||||
</li>
|
||||
{{/passed_tests}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{/items}}
|
23
refstack/static/mustache/diff_header.mst
Normal file
23
refstack/static/mustache/diff_header.mst
Normal file
@ -0,0 +1,23 @@
|
||||
<div style="display: table">
|
||||
<div style="display: table-row">
|
||||
<div style="width: 10em; display: table-cell"></div>
|
||||
<div style="width: 25em; display: table-cell; text-align: center">Current test run</div>
|
||||
<div style="width: 25em; display: table-cell; text-align: center">Previous test run</div>
|
||||
</div>
|
||||
<div style="display: table-row">
|
||||
<div style="width: 10em; display: table-cell">Cloud ID</div>
|
||||
<div style="width: 25em; display: table-cell; text-align: center">{{current_run.cpid}}</div>
|
||||
<div style="width: 25em; display: table-cell; text-align: center">
|
||||
{{#same_clouds}}The same cloud{{/same_clouds}}
|
||||
{{^same_clouds}}{{previous_run.cpid}}{{/same_clouds}}
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: table-row">
|
||||
<div style="width: 10em; display: table-cell">Test execution time</div>
|
||||
<div style="width: 25em; display: table-cell; text-align: center">{{current_run.duration_seconds}} ( {{time_diff}} )</div>
|
||||
<div style="width: 25em; display: table-cell; text-align: center">{{previous_run.duration_seconds}}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<p></p>
|
167
refstack/static/mustache/report_base.mst
Normal file
167
refstack/static/mustache/report_base.mst
Normal file
@ -0,0 +1,167 @@
|
||||
{{>header}}
|
||||
<h3> DefCore test results </h3>
|
||||
{{#defcore_tests}}
|
||||
<div>
|
||||
Total passed DefCore tests: {{defcore_tests.count}} <a onclick="$('#defcore_tests_list').slideToggle(500);return false;" href="#"> [plain list] </a>
|
||||
</div>
|
||||
<ul id=defcore_tests_list style="display:none;" class="fa-ul test_results">
|
||||
{{#list}}
|
||||
<li class="fa fa-check passed"> <span class="passed"> {{.}} </span> </li>
|
||||
{{/list}}
|
||||
{{^list}}
|
||||
No DefCore tests passed!
|
||||
{{/list}}
|
||||
</ul>
|
||||
<p></p>
|
||||
<div>
|
||||
<h3>Scope filter</h3>
|
||||
|
||||
<div id="core_filter">
|
||||
<input type="radio" id="core_filter_off" name="false" {{^only_core}}checked="checked"{{/only_core}} onchange="core_filter_update(this)">
|
||||
<label for="core_filter_off">Don't apply core filter</label>
|
||||
<input type="radio" id="core_filter_on" name="true" {{#only_core}}checked="checked"{{/only_core}} onchange="core_filter_update(this)">
|
||||
<label for="core_filter_on">Show only core tests</label>
|
||||
</div>
|
||||
<br>
|
||||
<div id="admin_filter" >
|
||||
<input type="radio" id="admin_filter_opt1" name="all" {{#all}}checked="checked"{{/all}} onchange="admin_filter_update(this)" >
|
||||
<label for="admin_filter_opt1">Don't apply admin filter</label>
|
||||
<input type="radio" id="admin_filter_opt2" name="admin" {{#admin}}checked="checked"{{/admin}} onchange="admin_filter_update(this)">
|
||||
<label for="admin_filter_opt2">Tests requiring admin rights</label>
|
||||
<input type="radio" id="admin_filter_opt3" name="noadmin" {{#noadmin}}checked="checked"{{/noadmin}} onchange="admin_filter_update(this)">
|
||||
<label for="admin_filter_opt3">Tests not requiring admin rights</label>
|
||||
</div>
|
||||
</div>
|
||||
<p></p>
|
||||
<div id="{{class}}_brief" class="overall_summary_table">
|
||||
<div style="display: table-row">
|
||||
<div>
|
||||
<div class="overall_summary_col_1"> <span class="fa fa-info-circle"></span> </div>
|
||||
<div class="overall_summary_col_2"> Total tests in scope </div>
|
||||
<div class="overall_summary_col_3"> {{scope_tests_count}} </div>
|
||||
</div>
|
||||
</div>
|
||||
{{#total_fixed_count}}
|
||||
<div style="display: table-row">
|
||||
<div>
|
||||
<div class="overall_summary_col_1"> <span class="fa fa-wrench cap-passed"></span> </div>
|
||||
<div class="overall_summary_col_2"> <a onclick="toggle_one_item('all','fixed', 'scope_test_list') ;return false;" href="#"> Fixed tests in scope compared to previous run </a> </div>
|
||||
<div class="overall_summary_col_3"> {{total_fixed_count}} </div>
|
||||
</div>
|
||||
<div id="fixed_scope_test_list" style="display: none;" class="all_scope_test_list">
|
||||
<ul class="fa-ul test_results">
|
||||
{{#fixed_tests}}
|
||||
<li class="fa fa-wrench passed">
|
||||
<span class="passed">
|
||||
{{.}} <a href="javascript:void(window.get_code_url('{{.}}'));"> [github] </a>
|
||||
</span>
|
||||
</li>
|
||||
{{/fixed_tests}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{/total_fixed_count}}
|
||||
{{#total_broken_count}}
|
||||
<div style="display: table-row">
|
||||
<div>
|
||||
<div class="overall_summary_col_1"> <span class="fa fa-exclamation-circle cap-failed"></span> </div>
|
||||
<div class="overall_summary_col_2"> <a onclick="toggle_one_item('all','broken', 'scope_test_list') ;return false;" href="#"> Broken tests in scope compared to previous run </a> </div>
|
||||
<div class="overall_summary_col_3"> {{total_broken_count}} </div>
|
||||
</div>
|
||||
<div id="broken_scope_test_list" style="display: none;" class="all_scope_test_list">
|
||||
<ul class="fa-ul test_results">
|
||||
{{#broken_tests}}
|
||||
<li class="fa fa-exclamation-circle failed">
|
||||
<span class="failed">
|
||||
{{.}} <a href="javascript:void(window.get_code_url('{{.}}'));"> [github] </a>
|
||||
</span>
|
||||
</li>
|
||||
{{/broken_tests}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{/total_broken_count}}
|
||||
<div style="display: table-row">
|
||||
<div>
|
||||
<div class="overall_summary_col_1"> <span class="fa fa-check cap-passed"></span> </div>
|
||||
<div class="overall_summary_col_2"> <a onclick="toggle_one_item('all','passed', 'scope_test_list') ;return false;" href="#"> Passed tests in scope </a> </div>
|
||||
<div class="overall_summary_col_3"> {{total_passed_count}} </div>
|
||||
</div>
|
||||
<div id="passed_scope_test_list" style="display: none;" class="all_scope_test_list">
|
||||
<ul class="fa-ul test_results">
|
||||
{{#passed_tests}}
|
||||
<li class="fa fa-check passed">
|
||||
<span class="passed">
|
||||
{{.}} <a href="javascript:void(window.get_code_url('{{.}}'));"> [github] </a>
|
||||
</span>
|
||||
</li>
|
||||
{{/passed_tests}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: table-row">
|
||||
<div>
|
||||
<div class="overall_summary_col_1"> <span class="fa fa-times cap-failed"></span> </div>
|
||||
<div class="overall_summary_col_2"> <a onclick="toggle_one_item('all','failed', 'scope_test_list') ;return false;" href="#"> Not passed tests in scope </a> </div>
|
||||
<div class="overall_summary_col_3"> {{total_failed_count}} </div>
|
||||
</div>
|
||||
<div id="failed_scope_test_list" style="display: none;" class="all_scope_test_list">
|
||||
<ul class="fa-ul test_results">
|
||||
{{#failed_tests}}
|
||||
<li class="fa fa-times failed">
|
||||
<span class="failed">
|
||||
{{.}} <a href="javascript:void(window.get_code_url('{{.}}'));"> [github]
|
||||
</a> </span>
|
||||
</li>
|
||||
{{/failed_tests}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p></p>
|
||||
<h3>Capabilities status</h3>
|
||||
<ul>
|
||||
{{#capabilities}}
|
||||
<li>
|
||||
<a onclick="toggle_one_item('all', '{{class}}', 'detailed_caps'); return false;" href="#">
|
||||
{{class}} capabilities ({{count}})
|
||||
</a>
|
||||
<div id="{{class}}_brief" class="caps_summary_table">
|
||||
<div style="display: table-col">
|
||||
<div class="caps_summary_col_1"> <span class="fa fa-check cap-passed"></span> </div>
|
||||
<div class="caps_summary_col_2"> Fully supported capabilities: </div>
|
||||
<div class="caps_summary_col_3"> {{full_support_count}} </div>
|
||||
</div>
|
||||
<div style="display: table-col">
|
||||
<div class="caps_summary_col_1"> <span class="fa fa-question-circle cap-part-passed"></span> </div>
|
||||
<div class="caps_summary_col_2"> Partially supported capabilities: </div>
|
||||
<div class="caps_summary_col_3"> {{partial_support_count}} </div>
|
||||
</div>
|
||||
<div style="display: table-col">
|
||||
<div class="caps_summary_col_1"> <span class="fa fa-times cap-failed"></span> </div>
|
||||
<div class="caps_summary_col_2"> Unsupported capabilities: </div>
|
||||
<div class="caps_summary_col_3"> {{full_unsupport_count}} </div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{class}}_detailed_caps" style="position: relative; left: 1em; display:none;" class="all_detailed_caps">
|
||||
{{>caps_details}}
|
||||
</div>
|
||||
</li>
|
||||
{{/capabilities}}
|
||||
</ul>
|
||||
{{^capabilities}}
|
||||
<div> No capabilities!</div>
|
||||
{{/capabilities}}
|
||||
{{/defcore_tests}}
|
||||
{{#other_tests}}
|
||||
<h3> Passed tests out of scope </h3>
|
||||
Total passed tests out of scope: {{count}} <a onclick="$('#other_tests_list').slideToggle();return false;" href="#"> [plain list] </a>
|
||||
<ul id=other_tests_list style="display:none;" class="fa-ul test_results">
|
||||
{{#list}}
|
||||
<li class="fa fa-check passed"> <span class="passed"> {{.}} </span> </li>
|
||||
{{/list}}
|
||||
{{^list}}
|
||||
No other tests!
|
||||
{{/list}}
|
||||
</ul>
|
||||
{{/other_tests}}
|
36
refstack/static/mustache/single_capabilities_details.mst
Normal file
36
refstack/static/mustache/single_capabilities_details.mst
Normal file
@ -0,0 +1,36 @@
|
||||
{{#items}}
|
||||
<div class="cap_item">
|
||||
<div class="cap_shot">
|
||||
<div style="width: 2em; display: table-cell;"> {{#caps_support}}{{/caps_support}} </div>
|
||||
<div style="width: 30em; display: table-cell;">
|
||||
<a onclick="toggle_one_item('{{class}}', '{{id}}', 'detailed_results'); return false; " title="Description: {{description}}" href="#" > {{name}} </a>
|
||||
</div>
|
||||
<div style="width: 3em; display: table-cell; ">
|
||||
<span class="passed">{{passed_count}}</span>
|
||||
</div>
|
||||
<div style="width: 3em; display: table-cell; ">
|
||||
<span class="failed">{{failed_count}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{id}}_detailed_results" class="{{class}}_detailed_results" style="display:none;">
|
||||
<ul class="fa-ul test_results">
|
||||
{{#failed_tests}}
|
||||
<li class="fa fa-times failed">
|
||||
<span>
|
||||
{{.}} <a href="javascript:void(window.get_code_url('{{.}}'));"> [github] </a>
|
||||
</span>
|
||||
</li>
|
||||
{{/failed_tests}}
|
||||
</ul>
|
||||
<ul class="fa-ul test_results">
|
||||
{{#passed_tests}}
|
||||
<li class="fa fa-check passed">
|
||||
<span>
|
||||
{{.}} <a href="javascript:void(window.get_code_url('{{.}}'));"> [github] </a>
|
||||
</span>
|
||||
</li>
|
||||
{{/passed_tests}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{/items}}
|
10
refstack/static/mustache/single_header.mst
Normal file
10
refstack/static/mustache/single_header.mst
Normal file
@ -0,0 +1,10 @@
|
||||
<div style="display: table">
|
||||
<div style="display: table-row">
|
||||
<div style="width: 10em; display: table-cell">Cloud ID</div>
|
||||
<div style="width: 25em; display: table-cell; text-align: center">{{cpid}}</div>
|
||||
</div>
|
||||
<div style="display: table-row">
|
||||
<div style="width: 10em; display: table-cell">Test execution time</div>
|
||||
<div style="width: 25em; display: table-cell; text-align: center">{{duration_seconds}}</div>
|
||||
</div>
|
||||
</div>
|
1756
refstack/static/other_test_result.json
Normal file
1756
refstack/static/other_test_result.json
Normal file
File diff suppressed because it is too large
Load Diff
1
refstack/static/output.html
Symbolic link
1
refstack/static/output.html
Symbolic link
@ -0,0 +1 @@
|
||||
../templates/output.html
|
1
refstack/static/output_demo.html
Symbolic link
1
refstack/static/output_demo.html
Symbolic link
@ -0,0 +1 @@
|
||||
output.html
|
@ -6,7 +6,6 @@ body {
|
||||
}
|
||||
|
||||
.container{
|
||||
width: !important;
|
||||
}
|
||||
|
||||
.grid{
|
||||
@ -183,7 +182,6 @@ input[name="openid"] {
|
||||
|
||||
.report_data_table{
|
||||
border: 1px solid rgb(200, 200, 200);
|
||||
border-collapse: initial;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
@ -206,4 +204,4 @@ input[name="openid"] {
|
||||
|
||||
.blue{
|
||||
color: blue;
|
||||
}
|
||||
}
|
140
refstack/static/report_page.css
Normal file
140
refstack/static/report_page.css
Normal file
@ -0,0 +1,140 @@
|
||||
.cap-passed {
|
||||
color: green;
|
||||
list-style-type: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.cap-part-passed {
|
||||
color: gold;
|
||||
list-style-type: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.cap-failed {
|
||||
color: red;
|
||||
list-style-type: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
ul.test_results li.passed {
|
||||
color: green;
|
||||
list-style-type: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
ul.test_results li.failed {
|
||||
color: red;
|
||||
list-style-type: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
ul.test_results li span {
|
||||
color: black;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
span.passed {
|
||||
color: green;
|
||||
display: inline;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
span.failed {
|
||||
color: red;
|
||||
display: inline;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
div.caps_names_list{
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
div.caps_summary{
|
||||
display: inline;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
span.caps_summary{
|
||||
display: inline;
|
||||
width: 340px !important;
|
||||
}
|
||||
|
||||
div.caps_summary_table{
|
||||
width: 35em;
|
||||
display: table;
|
||||
}
|
||||
|
||||
div.caps_summary_col_1{
|
||||
width: 2em;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
div.caps_summary_col_2{
|
||||
width: 20em;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
div.caps_summary_col_3{
|
||||
width: 3em;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
div.overall_summary_table{
|
||||
display: table;
|
||||
}
|
||||
|
||||
div.overall_summary_col_1{
|
||||
width: 2em;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
div.overall_summary_col_2{
|
||||
width: 30em;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
div.overall_summary_col_3{
|
||||
width: 3em;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
div.cap_short{
|
||||
width: 50em;
|
||||
display: inline-table;
|
||||
}
|
||||
div.cap_item{
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
div.caps_details_table{
|
||||
display: table;
|
||||
}
|
||||
|
||||
.zebra_odd div {
|
||||
width: auto;
|
||||
background-color: #FDFFF5;
|
||||
}
|
||||
|
||||
.zebra_even div {
|
||||
width: auto;
|
||||
background-color: #F7F5FF;
|
||||
}
|
||||
|
||||
.ui-button .ui-button-text
|
||||
{
|
||||
line-height: 0.9;
|
||||
font-size: 0.8em !important;
|
||||
}
|
||||
|
||||
.ui-selectmenu-button span.ui-selectmenu-text
|
||||
{
|
||||
line-height: 0.9;
|
||||
font-size: 0.8em !important;
|
||||
}
|
||||
|
||||
.ui-menu .ui-menu-item
|
||||
{
|
||||
line-height: 0.9;
|
||||
font-size: 0.8em !important;
|
||||
}
|
1739
refstack/static/sample_test_result.json
Normal file
1739
refstack/static/sample_test_result.json
Normal file
File diff suppressed because it is too large
Load Diff
122
refstack/static/test_result.mst
Normal file
122
refstack/static/test_result.mst
Normal file
@ -0,0 +1,122 @@
|
||||
Cloud ID: {{cpid}} <br>
|
||||
Test execution time: {{duration_seconds}} <br>
|
||||
<p></p>
|
||||
<h3> DefCore test results </h3>
|
||||
{{#defcore_tests}}
|
||||
<div>
|
||||
Total passed DefCore tests: {{defcore_tests.count}} <a onclick="$('#defcore_tests_list').slideToggle(500);return false;" href="#"> [plain list] </a>
|
||||
</div>
|
||||
<ul id=defcore_tests_list style="display:none;" class="fa-ul test_results">
|
||||
{{#list}}
|
||||
<li class="fa fa-check passed"> <span class="passed"> {{.}} </span> </li>
|
||||
{{/list}}
|
||||
{{^list}}
|
||||
No DefCore tests passed!
|
||||
{{/list}}
|
||||
</ul>
|
||||
<p></p>
|
||||
<div>
|
||||
<h3>Scope filter</h3>
|
||||
<label for="only_core">Show only core tests: </label>
|
||||
<input id="only_core" name="only_core" type="checkbox" {{#only_core}}checked{{/only_core}} onclick="window.render_page()" />
|
||||
<br>
|
||||
<label for="admin">Admin filter: </label>
|
||||
<select id="admin" onchange="window.render_page()">
|
||||
<option {{#all}}selected="selected"{{/all}} value="all" >All tests</option>
|
||||
<option {{#admin}}selected="selected"{{/admin}} value="admin" >Tests requiring admin rights</option>
|
||||
<option {{#noadmin}}selected="selected"{{/noadmin}} value="noadmin">Tests not requiring admin rights</option>
|
||||
</select>
|
||||
</div>
|
||||
<p></p>
|
||||
Total passed tests in scope: {{total_passed_count}}
|
||||
{{#capabilities}}
|
||||
<ul>
|
||||
<li>
|
||||
<a onclick="toggle_one_item('all', '{{class}}', 'detailed_caps'); return false;" href="#">
|
||||
{{class}} capabilities ({{count}})
|
||||
</a>
|
||||
<div id="{{class}}_brief" class="caps_summary_table">
|
||||
<div style="display: table-col">
|
||||
<div class="caps_summary_col_1"> <span class="fa fa-check cap-passed"></span> </div>
|
||||
<div class="caps_summary_col_2"> Fully supported capabilities: </div>
|
||||
<div class="caps_summary_col_3"> {{full_support_count}} </div>
|
||||
</div>
|
||||
<div style="display: table-col">
|
||||
<div class="caps_summary_col_1"> <span class="fa fa-question-circle cap-part-passed"></span> </div>
|
||||
<div class="caps_summary_col_2"> Partially supported capabilities: </div>
|
||||
<div class="caps_summary_col_3"> {{partial_support_count}} </div>
|
||||
</div>
|
||||
<div style="display: table-col">
|
||||
<div class="caps_summary_col_1"> <span class="fa fa-times cap-failed"></span> </div>
|
||||
<div class="caps_summary_col_2"> Unsupported capabilities: </div>
|
||||
<div class="caps_summary_col_3"> {{full_unsupport_count}} </div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{class}}_detailed_caps" style="position: relative; left: 1em; display:none;" class="all_detailed_caps">
|
||||
{{#items}}
|
||||
<div class="cap_item">
|
||||
<div class="cap_shot">
|
||||
<div style="width: 2em; display: table-cell;"> {{#caps_support}}{{/caps_support}} </div>
|
||||
<div style="width: 30em; display: table-cell;">
|
||||
<a onclick="toggle_one_item('{{class}}', '{{id}}', 'detailed_results'); return false; " title="Description: {{description}}" href="#" > {{name}} </a>
|
||||
</div>
|
||||
<div style="width: 3em; display: table-cell; ">
|
||||
<span class="passed">{{passed_count}}</span>
|
||||
</div>
|
||||
<div style="width: 3em; display: table-cell; ">
|
||||
<span class="failed">{{failed_count}}</span>
|
||||
</div>
|
||||
<!--<div style="width: 5em; display: table-cell; ">-->
|
||||
<!--<a onclick="$('#{{id}}_detail').slideToggle(); return false;" title="Details" href="#" > <span class="fa fa-angle-double-down"></span> </a>-->
|
||||
<!--<a onclick="$('#{{id}}_brief').slideToggle(); return false;" href="#" > <span class="fa fa-angle-double-right"></span> </a>-->
|
||||
<!--</div>-->
|
||||
<!--<div style="width: 20em; display: table-cell;">-->
|
||||
<!--<div id="{{id}}_brief" style="display: none;">-->
|
||||
<!--{{#test_chart}}-->
|
||||
<!--{{#chart_bullets}} {{.}} {{/chart_bullets}}-->
|
||||
<!--{{/test_chart}}-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
</div>
|
||||
<div id="{{id}}_detailed_results" class="{{class}}_detailed_results" style="display:none;">
|
||||
<ul class="fa-ul test_results">
|
||||
{{#failed_tests}}
|
||||
<li class="fa fa-times failed">
|
||||
<span>
|
||||
{{.}} <a href="javascript:void(window.get_code_url('{{.}}'));"> [github] </a>
|
||||
</span>
|
||||
</li>
|
||||
{{/failed_tests}}
|
||||
</ul>
|
||||
<ul class="fa-ul test_results">
|
||||
{{#passed_tests}}
|
||||
<li class="fa fa-check passed">
|
||||
<span>
|
||||
{{.}} <a href="javascript:void(window.get_code_url('{{.}}'));"> [github] </a>
|
||||
</span>
|
||||
</li>
|
||||
{{/passed_tests}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{/items}}
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
{{/capabilities}}
|
||||
{{^capabilities}}
|
||||
<div> No capabilities!</div>
|
||||
{{/capabilities}}
|
||||
{{/defcore_tests}}
|
||||
{{#other_tests}}
|
||||
<h3> Tests out of scope </h3>
|
||||
Total passed tests tests out of scope: {{count}} <a onclick="$('#other_tests_list').slideToggle();return false;" href="#"> [plain list] </a>
|
||||
<ul id=other_tests_list style="display:none;" class="fa-ul test_results">
|
||||
{{#list}}
|
||||
<li class="fa fa-check passed"> <span class="passed"> {{.}} </span> </li>
|
||||
{{/list}}
|
||||
{{^list}}
|
||||
No other tests!
|
||||
{{/list}}
|
||||
</ul>
|
||||
{{/other_tests}}
|
49
refstack/templates/comparison.html
Normal file
49
refstack/templates/comparison.html
Normal file
@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" ></script>
|
||||
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/refstack.css">
|
||||
<link rel="stylesheet" type="text/css" href="/report_page.css">
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
|
||||
<script src="/js/jquery.cookie.js"></script>
|
||||
<script src="/js/spin.js"></script>
|
||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/mustache.js/0.8.1/mustache.min.js"></script>
|
||||
<script>
|
||||
window.result_source = '{{result_source}}';
|
||||
window.prev_result_source = '{{prev_result_source}}';
|
||||
</script>
|
||||
<script src="/js/helpers.js"></script>
|
||||
<script src="/js/refstack.js"></script>
|
||||
<script>
|
||||
window.render_page = function(){
|
||||
render_defcore_diff_report_page();
|
||||
};
|
||||
$(document).ready(function() {
|
||||
window.loading_spin();
|
||||
window.render_page();
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>DefCore test comparison</h1>
|
||||
<p></p>
|
||||
<div>
|
||||
<label for="schema_selector">Capabilities schema: </label>
|
||||
<br>
|
||||
<select id="schema_selector">
|
||||
<option selected="selected" value="havanacore.json" >Havana core</option>
|
||||
<option value="icehouse_mockup.json" >Icehouse autogenerated</option>
|
||||
</select>
|
||||
</div>
|
||||
<p></p>
|
||||
<div id="test_props">
|
||||
</div>
|
||||
<p></p>
|
||||
<div id="test_results"></div>
|
||||
<p></p>
|
||||
<div>Copyright OpenStack Foundation, 2014. Apache 2.0 License.</div>
|
||||
</body>
|
||||
</html>
|
48
refstack/templates/output.html
Normal file
48
refstack/templates/output.html
Normal file
@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" ></script>
|
||||
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/refstack.css">
|
||||
<link rel="stylesheet" type="text/css" href="/report_page.css">
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
|
||||
<script src="/js/jquery.cookie.js"></script>
|
||||
<script src="/js/spin.js"></script>
|
||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/mustache.js/0.8.1/mustache.min.js"></script>
|
||||
<script>
|
||||
window.result_source = '{{result_source}}';
|
||||
</script>
|
||||
<script src="/js/helpers.js"></script>
|
||||
<script src="/js/refstack.js"></script>
|
||||
<script>
|
||||
render_page = function(){
|
||||
render_defcore_report_page();
|
||||
};
|
||||
$(document).ready(function() {
|
||||
loading_spin();
|
||||
render_page();
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>DefCore test report</h1>
|
||||
<p></p>
|
||||
<div>
|
||||
<label for="schema_selector">Capabilities schema: </label>
|
||||
<br>
|
||||
<select id="schema_selector">
|
||||
<option selected="selected" value="havanacore.json" >Havana core</option>
|
||||
<option value="icehouse_mockup.json" >Icehouse autogenerated</option>
|
||||
</select>
|
||||
</div>
|
||||
<p></p>
|
||||
<div id="test_props">
|
||||
</div>
|
||||
<p></p>
|
||||
<div id="test_results"></div>
|
||||
<p></p>
|
||||
<div>Copyright OpenStack Foundation, 2014. Apache 2.0 License.</div>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user