Commit ee6a927d authored by Juan Antonio Navarro Pérez's avatar Juan Antonio Navarro Pérez Committed by Commit Bot

Revert "[Benchmarks] Smoke tests lay groundwork for move to story_filter."

This reverts commit 37d44dbb.

Reason for revert: Catapult roller failing with:

  AttributeError: type object 'StoryFilterFactory' has no attribute '_expectations'
https://chromium-swarm.appspot.com/task?id=47eb08c183837510

Original change's description:
> [Benchmarks] Smoke tests lay groundwork for move to story_filter.
> 
> This change
> https://chromium-review.googlesource.com/c/catapult/+/1839176
> makes it so that expectations config is passed to story_filter.py
> using the project config (sometimes referred to as the
> "environment"). This change lays the groundwork for that future
> change. Until that change is committed, this is a no-op change.
> 
> This change first requires this catapult-side change
> https://chromium-review.googlesource.com/c/catapult/+/1854882
> to make sure that we don't pass an invalid argument to
> GetRunOptions().
> 
> 
> Bug: 985103
> Change-Id: Idd53aaf7f84e792b0d7a7d0db6b45ce0562fb5f4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1854794
> Commit-Queue: Caleb Rouleau <crouleau@chromium.org>
> Reviewed-by: Juan Antonio Navarro Pérez <perezju@chromium.org>
> Reviewed-by: Rakib Hasan <rmhasan@google.com>
> Auto-Submit: Caleb Rouleau <crouleau@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#706080}

TBR=perezju@chromium.org,crouleau@chromium.org,rmhasan@google.com

Change-Id: I9cdcf778d4feaa3ab4d1dd1bd5385b53e99e4f21
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 985103
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1864671Reviewed-by: default avatarJuan Antonio Navarro Pérez <perezju@chromium.org>
Commit-Queue: Juan Antonio Navarro Pérez <perezju@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706332}
parent da8bd010
......@@ -13,8 +13,6 @@ import os
import sys
import unittest
from chrome_telemetry_build import chromium_config
from core import path_util
from telemetry import benchmark as benchmark_module
......@@ -84,17 +82,12 @@ def SmokeTestGenerator(benchmark, num_pages=1):
# Set the benchmark's default arguments.
options = options_for_unittests.GetRunOptions(
output_dir=temp_dir,
benchmark_cls=SinglePageBenchmark,
environment=chromium_config.GetDefaultChromiumConfig())
benchmark_cls=SinglePageBenchmark)
options.pageset_repeat = 1 # For smoke testing only run the page once.
single_page_benchmark = SinglePageBenchmark()
# TODO(crbug.com/985103): Remove this code once
# AugmentExpectationsWithFile is deleted and replaced with functionality
# in story_filter.py.
if hasattr(single_page_benchmark, 'AugmentExpectationsWithFile'):
with open(path_util.GetExpectationsPath()) as fp:
single_page_benchmark.AugmentExpectationsWithFile(fp.read())
with open(path_util.GetExpectationsPath()) as fp:
single_page_benchmark.AugmentExpectationsWithFile(fp.read())
return_code = single_page_benchmark.Run(options)
......
......@@ -9,10 +9,9 @@ cycle time manageable. Other system health benchmarks should be using the same
stories as memory ones, only with fewer actions (no memory dumping).
"""
import collections
import unittest
from chrome_telemetry_build import chromium_config
from collections import defaultdict
from core import path_util
from core import perf_benchmark
......@@ -251,12 +250,8 @@ def _GenerateSmokeTestCase(benchmark_class, story_to_smoke_test):
self.skipTest('Test is explicitly disabled')
single_page_benchmark = SinglePageBenchmark()
# TODO(crbug.com/985103): Remove this code once
# AugmentExpectationsWithFile is deleted and replaced with functionality
# in story_filter.py.
if hasattr(single_page_benchmark, 'AugmentExpectationsWithFile'):
with open(path_util.GetExpectationsPath()) as fp:
single_page_benchmark.AugmentExpectationsWithFile(fp.read())
with open(path_util.GetExpectationsPath()) as fp:
single_page_benchmark.AugmentExpectationsWithFile(fp.read())
return_code = single_page_benchmark.Run(options)
......@@ -280,8 +275,7 @@ def _GenerateSmokeTestCase(benchmark_class, story_to_smoke_test):
def GenerateBenchmarkOptions(output_dir, benchmark_cls):
options = options_for_unittests.GetRunOptions(
output_dir=output_dir, benchmark_cls=benchmark_cls,
environment=chromium_config.GetDefaultChromiumConfig())
output_dir=output_dir, benchmark_cls=benchmark_cls)
options.pageset_repeat = 1 # For smoke testing only run each page once.
# Enable browser logging in the smoke test only. Hopefully, this will detect
......@@ -356,7 +350,7 @@ def find_multi_version_stories(stories, disabled):
A dict mapping from a prefix string to a list of stories each of which
has the name with that prefix and has multiple versions enabled.
"""
prefixes = collections.defaultdict(list)
prefixes = defaultdict(list)
for name in stories:
if name in disabled:
continue
......
......@@ -29,11 +29,3 @@ class ChromiumConfig(project_config.ProjectConfig):
top_level_dir=top_level_dir, benchmark_dirs=benchmark_dirs,
client_configs=client_configs, default_chrome_root=default_chrome_root,
expectations_files=expectations_files)
def GetDefaultChromiumConfig():
return ChromiumConfig(
benchmark_dirs=[path_util.GetOfficialBenchmarksDir(),
path_util.GetContribDir()],
top_level_dir=path_util.GetPerfDir(),
expectations_files=[path_util.GetExpectationsPath()])
......@@ -7,10 +7,16 @@ import sys
from chrome_telemetry_build import chromium_config
from core import benchmark_runner
from core import path_util
def main():
return benchmark_runner.main(chromium_config.GetDefaultChromiumConfig())
config = chromium_config.ChromiumConfig(
benchmark_dirs=[path_util.GetOfficialBenchmarksDir(),
path_util.GetContribDir()],
top_level_dir=path_util.GetPerfDir(),
expectations_files=[path_util.GetExpectationsPath()])
return benchmark_runner.main(config)
if __name__ == '__main__':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment