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

Unified Diff: telemetry/telemetry/internal/story_runner_unittest.py

Issue 2977283002: Ownership into GenericSets (Closed)
Patch Set: Fix tests after reabse Created 3 years, 5 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/internal/story_runner.py ('k') | tracing/trace_viewer.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/internal/story_runner_unittest.py
diff --git a/telemetry/telemetry/internal/story_runner_unittest.py b/telemetry/telemetry/internal/story_runner_unittest.py
index ade1b34ea3d5d4a6f606dd8ee5c9c37597bd903e..6b28913e5854001243d877ac2ba8a04f1588c775 100644
--- a/telemetry/telemetry/internal/story_runner_unittest.py
+++ b/telemetry/telemetry/internal/story_runner_unittest.py
@@ -1193,7 +1193,7 @@ class StoryRunnerTest(unittest.TestCase):
finally:
shutil.rmtree(temp_path)
- def testRunBenchmark_AddsOwnership_WithoutComponent(self):
+ def testRunBenchmark_AddsOwners_NoComponent(self):
@benchmark.Owner(emails=['alice@chromium.org'])
class FakeBenchmarkWithOwner(FakeBenchmark):
def __init__(self):
@@ -1215,20 +1215,20 @@ class StoryRunnerTest(unittest.TestCase):
hs = histogram_set.HistogramSet()
hs.ImportDicts(data)
- ownership_diagnostics = hs.GetSharedDiagnosticsOfType(
- histogram_module.Ownership)
+ generic_diagnostics = hs.GetSharedDiagnosticsOfType(
+ histogram_module.GenericSet)
- self.assertGreater(len(ownership_diagnostics), 0)
+ self.assertGreater(len(generic_diagnostics), 0)
- ownership_diagnostic = ownership_diagnostics[0]
+ generic_diagnostics_values = [
+ list(diagnostic) for diagnostic in generic_diagnostics]
+
+ self.assertIn(['alice@chromium.org'], generic_diagnostics_values)
- self.assertIsInstance(ownership_diagnostic, histogram_module.Ownership)
- self.assertIsNone(ownership_diagnostic.component)
- self.assertItemsEqual(['alice@chromium.org'], ownership_diagnostic.emails)
finally:
shutil.rmtree(temp_path)
- def testRunBenchmark_AddsOwnership_WithComponent(self):
+ def testRunBenchmark_AddsComponent(self):
@benchmark.Owner(emails=['alice@chromium.org', 'bob@chromium.org'],
component='fooBar')
class FakeBenchmarkWithOwner(FakeBenchmark):
@@ -1251,17 +1251,18 @@ class StoryRunnerTest(unittest.TestCase):
hs = histogram_set.HistogramSet()
hs.ImportDicts(data)
- ownership_diagnostics = hs.GetSharedDiagnosticsOfType(
- histogram_module.Ownership)
+ generic_diagnostics = hs.GetSharedDiagnosticsOfType(
+ histogram_module.GenericSet)
+
+ self.assertGreater(len(generic_diagnostics), 0)
- self.assertGreater(len(ownership_diagnostics), 0)
+ generic_diagnostics_values = [
+ list(diagnostic) for diagnostic in generic_diagnostics]
- ownership_diagnostic = ownership_diagnostics[0]
+ self.assertIn(['fooBar'], generic_diagnostics_values)
+ self.assertIn(['alice@chromium.org', 'bob@chromium.org'],
+ generic_diagnostics_values)
- self.assertIsInstance(ownership_diagnostic, histogram_module.Ownership)
- self.assertEqual('fooBar', ownership_diagnostic.component)
- self.assertItemsEqual(['alice@chromium.org', 'bob@chromium.org'],
- ownership_diagnostic.emails)
finally:
shutil.rmtree(temp_path)
« no previous file with comments | « telemetry/telemetry/internal/story_runner.py ('k') | tracing/trace_viewer.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698