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

Unified Diff: scripts/slave/recipe_modules/properties/test_api.py

Issue 23889036: Refactor the way that TestApi works so that it is actually useful. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: rebase Created 7 years, 3 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: scripts/slave/recipe_modules/properties/test_api.py
diff --git a/scripts/slave/recipe_modules/properties/test_api.py b/scripts/slave/recipe_modules/properties/test_api.py
new file mode 100644
index 0000000000000000000000000000000000000000..8084263b5be91c0ff181e436f7455412cd40d8fd
--- /dev/null
+++ b/scripts/slave/recipe_modules/properties/test_api.py
@@ -0,0 +1,51 @@
+from slave import recipe_test_api
+
+class PropertiesTestApi(recipe_test_api.RecipeTestApi):
+ def generic(self, **kwargs):
+ """
+ Merge kwargs into a typical buildbot properties blob, and return the blob.
+ """
+ ret = self.Properties(
+ blamelist='cool_dev1337@chromium.org,hax@chromium.org',
+ blamelist_real=['cool_dev1337@chromium.org', 'hax@chromium.org'],
+ buildername='TestBuilder',
+ buildnumber=571,
+ mastername='chromium.testing.master',
+ slavename='TestSlavename',
+ workdir='/path/to/workdir/TestSlavename',
+ )
+ ret.properties.update(kwargs)
+ return ret
+
+ def scheduled(self, **kwargs):
+ """
+ Merge kwargs into a typical buildbot properties blob for a job fired off
+ by a chrome/trunk svn scheduler, and return the blob.
+ """
+ ret = self.generic(
+ branch='TestBranch',
+ project='',
+ repository='svn://svn-mirror.golo.chromium.org/chrome/trunk',
+ revision='204787',
+ )
+ ret.properties.update(kwargs)
+ return ret
+
+ def tryserver(self, **kwargs):
+ """
+ Merge kwargs into a typical buildbot properties blob for a job fired off
+ by a rietveld tryjob on the tryserver, and return the blob.
+ """
+ ret = self.generic(
+ branch='',
+ issue=12853011,
+ patchset=1,
+ project='chrome',
+ repository='',
+ requester='commit-bot@chromium.org',
+ revision='HEAD',
+ rietveld='https://chromiumcodereview.appspot.com',
+ root='src',
+ )
+ ret.properties.update(kwargs)
+ return ret

Powered by Google App Engine
This is Rietveld 408576698