From b1682526ddcbde922d07b07d82727366ddf5bf00 Mon Sep 17 00:00:00 2001 From: Wagner Maciel Date: Tue, 22 Sep 2020 10:27:18 -0700 Subject: [PATCH] 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 --- dev-infra/benchmark/driver-utilities/e2e_util.ts | 2 +- dev-infra/benchmark/driver-utilities/perf_util.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/dev-infra/benchmark/driver-utilities/e2e_util.ts b/dev-infra/benchmark/driver-utilities/e2e_util.ts index 55d21fa96c..3b391f26e4 100644 --- a/dev-infra/benchmark/driver-utilities/e2e_util.ts +++ b/dev-infra/benchmark/driver-utilities/e2e_util.ts @@ -13,7 +13,7 @@ import * as webdriver from 'selenium-webdriver'; declare var expect: any; export function openBrowser(config: { - url: string, + url?: string, params?: {name: string, value: any}[], ignoreBrowserSynchronization?: boolean }) { diff --git a/dev-infra/benchmark/driver-utilities/perf_util.ts b/dev-infra/benchmark/driver-utilities/perf_util.ts index 8d0aa8c569..b6d59a4a1d 100644 --- a/dev-infra/benchmark/driver-utilities/perf_util.ts +++ b/dev-infra/benchmark/driver-utilities/perf_util.ts @@ -34,8 +34,8 @@ export async function runBenchmark({ setup, }: { id: string, - url: string, - params: {name: string, value: any}[], + url?: string, + params?: {name: string, value: any}[], ignoreBrowserSynchronization?: boolean, microMetrics?: {[key: string]: string}, work?: (() => void)|(() => Promise), @@ -46,8 +46,6 @@ export async function runBenchmark({ if (setup) { await setup(); } - const description: {[key: string]: any} = {}; - params.forEach((param) => description[param.name] = param.value); return runner.sample({ id, execute: work,