Title: [141355] trunk/Tools
Revision
141355
Author
[email protected]
Date
2013-01-30 18:11:47 -0800 (Wed, 30 Jan 2013)

Log Message

Add a concept of dashboard parameters that invalidate others
https://bugs.webkit.org/show_bug.cgi?id=108362

Reviewed by Dirk Pranke.

There are certain parameters to the dashboards, that when selected,
invalidate others, such as selecting the test type invalidates the
builder group. Add this concept to dashboard_base and allow specifc
dashboard to add their own invalidating parameters.

The result is that when the user takes a specific action, like changing
the test type, the builder would get reset to the default for the new
test type, rather than erroring or not matching the query param, as is
the current behavior.

Also deletes some unused code (selectBuilder).

* TestResultServer/static-dashboards/dashboard_base.js:
(invalidateQueryParameters):
(setQueryParameter):
* TestResultServer/static-dashboards/flakiness_dashboard.js:
* TestResultServer/static-dashboards/flakiness_dashboard_unittests.js:
* TestResultServer/static-dashboards/timeline_explorer.html:
* TestResultServer/static-dashboards/treemap.html:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (141354 => 141355)


--- trunk/Tools/ChangeLog	2013-01-31 02:07:58 UTC (rev 141354)
+++ trunk/Tools/ChangeLog	2013-01-31 02:11:47 UTC (rev 141355)
@@ -1,3 +1,30 @@
+2013-01-30  Julie Parent  <[email protected]>
+
+        Add a concept of dashboard parameters that invalidate others
+        https://bugs.webkit.org/show_bug.cgi?id=108362
+
+        Reviewed by Dirk Pranke.
+
+        There are certain parameters to the dashboards, that when selected,
+        invalidate others, such as selecting the test type invalidates the
+        builder group. Add this concept to dashboard_base and allow specifc
+        dashboard to add their own invalidating parameters.
+        
+        The result is that when the user takes a specific action, like changing
+        the test type, the builder would get reset to the default for the new
+        test type, rather than erroring or not matching the query param, as is
+        the current behavior.
+        
+        Also deletes some unused code (selectBuilder).
+        
+        * TestResultServer/static-dashboards/dashboard_base.js:
+        (invalidateQueryParameters):
+        (setQueryParameter):
+        * TestResultServer/static-dashboards/flakiness_dashboard.js:
+        * TestResultServer/static-dashboards/flakiness_dashboard_unittests.js:
+        * TestResultServer/static-dashboards/timeline_explorer.html:
+        * TestResultServer/static-dashboards/treemap.html:
+
 2013-01-30  Kiran Muppala  <[email protected]>
 
         Disable process suppression of DumpRenderTree on Mac

Modified: trunk/Tools/TestResultServer/static-dashboards/dashboard_base.js (141354 => 141355)


--- trunk/Tools/TestResultServer/static-dashboards/dashboard_base.js	2013-01-31 02:07:58 UTC (rev 141354)
+++ trunk/Tools/TestResultServer/static-dashboards/dashboard_base.js	2013-01-31 02:11:47 UTC (rev 141355)
@@ -94,6 +94,12 @@
     'Z': 1
 };
 
+// Map of parameter to other parameter it invalidates.
+var CROSS_DB_INVALIDATING_PARAMETERS = {
+    'testType': 'group'
+};
+var DB_SPECIFIC_INVALIDATING_PARAMETERS;
+
 // Keys in the JSON files.
 var WONTFIX_COUNTS_KEY = 'wontfixCounts';
 var FIXABLE_COUNTS_KEY = 'fixableCounts';
@@ -530,19 +536,36 @@
     return combinedState;    
 }
 
