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:
parent
75610505c6
commit
b1682526dd
|
@ -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
|
||||||
}) {
|
}) {
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue