Changeset 91272 in webkit


Ignore:
Timestamp:
Jul 19, 2011 11:11:39 AM (13 years ago)
Author:
Adam Roben
Message:

Extract some of FailingTestsBugForm's code into a base class

Prep work for fixing <http://webkit.org/b/63728> TestFailures page should make it easy to
file bugs about flaky tests

Reviewed by Sam Weinig.

  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/FailingTestsBugForm.js:

Moved BugzillaConstants to new WebKitBugzilla file. Moved a bunch of other code from here to
TestRelatedBugForm.js.

  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/FailingTestsBugForm_unittests.js:

Moved some tests to TestRelatedBugForm_unittests.js.

  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/TestRelatedBugForm.js: Added.

(TestRelatedBugForm):
(TestRelatedBugForm.prototype.domElement):
(TestRelatedBugForm.prototype._computeOperatingSystem):
(TestRelatedBugForm.prototype._computePlatform):
Code came from FailingTestsBugForm.

  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/TestRelatedBugForm_unittests.js:

Added. Tests came from FailingTestsBugForm_unittests.js

  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/WebKitBugzilla.js:

Added. Code came from FailingTestsBugForm.js.

  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/index.html: Pull in

TestRelatedBugForm.js and WebKitBugzilla.js. Moved Bugzilla.js out of the list of files that
need to be pulled in early for parsing reasons.

  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html:

Pull in TestRelatedBugForm and tests and WebKitBugzilla.