+function invalidateQueryParameters(queryParamsAsState) {
+    for (var key in queryParamsAsState) {
+        if (key in CROSS_DB_INVALIDATING_PARAMETERS)
+            delete g_crossDashboardState[CROSS_DB_INVALIDATING_PARAMETERS[key]];
+        if (key in DB_SPECIFIC_INVALIDATING_PARAMETERS)
+            delete g_currentState[DB_SPECIFIC_INVALIDATING_PARAMETERS[key]];
+    }
+}
+
 // Sets the page state. Takes varargs of key, value pairs.
 function setQueryParameter(var_args)
 {
-    var state = combinedDashboardState();
+    var queryParamsAsState = {};
     for (var i = 0; i < arguments.length; i += 2) {
         var key = arguments[i];
-        state[key] = arguments[i + 1];
+        queryParamsAsState[key] = arguments[i + 1];
     }
+
+    invalidateQueryParameters(queryParamsAsState);
+
+    var newState = combinedDashboardState();
+    for (var key in queryParamsAsState) {
+        newState[key] = queryParamsAsState[key];
+    }
+
     // Note: We use window.location.hash rather that window.location.replace
     // because of bugs in Chrome where extra entries were getting created
     // when back button was pressed and full page navigation was occuring.
     // FIXME: file those bugs.
-    window.location.hash = permaLinkURLHash(state);
+    window.location.hash = permaLinkURLHash(newState);
 }
 
 function permaLinkURLHash(opt_state)
@@ -688,11 +711,6 @@
     return html + '</div>';
 }
 
-function selectBuilder(builder)
-{
-    setQueryParameter('builder', builder);
-}
-
 function loadDashboard(fileName)
 {
     var pathName = window.location.pathname;

Modified: trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js (141354 => 141355)


--- trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js	2013-01-31 02:07:58 UTC (rev 141354)
+++ trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js	2013-01-31 02:11:47 UTC (rev 141355)
@@ -262,6 +262,11 @@
     result: '',
 };
 
+DB_SPECIFIC_INVALIDATING_PARAMETERS = {
+    'testType': 'builder',
+    'group': 'builder'
+};
+
 //////////////////////////////////////////////////////////////////////////////
 // GLOBALS
 //////////////////////////////////////////////////////////////////////////////

Modified: trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js (141354 => 141355)


--- trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js	2013-01-31 02:07:58 UTC (rev 141354)
+++ trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js	2013-01-31 02:11:47 UTC (rev 141355)
@@ -722,3 +722,15 @@
     }, "foo/bar");
     deepEqual(leafsOfPartialTrieTraversal, expectedLeafs);
 });
+
+test('changeTestTypeInvalidatesGroup', 1, function() {
+    resetGlobals();
+    var originalGroup = '@ToT - chromium.org';
+    var originalTestType = 'layout-tests';
+    loadBuildersList(originalGroup, originalTestType);
+    g_crossDashboardState.group = originalGroup;
+    g_crossDashboardState.testType = originalTestType;
+
+    invalidateQueryParameters({'testType': 'ui_tests'});
+    notEqual(g_crossDashboardState.group, originalGroup, "group should have been invalidated");   
+});
\ No newline at end of file

Modified: trunk/Tools/TestResultServer/static-dashboards/timeline_explorer.html (141354 => 141355)


--- trunk/Tools/TestResultServer/static-dashboards/timeline_explorer.html	2013-01-31 02:07:58 UTC (rev 141354)
+++ trunk/Tools/TestResultServer/static-dashboards/timeline_explorer.html	2013-01-31 02:11:47 UTC (rev 141355)
@@ -172,6 +172,11 @@
     ignoreFlakyTests: true
 };
 
+DB_SPECIFIC_INVALIDATING_PARAMETERS = {
+    'testType': 'builder',
+    'group': 'builder'
+};
+
 function shouldShowWebKitRevisionsOnly()
 {
     return isTipOfTreeWebKitBuilder();

Modified: trunk/Tools/TestResultServer/static-dashboards/treemap.html (141354 => 141355)


--- trunk/Tools/TestResultServer/static-dashboards/treemap.html	2013-01-31 02:07:58 UTC (rev 141354)
+++ trunk/Tools/TestResultServer/static-dashboards/treemap.html	2013-01-31 02:11:47 UTC (rev 141355)
@@ -293,8 +293,13 @@
 
 g_defaultDashboardSpecificStateValues = {
     treemapfocus: '',
-}
+};
 
+DB_SPECIFIC_INVALIDATING_PARAMETERS = {
+    'testType': 'builder',
+    'group': 'builder'
+};
+
 function handleQueryParameterChange(params)
 {
     for (var param in params) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to