Changeset 221114 in webkit


Ignore:
Timestamp:
Aug 23, 2017 4:04:13 PM (7 years ago)
Author:
rniwa@webkit.org
Message:

Speedometer 2.0: Add the capability to run a specific suite
https://bugs.webkit.org/show_bug.cgi?id=175908

Reviewed by Saam Barati.

Added ?suite=X query parameter to specify a specific suite (e.g. React-TodoMVC) to run.

  • Speedometer/resources/main.js:

(enableOneSuite): Added.
(startBenchmark): Return true if the benchmark actually had started running.
(startTest): Don't transition to the "running" state if the benchmark failed to start (e.g. no tests to run).

Location:
trunk/PerformanceTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/PerformanceTests/ChangeLog

    r221106 r221114  
     12017-08-23  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Speedometer 2.0: Add the capability to run a specific suite
     4        https://bugs.webkit.org/show_bug.cgi?id=175908
     5
     6        Reviewed by Saam Barati.
     7
     8        Added ?suite=X query parameter to specify a specific suite (e.g. React-TodoMVC) to run.
     9
     10        * Speedometer/resources/main.js:
     11        (enableOneSuite): Added.
     12        (startBenchmark): Return true if the benchmark actually had started running.
     13        (startTest): Don't transition to the "running" state if the benchmark failed to start (e.g. no tests to run).
     14
    1152017-08-23  Ryosuke Niwa  <rniwa@webkit.org>
    216
  • trunk/PerformanceTests/Speedometer/resources/main.js

    r221045 r221114  
    150150}
    151151
     152function enableOneSuite(suites, suiteToEnable)
     153{
     154    suiteToEnable = suiteToEnable.toLowerCase();
     155    var found = false;
     156    for (var i = 0; i < suites.length; i++) {
     157        var currentSuite = suites[i];
     158        if (currentSuite.name.toLowerCase() == suiteToEnable) {
     159            currentSuite.disabled = false;
     160            found = true;
     161        } else
     162            currentSuite.disabled = true;
     163    }
     164    return found;
     165}
     166
    152167function startBenchmark() {
     168    var enabledSuites = Suites.filter(function (suite) { return !suite.disabled; });
     169
    153170    if (location.search.length > 1) {
    154171        var parts = location.search.substring(1).split('&');
     
    171188                    console.error('Invalid iteration count: ' + value);
    172189                break;
     190            case 'suite':
     191                if (!enableOneSuite(Suites, value)) {
     192                    alert('No tests to run');
     193                    return false;
     194                }
     195                break;
    173196            }
    174197        }
    175198    }
    176199
    177     var enabledSuites = Suites.filter(function (suite) { return !suite.disabled });
     200    var enabledSuites = Suites.filter(function (suite) { return !suite.disabled; });
    178201    var totalSubtestCount = enabledSuites.reduce(function (testsCount, suite) { return testsCount + suite.tests.length; }, 0);
    179202    benchmarkClient.testsCount = benchmarkClient.iterationCount * totalSubtestCount;
     
    181204    var runner = new BenchmarkRunner(Suites, benchmarkClient);
    182205    runner.runMultipleIterations(benchmarkClient.iterationCount);
     206
     207    return true;
    183208}
    184209
     
    206231
    207232function startTest() {
    208     showSection('running');
    209     startBenchmark();
     233    if (startBenchmark())
     234        showSection('running');
    210235}
    211236
Note: See TracChangeset for help on using the changeset viewer.