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

Unified Diff: infra_libs/event_mon/test/monitoring_test.py

Issue 2041103004: Report buildbucket ID for all builds (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Fix Created 4 years, 6 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
Index: infra_libs/event_mon/test/monitoring_test.py
diff --git a/infra_libs/event_mon/test/monitoring_test.py b/infra_libs/event_mon/test/monitoring_test.py
index 2fb67437c05445ff7460970cf6e74306800b373f..055122ba5c2314b093dc27c360fc5118630b9257 100644
--- a/infra_libs/event_mon/test/monitoring_test.py
+++ b/infra_libs/event_mon/test/monitoring_test.py
@@ -313,6 +313,21 @@ class GetBuildEventTest(unittest.TestCase):
self.assertTrue(event.HasField('build_event'))
self.assertEquals(event.build_event.patch_url, patch_url)
+ def test_get_build_event_with_bbucket_id(self):
+ log_event = monitoring.get_build_event(
+ 'BUILD', 'bot.host.name', 'build_name', bbucket_id=123).log_event()
+ self.assertIsInstance(log_event, LogRequestLite.LogEventLite)
+
+ # Check that source_extension deserializes to the right thing.
+ event = ChromeInfraEvent.FromString(log_event.source_extension)
+ self.assertTrue(event.HasField('build_event'))
+ self.assertEquals(event.build_event.bbucket_id, 123)
+
+ # Try invalid value. This should not throw any exceptions.
+ log_event = monitoring.get_build_event(
+ 'BUILD', 'bot.host.name', 'build_name', bbucket_id='foo').log_event()
+ self.assertIsInstance(log_event, LogRequestLite.LogEventLite)
+
def test_get_build_event_invalid_type(self):
# An invalid type is a critical error.
log_event = monitoring.get_build_event('INVALID_TYPE',
« infra/tools/send_monitoring_event/send_event.py ('K') | « infra_libs/event_mon/monitoring.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698