Skip to content

Commit

Permalink
[tools/perf] Fix benchmark smoke tests to not set story_set.stories d…
Browse files Browse the repository at this point in the history
…irectly

Without this fix, catapult roll is blocked (https://codereview.chromium.org/2547293002)
because CL https://codereview.chromium.org/2153513002/ changes story_set.stories
to be a property.

BUG=catapult-project/catapult#2429
TBR=eakuefner@chromium.org

Review-Url: https://codereview.chromium.org/2552543002
Cr-Commit-Position: refs/heads/master@{#436175}
  • Loading branch information
nedn authored and Commit bot committed Dec 3, 2016
1 parent 654417a commit 1b019f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions tools/perf/benchmarks/benchmark_smoke_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ class SinglePageBenchmark(benchmark): # pylint: disable=no-init
def CreateStorySet(self, options):
# pylint: disable=super-on-old-class
story_set = super(SinglePageBenchmark, self).CreateStorySet(options)
for story in story_set.stories:
story_set.stories = [story]
break
# Only smoke test the first story since smoke testing everything takes
# too long.
for s in story_set.stories[1:]:
story_set.RemoveStory(s)
return story_set

# Set the benchmark's default arguments.
Expand Down
7 changes: 5 additions & 2 deletions tools/perf/benchmarks/system_health_smoke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@ class SinglePageBenchmark(benchmark_class): # pylint: disable=no-init
def CreateStorySet(self, options):
# pylint: disable=super-on-old-class
story_set = super(SinglePageBenchmark, self).CreateStorySet(options)
assert story_to_smoke_test in story_set.stories
story_set.stories = [story_to_smoke_test]
stories_to_remove = [s for s in story_set.stories if s !=
story_to_smoke_test]
for s in stories_to_remove:
story_set.RemoveStory(s)
assert story_set.stories
return story_set

options = GenerateBenchmarkOptions(benchmark_class)
Expand Down

0 comments on commit 1b019f5

Please sign in to comment.