Permalink
Browse files

Move dashboard from CouchApp to Sammy

  • Loading branch information...
1 parent 5023da6 commit ef68e6194a0e7ed6cab8137db8f1d5bc6b4b1bac @whimboo whimboo committed Sep 30, 2010
Showing with 6,610 additions and 4,441 deletions.
  1. +3 −0 README.md
  2. +13 −0 _attachments/{style → css}/main.css
  3. +40 −0 _attachments/index.html
  4. +226 −0 _attachments/js/dashboard.js
  5. +154 −0 _attachments/js/jquery/jquery-1.4.2.min.js
  6. 0 _attachments/{script → js/jquery}/jquery.tablesorter.min.js
  7. +115 −0 _attachments/js/sammy/plugins/sammy.cache.js
  8. +78 −0 _attachments/js/sammy/plugins/sammy.data_location_proxy.js
  9. +700 −0 _attachments/js/sammy/plugins/sammy.ejs.js
  10. +274 −0 _attachments/js/sammy/plugins/sammy.form.js
  11. +553 −0 _attachments/js/sammy/plugins/sammy.haml.js
  12. +362 −0 _attachments/js/sammy/plugins/sammy.json.js
  13. +140 −0 _attachments/js/sammy/plugins/sammy.meld.js
  14. +444 −0 _attachments/js/sammy/plugins/sammy.mustache.js
  15. +118 −0 _attachments/js/sammy/plugins/sammy.nested_params.js
  16. +29 −0 _attachments/js/sammy/plugins/sammy.path_location_proxy.js
  17. +756 −0 _attachments/js/sammy/plugins/sammy.pure.js
  18. +577 −0 _attachments/js/sammy/plugins/sammy.storage.js
  19. +117 −0 _attachments/js/sammy/plugins/sammy.template.js
  20. +59 −0 _attachments/js/sammy/plugins/sammy.title.js
  21. +1,696 −0 _attachments/js/sammy/sammy.js
  22. +0 −18 _attachments/script/myloader.js
  23. +39 −0 _attachments/templates/general_reports.mustache
  24. +55 −0 _attachments/templates/report.mustache
  25. +0 −1 _id
  26. +62 −0 app.js
  27. +0 −4 couchapp.json
  28. +0 −11 evently/items/_changes/data.js
  29. +0 −18 evently/items/_changes/mustache.html
  30. +0 −5 evently/items/_changes/query.json
  31. +0 −14 evently/profile/profileReady/mustache.html
  32. +0 −14 evently/profile/profileReady/selectors/form/submit.js
  33. +0 −10 evently/reports/_changes/data.js
  34. +0 −28 evently/reports/_changes/mustache.html
  35. +0 −5 evently/reports/_changes/query.json
  36. +0 −1 language
  37. +0 −32 lists/addons_reports.js
  38. +0 −47 lists/general_reports.js
  39. +0 −32 lists/update_reports.js
  40. +0 −66 rewrites.json
  41. +0 −5 shows/redirect.js
  42. +0 −96 shows/report.js
  43. +0 −84 templates/general/reports.html
  44. +0 −30 templates/partials/header.html
  45. +0 −116 templates/report.html
  46. +0 −3 vendor/couchapp/README.md
  47. +0 −329 vendor/couchapp/_attachments/jquery.couch.app.js
  48. +0 −83 vendor/couchapp/_attachments/jquery.couch.app.util.js
  49. +0 −363 vendor/couchapp/_attachments/jquery.evently.js
  50. +0 −346 vendor/couchapp/_attachments/jquery.mustache.js
  51. +0 −172 vendor/couchapp/_attachments/jquery.pathbinder.js
  52. +0 −17 vendor/couchapp/_attachments/loader.js
  53. +0 −22 vendor/couchapp/evently/README.md
  54. +0 −16 vendor/couchapp/evently/account/_init.js
  55. +0 −1 vendor/couchapp/evently/account/adminParty/mustache.html
  56. +0 −10 vendor/couchapp/evently/account/doLogin.js
  57. +0 −8 vendor/couchapp/evently/account/doLogout.js
  58. +0 −10 vendor/couchapp/evently/account/doSignup.js
  59. +0 −4 vendor/couchapp/evently/account/loggedIn/after.js
  60. +0 −7 vendor/couchapp/evently/account/loggedIn/data.js
  61. +0 −4 vendor/couchapp/evently/account/loggedIn/mustache.html
  62. +0 −3 vendor/couchapp/evently/account/loggedIn/selectors.json
  63. +0 −1 vendor/couchapp/evently/account/loggedOut/mustache.html
  64. +0 −4 vendor/couchapp/evently/account/loggedOut/selectors.json
  65. +0 −3 vendor/couchapp/evently/account/loginForm/after.js
  66. +0 −6 vendor/couchapp/evently/account/loginForm/mustache.html
  67. +0 −1 vendor/couchapp/evently/account/loginForm/selectors/a[href=#signup].json
  68. +0 −6 vendor/couchapp/evently/account/loginForm/selectors/form/submit.js
  69. +0 −3 vendor/couchapp/evently/account/signupForm/after.js
  70. +0 −6 vendor/couchapp/evently/account/signupForm/mustache.html
  71. +0 −1 vendor/couchapp/evently/account/signupForm/selectors/a[href=#login].json
  72. +0 −6 vendor/couchapp/evently/account/signupForm/selectors/form/submit.js
  73. +0 −21 vendor/couchapp/evently/profile/loggedIn.js
  74. +0 −3 vendor/couchapp/evently/profile/loggedOut/after.js
  75. +0 −1 vendor/couchapp/evently/profile/loggedOut/mustache.html
  76. +0 −3 vendor/couchapp/evently/profile/noProfile/data.js
  77. +0 −11 vendor/couchapp/evently/profile/noProfile/mustache.html
  78. +0 −36 vendor/couchapp/evently/profile/noProfile/selectors/form/submit.js
  79. +0 −3 vendor/couchapp/evently/profile/profileReady/after.js
  80. +0 −3 vendor/couchapp/evently/profile/profileReady/data.js
  81. +0 −8 vendor/couchapp/evently/profile/profileReady/mustache.html
  82. +0 −39 vendor/couchapp/lib/atom.js
  83. +0 −25 vendor/couchapp/lib/cache.js
  84. +0 −108 vendor/couchapp/lib/docform.js
  85. +0 −18 vendor/couchapp/lib/linkup.js
  86. +0 −13 vendor/couchapp/lib/list.js
  87. +0 −1,300 vendor/couchapp/lib/markdown.js
  88. +0 −261 vendor/couchapp/lib/md5.js
  89. +0 −339 vendor/couchapp/lib/mustache.js
  90. +0 −83 vendor/couchapp/lib/path.js
  91. +0 −8 vendor/couchapp/lib/redirect.js
  92. +0 −5 vendor/couchapp/metadata.json
  93. +0 −24 views/addons_reportsByDate/map.js
  94. +0 −33 views/general_reportsByDate/map.js
  95. +0 −24 views/update_reportsByDate/map.js
View
@@ -0,0 +1,3 @@
+# Mozmill Dashboard
+
+The Mozmill Dashboard is used to visualize results of Mozmill testruns over time. It will help to analyze failures by displaying analysis results for top failures, new failures, and general uploaded results for each of the suported testruns.
@@ -216,3 +216,16 @@ th.header {
border-right: 1px solid #dad9c7;
margin-left: -1px;
}
+
+span.branch-select {
+ cursor: pointer;
+ padding-left: 20px;
+}
+span.pagination {
+ cursor: pointer;
+ padding-left: 20px;
+}
+
+span.selected {
+ background-color: #555;
+}
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <title>Mozmill Results Dashboard</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <link rel="stylesheet" href="css/main.css" type="text/css">
+ <script language="javascript" type="text/javascript" src="js/jquery/jquery-1.4.2.min.js"></script>
+ <script language="javascript" type="text/javascript" src="/js/jquery/jquery.tablesorter.min.js"></script>
+ <script language="javascript" type="text/javascript" src="js/sammy/sammy.js"></script>
+ <script language="javascript" type="text/javascript" src="js/sammy/plugins/sammy.mustache.js"></script>
+ <script language="javascript" type="text/javascript" src="js/dashboard.js"></script>
+ </head>
+
+ <body>
+ <div id="header">
+ <h2 id="title">Mozmill Results Dashboard</h2>
+ <div id="testrun_selection">
+ <form id="page_controls">
+ <label for="type_selection">Report Type:</label>
+ <select id="type_selection">
+ <option value="/general">General Testrun</option>
+ <option value="/update">Update Testrun</option>
+ <option value="/addons">Add-ons Testrun</option>
+ </select>
+ <label for="view_selection">View:</label>
+ <select id="view_selection">
+ <option value="/general/topFail">Top Failures</option>
+ <option value="/general/newFail">New Failures</option>
+ <option value="/general/reports">Reports</option>
+ </select>
+ </form>
+
+ <div id="account"></div>
+ </div>
+ </div>
+
+ <div id="content"></div>
+
+ </body>
+</html>
@@ -0,0 +1,226 @@
+var request = function (options, callback) {
+ options.success = function (obj) {
+ callback(null, obj);
+ }
+
+ options.error = function (err) {
+ if (err) callback(err);
+ else callback(true);
+ }
+
+ options.dataType = 'json';
+ $.ajax(options)
+}
+
+var capitalize = function(s) {
+ return s.replace( /(^|\s)([a-z])/g , function(m,p1,p2){ return p1+p2.toUpperCase(); } );
+};
+
+var a = $.sammy(function () {
+
+ var general_reports = function() {
+ var branch = this.params.branch ? this.params.branch : 'All';
+ var os = this.params.os ? this.params.os : 'All';
+ var template = '/templates/general_reports.mustache';
+
+ this.render(template).replace('#content').then(function () {
+ var limit = 0;
+ var skip = 0;
+
+ $('#branch-selection span').each(function (i, elem) {
+ if (elem.textContent === branch) {
+ $(elem).addClass("selected")
+ }
+ })
+ .click(function () { window.location = '/#/general/'+this.textContent+'/'+os })
+
+ $('#os-selection span').each(function (i, elem) {
+ if (elem.textContent === os) {
+ $(elem).addClass("selected")
+ }
+ })
+ .click(function () { window.location = '/#/general/'+branch+'/'+this.textContent })
+
+ var addResults = function () {
+ var query = {
+ startkey: JSON.stringify([branch, os, {}])
+ , endkey: JSON.stringify([branch, os])
+ , descending: "true"
+ , limit: 25 //String(limit) + $("input.pagination").val()
+ // , skip: String(skip)
+ }
+
+ request({url:'/_view/general_reports?'+$.param(query)}, function (err, resp) {
+ var entries = '';
+ if (err) console.log(err);
+
+ resp.rows.forEach(function (row) {
+ var v = row.value;
+ entries += ( '<tr>' +
+ '<td><a href="#/general/report/' + v.id + '">' + v.time_start + '</a></td>' +
+ "<td>" + v.application_version + "</td>" +
+ "<td>" + v.buildId + "</td>" +
+ "<td>"+ v.system +"</td>" +
+ "<td>" + v.system_version + "</td>" +
+ "<td>" + v.processor + "</td>" +
+ "<td>" + v.application_locale + "</td>" +
+ "<td>" + v.tests_passed + "</td>" +
+ "<td>" + v.tests_skipped + "</td>" +
+ "<td>" + v.tests_failed + "</td>" +
+ "</tr>"
+ )
+ })
+ $("#resultsBody").append(entries)
+ limit += $("input.pagination").val();
+ skip += $("input.pagination").val();
+ });
+ }
+
+ addResults();
+ $("span.pagination").click(addResults);
+ $("#subtitle").text("General Reports");
+ });
+ }
+
+
+ var topFailures = function () {
+
+ }
+
+ function general_report() {
+ var context = this;
+
+ var id = this.params.id ? this.params.id : 'null';
+ var template = '/templates/report.mustache';
+
+ request({url: '/db/' + id}, function (err, resp) {
+ if (err) console.log(err);
+
+ context.id = resp._id;
+ context.app_name = resp.application_name;
+ context.app_version = resp.application_version;
+ context.platform_version = resp.platform_version;
+ context.platform_buildId = resp.platform_buildid;
+ context.app_locale = resp.application_locale;
+ context.app_sourcestamp = resp.application_repository + "/rev/" + resp.application_changeset;
+ context.system = resp.system_info.system,
+ context.system_version = resp.system_info.version,
+ context.service_pack = resp.system_info.service_pack,
+ context.cpu = resp.system_info.processor,
+ context.time_start = resp.time_start;
+ context.time_end = resp.time_end;
+ context.passed = resp.tests_passed;
+ context.failed = resp.tests_failed;
+ context.skipped = resp.tests_skipped;
+
+ context.results = [];
+
+ for (var i = 0; i < resp.results.length; i++) {
+ var result = resp.results[i];
+
+ var types = {
+ 'firefox-general' : 'firefox/',
+ 'mozmill-test' : 'firefox/',
+ 'mozmill-restart-test' : 'firefox/',
+ 'firefox-update' : 'softwareUpdate',
+ 'firefox-addons' : 'addons/'
+ };
+
+ var type = types[resp.report_type];
+ var filename = result.filename.split(type)[1]
+
+ var status = "passed";
+ if (result.skipped) {
+ status = "skipped";
+ } else if (result.failed) {
+ status = "failed";
+ }
+
+ var information = "";
+ var stack = "";
+ try {
+ if (result.skipped) {
+ information = result.skipped_reason;
+
+ var re = /Bug ([\d]+)/g.exec(information);
+ if (re) {
+ var tmpl = '<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=%s">Bug %s</a>';
+ var link = tmpl.replace(/\%s/g, re[1]);
+ information = information.replace(re[0], link);
+ }
+ } else {
+ information = result.fails[0].exception.message;
+ stack = result.fails[0].exception.stack;
+ }
+ } catch (ex) { }
+
+ context.results.push({
+ filename : filename,
+ test : result.name,
+ status : status,
+ information: information,
+ stack : stack
+ });
+ }
+
+ context.render(template).replace('#content').then(function () {
+ $("#result").tablesorter({
+ // sort on the first column and third column, order asc
+ sortList: [[0,0],[1,0]]
+ });
+ $("#all").fadeOut();
+ $("#all").click(function (event) {
+ $("#filter a").fadeIn();
+ $("#all").fadeOut();
+ $("tr.passed").fadeIn("slow");
+ $("tr.failed").fadeIn("slow");
+ $("tr.skipped").fadeIn("slow");
+ event.preventDefault();
+ });
+
+ $("#passed").click(function (event) {
+ $("#filter a").fadeIn();
+ $("#passed").fadeOut();
+ $("tr.passed").fadeIn("slow");
+ $("tr.failed").fadeOut("slow");
+ $("tr.skipped").fadeOut("slow");
+ event.preventDefault();
+ });
+
+ $("#failed").click(function (event) {
+ $("#filter a").fadeIn();
+ $("#failed").fadeOut();
+ $("tr.passed").fadeOut("slow");
+ $("tr.failed").fadeIn("slow");
+ $("tr.skipped").fadeOut("slow");
+ event.preventDefault();
+ });
+
+ $("#skipped").click(function (event) {
+ $("#filter a").fadeIn();
+ $("#skipped").fadeOut();
+ $("tr.passed").fadeOut("slow");
+ $("tr.failed").fadeOut("slow");
+ $("tr.skipped").fadeIn("slow");
+ event.preventDefault();
+ });
+ });
+
+ });
+
+ $("#subtitle").text("Report Details");
+
+ }
+
+ // Index of all databases
+ // Database view
+ this.get('#/general', general_reports);
+ this.get('#/general/topfailures', topFailures);
+ this.get('#/general/report/:id', general_report);
+ this.get('#/general/:branch/:os', general_reports);
+})
+
+$(function() {
+ a.use('Mustache');
+ a.run();
+});
Oops, something went wrong. Retry.

0 comments on commit ef68e61

Please sign in to comment.