From 2c14b92a08106976cdce2d21d4daa6179e139048 Mon Sep 17 00:00:00 2001 From: Morgan Richomme Date: Thu, 10 Mar 2016 09:34:38 +0100 Subject: reorganization of Test folder in Releng Change-Id: I92b507105e820198691ab8b1c44e1011b983b849 Signed-off-by: Morgan Richomme --- utils/test/dashboard/js/opnfv_dashboard_tests.js | 205 +++++++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 utils/test/dashboard/js/opnfv_dashboard_tests.js (limited to 'utils/test/dashboard/js/opnfv_dashboard_tests.js') diff --git a/utils/test/dashboard/js/opnfv_dashboard_tests.js b/utils/test/dashboard/js/opnfv_dashboard_tests.js new file mode 100644 index 000000000..e5bcca625 --- /dev/null +++ b/utils/test/dashboard/js/opnfv_dashboard_tests.js @@ -0,0 +1,205 @@ +/*############################################################################# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +*/ + +// Function to format date according to JS +function format_date(inputDate){ + var input = inputDate.slice(0,-7); + input=input.replace(' ','T'); + input+='Z'; + return new Date(Date.parse(input)); +} + +// Draw a single graph for a specific test for a specific installer +function draw_graph_per_scenario_per_installer (filename, installer, pod, scenario, test_unit){ + $.getJSON(filename, function(data) { + var serie = []; + index_test = 0; + // find index mapping to the test_unit + for (var i=0; i'; + var testcase = family_testcases[i]; + family_tests = Object.keys(opnfv_dashboard_testcases[testcase]); + for (var j in family_tests){ + var test = family_tests[j]; + family_tests_units = Object.keys(opnfv_dashboard_testcases[testcase][test]); + for (var k in family_tests_units){ + test_unit = opnfv_dashboard_testcases[testcase][test][k]; + html_testcases += '
  • ' + opnfv_dashboard_testcases[testcase][test][k] + '
  • '; + } + } + } + html_testcases+=''; + $("#testcase").html(html_testcases); +} + +// generate installers buttons +function show_installers(active_installer) +{ + var html_installers = ''; + html_installers += ''; + $("#installers").html(html_installers); +} + +// generate pods buttons +function show_installers_pods(active_pod) +{ + var html_pods = ''; + html_pods += ''; + $("#pods").html(html_pods); +} + +// generate a div per installer (to host the graph) +function show_divs(installer){ + $("#graphs").remove(); + $("body").append('
    '); + for (var i in opnfv_dashboard_installers_scenarios[installer]){ + var div_scenario = '
    '; +console.log(div_scenario); + var $newdiv = $(div_scenario); + $("#graphs").append($newdiv); + } +} + +// generate HTML menus and buttons +$( document ).ready(function(){ + console.log( "ready!" ); + + //show_installers(''); + show_testcases(); + on_ready_draw_graph(); +}); -- cgit 1.2.3-korg