Location:
trunk/Tools
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/FailingTestsBugForm.js

    r91068 r91272  
    2424 */
    2525
    26 // FIXME: These should probably move to some WebKitBugzilla class (or similar).
    27 const BugzillaConstants = {
    28     Component: {
    29         ToolsTests: 'Tools / Tests',
    30     },
    31 
    32     Keyword: {
    33         LayoutTestFailure: 'LayoutTestFailure',
    34         MakingBotsRed: 'MakingBotsRed',
    35         Regression: 'Regression',
    36     },
    37 
    38     OperatingSystem: {
    39         Leopard: 'Mac OS X 10.5',
    40         SnowLeopard: 'Mac OS X 10.6',
    41         Windows7: 'Windows 7',
    42         WindowsXP: 'Windows XP',
    43     },
    44 
    45     Platform: {
    46         Macintosh: 'Macintosh',
    47         PC: 'PC',
    48     },
    49 
    50     Product: {
    51         WebKit: 'WebKit',
    52     },
    53 
    54     Version: {
    55         Nightly: '528+ (Nightly Build)',
    56     },
    57 };
    58 
    5926function FailingTestsBugForm(bugzilla, trac, tester, failingBuildName, passingBuildName, failingTests) {
    60     NewBugForm.call(this, bugzilla);
     27    TestRelatedBugForm.call(this, bugzilla, tester);
    6128
    6229    this._trac = trac;
    63     this._tester = tester;
    6430    this._failingBuildName = failingBuildName;
    6531    this._passingBuildName = passingBuildName;
    6632    this._failingTests = failingTests;
    6733
    68     this.component = BugzillaConstants.Component.ToolsTests;
    6934    this.description = this._createBugDescription();
    7035    // FIXME: When a newly-added test has been failing since its introduction, it isn't really a
    7136    // "regression". We should use different keywords in that case. <http://webkit.org/b/61645>
    72     this.keywords = [
    73         BugzillaConstants.Keyword.LayoutTestFailure,
    74         BugzillaConstants.Keyword.MakingBotsRed,
    75         BugzillaConstants.Keyword.Regression
    76     ].join(', ');
    77     this.operatingSystem = this._computeOperatingSystem();
    78     this.platform = this._computePlatform();
    79     this.product = BugzillaConstants.Product.WebKit;
     37    this.keywords += ', ' + WebKitBugzilla.Keyword.Regression;
    8038    this.title = this._createBugTitle();
    8139    this.url = this._failingResultsHTMLURL();
    82     this.version = BugzillaConstants.Version.Nightly;
    8340}
    8441
    8542FailingTestsBugForm.prototype = {
    86     domElement: function() {
    87         var form = NewBugForm.prototype.domElement.call(this);
    88         form.className = 'new-bug-form';
    89         form.target = '_blank';
    90         return form;
    91     },
    92 
    93     _computeOperatingSystem: function() {
    94         if (/Windows 7/.test(this._tester.name))
    95             return BugzillaConstants.OperatingSystem.Windows7;
    96         if (/Windows XP/.test(this._tester.name))
    97             return BugzillaConstants.OperatingSystem.WindowsXP;
    98         if (/SnowLeopard/.test(this._tester.name))
    99             return BugzillaConstants.OperatingSystem.SnowLeopard;
    100         if (/Leopard/.test(this._tester.name))
    101             return BugzillaConstants.OperatingSystem.Leopard;
    102         return '';
    103     },
    104 
    105     _computePlatform: function() {
    106         if (/Windows/.test(this._tester.name))
    107             return BugzillaConstants.Platform.PC;
    108         if (/Leopard/.test(this._tester.name))
    109             return BugzillaConstants.Platform.Macintosh;
    110         return '';
    111     },
    112 
    11343    _createBugDescription: function() {
    11444        var firstSuspectRevision = this._passingRevision() ? this._passingRevision() + 1 : this._failingRevision();
     
    190120};
    191121
    192 FailingTestsBugForm.prototype.__proto__ = NewBugForm.prototype;
     122FailingTestsBugForm.prototype.__proto__ = TestRelatedBugForm.prototype;
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/FailingTestsBugForm_unittests.js

    r91068 r91272  
    2727
    2828module('FailingTestsBugForm');
    29 
    30 function MockBuilder(name) {
    31     this.name = name;
    32 }
    3329
    3430function createTestForm(testerName, failingBuildName, passingBuildName, failingTests) {
     
    6359}
    6460
    65 test('component and keywords are set', 2, function() {
     61test('keywords are set', 1, function() {
    6662    var form = createTestForm('Windows 7 Release (Tests)', 'r10 (5)', 'r8 (2)', ['css1/basic/class_as_selector.html']);
    6763
    68     equal(form.component, BugzillaConstants.Component.ToolsTests);
    69     deepEqual(form.keywords.split(', '), [BugzillaConstants.Keyword.LayoutTestFailure, BugzillaConstants.Keyword.MakingBotsRed, BugzillaConstants.Keyword.Regression]);
    70 });
    71 
    72 const testers = {
    73     'GTK Linux 32-bit Release': {
    74         operatingSystem: '',
    75         platform: '',
    76     },
    77     'Leopard Intel Release (Tests)': {
    78         operatingSystem: BugzillaConstants.OperatingSystem.Leopard,
    79         platform: BugzillaConstants.Platform.Macintosh,
    80     },
    81     'SnowLeopard Intel Release (Tests)': {
    82         operatingSystem: BugzillaConstants.OperatingSystem.SnowLeopard,
    83         platform: BugzillaConstants.Platform.Macintosh,
    84     },
    85     'Windows 7 Release (Tests)': {
    86         operatingSystem: BugzillaConstants.OperatingSystem.Windows7,
    87         platform: BugzillaConstants.Platform.PC,
    88     },
    89     'Windows XP Debug (Tests)': {
    90         operatingSystem: BugzillaConstants.OperatingSystem.WindowsXP,
    91         platform: BugzillaConstants.Platform.PC,
    92     },
    93 };
    94 
    95 test('operating system is deduced', 5, function() {
    96     for (var name in testers) {
    97         var form = createTestForm(name, 'r10 (5)', 'r8 (2)', ['css1/basic/class_as_selector.html']);
    98         equal(form.operatingSystem, testers[name].operatingSystem);
    99     }
    100 });
    101 
    102 test('platform is deduced', 5, function() {
    103     for (var name in testers) {
    104         var form = createTestForm(name, 'r10 (5)', 'r8 (2)', ['css1/basic/class_as_selector.html']);
    105         equal(form.platform, testers[name].platform);
    106     }
     64    deepEqual(form.keywords.split(', '), [WebKitBugzilla.Keyword.LayoutTestFailure, WebKitBugzilla.Keyword.MakingBotsRed, WebKitBugzilla.Keyword.Regression]);
    10765});
    10866
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/index.html

    r91068 r91272  
    2929    <link rel="stylesheet" href="TestFailures.css"></link>
    3030    <script src="Utilities.js"></script>
    31     <script src="Bugzilla.js"></script>
    3231    <script src="NewBugForm.js"></script>
     32    <script src="TestRelatedBugForm.js"></script>
    3333    <script src="FailingTestsBugForm.js"></script>
    3434
     35    <script src="Bugzilla.js"></script>
    3536    <script src="Buildbot.js"></script>
    3637    <script src="Builder.js"></script>
     
    4344    <script src="Trac.js"></script>
    4445    <script src="ViewController.js"></script>
    45 
     46    <script src="WebKitBugzilla.js"></script>
    4647    <script src="WebKitBuildbot.js"></script>
    4748    <script>
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html

    r91068 r91272  
    1414<!-- FIXME: We should have tests for these files! -->
    1515<script src="Bugzilla.js"></script>
     16<script src="WebKitBugzilla.js"></script>
    1617
    1718<script src="Utilities.js"></script>
     
    2021<script src="NewBugForm.js"></script>
    2122<script src="NewBugForm_unittests.js"></script>
     23
     24<script src="TestRelatedBugForm.js"></script>
     25<script src="TestRelatedBugForm_unittests.js"></script>
     26
     27<script src="FailingTestsBugForm.js"></script>
     28<script src="FailingTestsBugForm_unittests.js"></script>
    2229
    2330<script src="FlakyLayoutTestDetector.js"></script>
     
    2936<script src="Builder.js"></script>
    3037<script src="Builder_unittests.js"></script>
    31 
    32 <script src="FailingTestsBugForm.js"></script>
    33 <script src="FailingTestsBugForm_unittests.js"></script>
    3438</body>
    3539</html>
  • trunk/Tools/ChangeLog

    r91262 r91272  
     12011-07-19  Adam Roben  <aroben@apple.com>
     2
     3        Extract some of FailingTestsBugForm's code into a base class
     4
     5        Prep work for fixing <http://webkit.org/b/63728> TestFailures page should make it easy to
     6        file bugs about flaky tests
     7
     8        Reviewed by Sam Weinig.
     9
     10        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/FailingTestsBugForm.js:
     11        Moved BugzillaConstants to new WebKitBugzilla file. Moved a bunch of other code from here to
     12        TestRelatedBugForm.js.
     13
     14        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/FailingTestsBugForm_unittests.js:
     15        Moved some tests to TestRelatedBugForm_unittests.js.
     16
     17        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/TestRelatedBugForm.js: Added.
     18        (TestRelatedBugForm):
     19        (TestRelatedBugForm.prototype.domElement):
     20        (TestRelatedBugForm.prototype._computeOperatingSystem):
     21        (TestRelatedBugForm.prototype._computePlatform):
     22        Code came from FailingTestsBugForm.
     23
     24        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/TestRelatedBugForm_unittests.js:
     25        Added. Tests came from FailingTestsBugForm_unittests.js
     26
     27        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/WebKitBugzilla.js:
     28        Added. Code came from FailingTestsBugForm.js.
     29
     30        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/index.html: Pull in
     31        TestRelatedBugForm.js and WebKitBugzilla.js. Moved Bugzilla.js out of the list of files that
     32        need to be pulled in early for parsing reasons.
     33
     34        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html:
     35        Pull in TestRelatedBugForm and tests and WebKitBugzilla.
     36
    1372011-07-19  Sam Weinig  <sam@webkit.org>
    238
Note: See TracChangeset for help on using the changeset viewer.