Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Unified Diff: telemetry/telemetry/story/expectations_unittest.py

Issue 2913383005: [Telemetry] Add temporary disabling of benchmark to story expectations. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « telemetry/telemetry/story/expectations.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/story/expectations_unittest.py
diff --git a/telemetry/telemetry/story/expectations_unittest.py b/telemetry/telemetry/story/expectations_unittest.py
index bef07a91ea1194163957c8066eaf2a035b41aa10..86f84c6fc229619f218cf75b81c771753593c706 100644
--- a/telemetry/telemetry/story/expectations_unittest.py
+++ b/telemetry/telemetry/story/expectations_unittest.py
@@ -294,6 +294,8 @@ class StoryExpectationsTest(unittest.TestCase):
with self.assertRaises(AssertionError):
e.PermanentlyDisableBenchmark(['test'], 'test')
with self.assertRaises(AssertionError):
+ e.TemporarilyDisableBenchmark(['test'], 'test')
+ with self.assertRaises(AssertionError):
e.DisableStory('story', ['platform'], 'reason')
def testPermanentlyDisableBenchmark(self):
@@ -305,12 +307,39 @@ class StoryExpectationsTest(unittest.TestCase):
e = FooExpectations()
self.platform.SetOSName('win')
- reason = e.IsBenchmarkDisabled(self.platform, self.finder_options)
+ reason = e.IsBenchmarkPermanentlyDisabled(
+ self.platform, self.finder_options)
self.assertEqual(reason, 'crbug.com/123')
+ self.assertIsNone(
+ e.IsBenchmarkTemporarilyDisabled(self.platform, self.finder_options))
self.platform.SetOSName('android')
- reason = e.IsBenchmarkDisabled(self.platform, self.finder_options)
- self.assertIsNone(reason)
+ self.assertIsNone(
+ e.IsBenchmarkPermanentlyDisabled(self.platform, self.finder_options))
+ self.assertIsNone(
+ e.IsBenchmarkTemporarilyDisabled(self.platform, self.finder_options))
+
+ def testTemporarilyDisableBenchmark(self):
+ class FooExpectations(expectations.StoryExpectations):
+ def SetExpectations(self):
+ self.TemporarilyDisableBenchmark(
+ [expectations.ALL_WIN], 'crbug.com/123')
+
+ e = FooExpectations()
+ self.platform.SetOSName('win')
+
+ reason = e.IsBenchmarkTemporarilyDisabled(
+ self.platform, self.finder_options)
+ self.assertEqual(reason, 'crbug.com/123')
+ self.assertIsNone(
+ e.IsBenchmarkPermanentlyDisabled(self.platform, self.finder_options))
+
+ self.platform.SetOSName('android')
+ self.assertIsNone(
+ e.IsBenchmarkTemporarilyDisabled(self.platform, self.finder_options))
+ self.assertIsNone(
+ e.IsBenchmarkPermanentlyDisabled(self.platform, self.finder_options))
+
def testDisableStoryMultipleConditions(self):
class FooExpectations(expectations.StoryExpectations):
« no previous file with comments | « telemetry/telemetry/story/expectations.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698