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

Unified Diff: dashboard/dashboard/add_histograms_test.py

Issue 2999663002: Revert of Revision Info into GenericSet (Closed)
Patch Set: Created 3 years, 4 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 | « dashboard/dashboard/add_histograms_queue_test.py ('k') | docs/histogram-set-json-format.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/add_histograms_test.py
diff --git a/dashboard/dashboard/add_histograms_test.py b/dashboard/dashboard/add_histograms_test.py
index 9bc5c16b09f62b709709675622853ef92edd9ffb..1d5c9dbb8459b77d8a5077dfeb9857a28963f8dc 100644
--- a/dashboard/dashboard/add_histograms_test.py
+++ b/dashboard/dashboard/add_histograms_test.py
@@ -21,7 +21,6 @@
from dashboard.models import histogram
from tracing.value import histogram as histogram_module
from tracing.value import histogram_set
-from tracing.value.diagnostics import reserved_infos
GOOGLER_USER = users.User(email='sullivan@chromium.org',
@@ -60,9 +59,15 @@
'storyDisplayName': 'story',
'type': 'TelemetryInfo'
}, {
- 'values': [424242],
+ 'angle': [],
+ 'catapult': [],
+ 'chromium': [],
+ 'chromiumCommitPosition': [424242],
'guid': '25f0a111-9bb4-4cea-b0c1-af2609623160',
- 'type': 'GenericSet',
+ 'skia': [],
+ 'type': 'RevisionInfo',
+ 'v8': [],
+ 'webrtc': []
}, {
'buildNumber': 0,
'buildbotMasterName': '',
@@ -76,8 +81,7 @@
'binBoundaries': [1, [1, 1000, 20]],
'diagnostics': {
'buildbot': 'e9c2891d-2b04-413f-8cf4-099827e67626',
- reserved_infos.CHROMIUM_COMMIT_POSITIONS.name:
- '25f0a111-9bb4-4cea-b0c1-af2609623160',
+ 'revisions': '25f0a111-9bb4-4cea-b0c1-af2609623160',
'telemetry': '0bc1021b-8107-4db7-bc8c-49d7cf53c5ae'
},
'guid': '2a714c36-f4ef-488d-8bee-93c7e3149388',
@@ -89,6 +93,7 @@
self.ExecuteTaskQueueTasks('/add_histograms_queue',
add_histograms.TASK_QUEUE_NAME)
diagnostics = histogram.SparseDiagnostic.query().fetch()
+ # We expect to see BuildbotInfo/TelemetryInfo, RevisionInfo is inlined.
self.assertEqual(2, len(diagnostics))
histograms = histogram.Histogram.query().fetch()
self.assertEqual(1, len(histograms))
@@ -127,9 +132,15 @@
'storyDisplayName': 'story',
'type': 'TelemetryInfo'
}, {
- 'values': [424242],
+ 'angle': [],
+ 'catapult': [],
+ 'chromium': [],
+ 'chromiumCommitPosition': [424242],
'guid': '25f0a111-9bb4-4cea-b0c1-af2609623160',
- 'type': 'GenericSet',
+ 'skia': [],
+ 'type': 'RevisionInfo',
+ 'v8': [],
+ 'webrtc': []
}, {
'buildNumber': 0,
'buildbotMasterName': '',
@@ -143,8 +154,7 @@
'binBoundaries': [1, [1, 1000, 20]],
'diagnostics': {
'buildbot': 'e9c2891d-2b04-413f-8cf4-099827e67626',
- reserved_infos.CHROMIUM_COMMIT_POSITIONS.name:
- '25f0a111-9bb4-4cea-b0c1-af2609623160',
+ 'revisions': '25f0a111-9bb4-4cea-b0c1-af2609623160',
'telemetry': '0bc1021b-8107-4db7-bc8c-49d7cf53c5ae'
},
'guid': '4989617a-14d6-4f80-8f75-dafda2ff13b0',
@@ -154,8 +164,7 @@
'binBoundaries': [1, [1, 1000, 20]],
'diagnostics': {
'buildbot': 'e9c2891d-2b04-413f-8cf4-099827e67626',
- reserved_infos.CHROMIUM_COMMIT_POSITIONS.name:
- '25f0a111-9bb4-4cea-b0c1-af2609623160',
+ 'revisions': '25f0a111-9bb4-4cea-b0c1-af2609623160',
'telemetry': '0bc1021b-8107-4db7-bc8c-49d7cf53c5ae'
},
'guid': '2a714c36-f4ef-488d-8bee-93c7e3149388',
@@ -191,9 +200,15 @@
'storyDisplayName': 'story',
'type': 'TelemetryInfo'
}, {
- 'values': [424242],
+ 'angle': [],
+ 'catapult': [],
+ 'chromium': [],
+ 'chromiumCommitPosition': [424242],
'guid': '25f0a111-9bb4-4cea-b0c1-af2609623160',
- 'type': 'GenericSet',
+ 'skia': [],
+ 'type': 'RevisionInfo',
+ 'v8': [],
+ 'webrtc': []
}, {
'buildNumber': 0,
'buildbotMasterName': '',
@@ -207,8 +222,7 @@
'binBoundaries': [1, [1, 1000, 20]],
'diagnostics': {
'buildbot': 'e9c2891d-2b04-413f-8cf4-099827e67626',
- reserved_infos.CHROMIUM_COMMIT_POSITIONS.name:
- '25f0a111-9bb4-4cea-b0c1-af2609623160',
+ 'revisions': '25f0a111-9bb4-4cea-b0c1-af2609623160',
'telemetry': '0bc1021b-8107-4db7-bc8c-49d7cf53c5ae'
},
'guid': '4989617a-14d6-4f80-8f75-dafda2ff13b0',
@@ -218,8 +232,7 @@
'binBoundaries': [1, [1, 1000, 20]],
'diagnostics': {
'buildbot': 'e9c2891d-2b04-413f-8cf4-099827e67626',
- reserved_infos.CHROMIUM_COMMIT_POSITIONS.name:
- '25f0a111-9bb4-4cea-b0c1-af2609623160',
+ 'revisions': '25f0a111-9bb4-4cea-b0c1-af2609623160',
'telemetry': '0bc1021b-8107-4db7-bc8c-49d7cf53c5ae'
},
'guid': '2a714c36-f4ef-488d-8bee-93c7e3149388',
@@ -262,9 +275,15 @@
'storyDisplayName': 'story',
'type': 'TelemetryInfo'
}, {
- 'values': [424242],
+ 'angle': [],
+ 'catapult': [],
+ 'chromium': [],
+ 'chromiumCommitPosition': [424242],
'guid': '25f0a111-9bb4-4cea-b0c1-af2609623160',
- 'type': 'GenericSet',
+ 'skia': [],
+ 'type': 'RevisionInfo',
+ 'v8': [],
+ 'webrtc': []
}, {
'buildNumber': 0,
'buildbotMasterName': '',
@@ -278,8 +297,7 @@
'binBoundaries': [1, [1, 1000, 20]],
'diagnostics': {
'buildbot': 'e9c2891d-2b04-413f-8cf4-099827e67626',
- reserved_infos.CHROMIUM_COMMIT_POSITIONS.name:
- '25f0a111-9bb4-4cea-b0c1-af2609623160',
+ 'revisions': '25f0a111-9bb4-4cea-b0c1-af2609623160',
'telemetry': '0bc1021b-8107-4db7-bc8c-49d7cf53c5ae'
},
'guid': '4989617a-14d6-4f80-8f75-dafda2ff13b0',
@@ -323,9 +341,15 @@
'storyDisplayName': 'story',
'type': 'TelemetryInfo'
}, {
- 'values': [424242],
+ 'angle': [],
+ 'catapult': [],
+ 'chromium': [],
+ 'chromiumCommitPosition': [424242],
'guid': '25f0a111-9bb4-4cea-b0c1-af2609623160',
- 'type': 'GenericSet',
+ 'skia': [],
+ 'type': 'RevisionInfo',
+ 'v8': [],
+ 'webrtc': []
}, {
'buildNumber': 0,
'buildbotMasterName': '',
@@ -339,8 +363,7 @@
'binBoundaries': [1, [1, 1000, 20]],
'diagnostics': {
'buildbot': 'e9c2891d-2b04-413f-8cf4-099827e67626',
- reserved_infos.CHROMIUM_COMMIT_POSITIONS.name:
- '25f0a111-9bb4-4cea-b0c1-af2609623160',
+ 'revisions': '25f0a111-9bb4-4cea-b0c1-af2609623160',
'telemetry': '0bc1021b-8107-4db7-bc8c-49d7cf53c5ae'
},
'guid': '4989617a-14d6-4f80-8f75-dafda2ff13b0',
@@ -393,14 +416,19 @@
'storyDisplayName': 'story',
'type': 'TelemetryInfo'
}, {
- 'values': [424242],
+ 'angle': [],
+ 'catapult': [],
+ 'chromium': [],
+ 'chromiumCommitPosition': [424242],
'guid': '25f0a111-9bb4-4cea-b0c1-af2609623160',
- 'type': 'GenericSet',
- }, {
- 'binBoundaries': [1, [1, 1000, 20]],
- 'diagnostics': {
- reserved_infos.CHROMIUM_COMMIT_POSITIONS.name:
- '25f0a111-9bb4-4cea-b0c1-af2609623160',
+ 'skia': [],
+ 'type': 'RevisionInfo',
+ 'v8': [],
+ 'webrtc': []
+ }, {
+ 'binBoundaries': [1, [1, 1000, 20]],
+ 'diagnostics': {
+ 'revisions': '25f0a111-9bb4-4cea-b0c1-af2609623160',
'telemetry': '0bc1021b-8107-4db7-bc8c-49d7cf53c5ae'
},
'guid': '4989617a-14d6-4f80-8f75-dafda2ff13b0',
@@ -410,7 +438,7 @@
])
self.testapp.post('/add_histograms', {'data': data}, status=400)
- def testPostHistogramFailsWithoutChromiumCommit(self):
+ def testPostHistogramFailsWithoutRevisionInfo(self):
data = json.dumps([
{
'benchmarkName': 'benchmark',
@@ -444,9 +472,15 @@
def testPostHistogramFailsWithoutTelemetryInfo(self):
data = json.dumps([
{
- 'values': [424242],
+ 'angle': [],
+ 'catapult': [],
+ 'chromium': [],
+ 'chromiumCommitPosition': [424242],
'guid': '25f0a111-9bb4-4cea-b0c1-af2609623160',
- 'type': 'GenericSet',
+ 'skia': [],
+ 'type': 'RevisionInfo',
+ 'v8': [],
+ 'webrtc': []
}, {
'buildNumber': 0,
'buildbotMasterName': '',
@@ -460,8 +494,7 @@
'binBoundaries': [1, [1, 1000, 20]],
'diagnostics': {
'buildbot': 'e9c2891d-2b04-413f-8cf4-099827e67626',
- reserved_infos.CHROMIUM_COMMIT_POSITIONS.name:
- '25f0a111-9bb4-4cea-b0c1-af2609623160'
+ 'revisions': '25f0a111-9bb4-4cea-b0c1-af2609623160'
},
'guid': '4989617a-14d6-4f80-8f75-dafda2ff13b0',
'name': 'foo',
@@ -520,17 +553,19 @@
def testComputeRevision(self):
hist = histogram_module.Histogram('hist', 'count')
histograms = histogram_set.HistogramSet([hist])
- chromium_commit = histogram_module.GenericSet([424242])
- histograms.AddSharedDiagnostic(
- reserved_infos.CHROMIUM_COMMIT_POSITIONS.name, chromium_commit)
+ revision_info = histogram_module.RevisionInfo({
+ 'chromiumCommitPosition': [424242]
+ })
+ histograms.AddSharedDiagnostic('revisions', revision_info)
self.assertEqual(424242, add_histograms.ComputeRevision(histograms))
def testComputeRevision_RaisesOnError(self):
hist = histogram_module.Histogram('hist', 'count')
histograms = histogram_set.HistogramSet([hist])
- chromium_commit = histogram_module.GenericSet([424242, 0])
- histograms.AddSharedDiagnostic(
- reserved_infos.CHROMIUM_COMMIT_POSITIONS.name, chromium_commit)
+ revision_info = histogram_module.RevisionInfo({
+ 'chromiumCommitPosition': 424242
+ })
+ histograms.AddSharedDiagnostic('revisions', revision_info)
with self.assertRaises(api_request_handler.BadRequestError):
add_histograms.ComputeRevision(histograms)
« no previous file with comments | « dashboard/dashboard/add_histograms_queue_test.py ('k') | docs/histogram-set-json-format.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698