refactor(dev-infra): simplify runBenchmark (#38941)

* Make url and params optional in runBenchmark
* Make url optional in openBrowser
* Remove unused code from runBenchmark

PR Close #38941
This commit is contained in:
Wagner Maciel 2020-09-22 10:27:18 -07:00 committed by Misko Hevery
parent 75610505c6
commit b1682526dd
2 changed files with 3 additions and 5 deletions

View File

@ -13,7 +13,7 @@ import * as webdriver from 'selenium-webdriver';
declare var expect: any; declare var expect: any;
export function openBrowser(config: { export function openBrowser(config: {
url: string, url?: string,
params?: {name: string, value: any}[], params?: {name: string, value: any}[],
ignoreBrowserSynchronization?: boolean ignoreBrowserSynchronization?: boolean
}) { }) {

View File

@ -34,8 +34,8 @@ export async function runBenchmark({
setup, setup,
}: { }: {
id: string, id: string,
url: string, url?: string,
params: {name: string, value: any}[], params?: {name: string, value: any}[],
ignoreBrowserSynchronization?: boolean, ignoreBrowserSynchronization?: boolean,
microMetrics?: {[key: string]: string}, microMetrics?: {[key: string]: string},
work?: (() => void)|(() => Promise<unknown>), work?: (() => void)|(() => Promise<unknown>),
@ -46,8 +46,6 @@ export async function runBenchmark({
if (setup) { if (setup) {
await setup(); await setup();
} }
const description: {[key: string]: any} = {};
params.forEach((param) => description[param.name] = param.value);
return runner.sample({ return runner.sample({
id, id,
execute: work, execute: work,