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

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

Issue 1815413002: Add support for patch_url field in BuildEvent (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Added test Created 4 years, 9 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 | « infra_libs/event_mon/monitoring.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 76fe8670fbef3102e1ceecce9d7cd50db33bc6ed..597bb8e543a865cee9b199e8f180b47a501f85fe 100644
--- a/infra_libs/event_mon/test/monitoring_test.py
+++ b/infra_libs/event_mon/test/monitoring_test.py
@@ -302,6 +302,17 @@ class GetBuildEventTest(unittest.TestCase):
self.assertEquals(event.build_event.host_name, hostname)
self.assertEquals(event.build_event.build_name, build_name)
+ def test_get_build_event_with_patch_url(self):
+ patch_url = 'http://foo.bar/123#456'
+ log_event = monitoring.get_build_event(
+ 'BUILD', 'bot.host.name', 'build_name', patch_url=patch_url).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.patch_url, patch_url)
+
def test_get_build_event_invalid_type(self):
# An invalid type is a critical error.
log_event = monitoring.get_build_event('INVALID_TYPE',
« no previous file with comments | « infra_libs/event_mon/monitoring.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698