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

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: Move gclient test_api to got_revisions cl 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..ccae3ce0ebddc53a449afe6284b2a67623fb816b
--- /dev/null
+++ b/scripts/slave/recipe_modules/properties/test_api.py
@@ -0,0 +1,52 @@
+from slave import recipe_api
+
+class PropertiesTestApi(recipe_api.RecipeTestApi):
+ @staticmethod
+ def generic(**kwargs):
+ """
+ Merge kwargs into a typical buildbot properties blob, and return the blob.
+ """
+ ret = {
+ '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.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.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.update(kwargs)
+ return ret

Powered by Google App Engine
This is Rietveld 408576698