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

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: once more... 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..f7cca5ada26f23e2dd8e61b016d8148ace074662
--- /dev/null
+++ b/scripts/slave/recipe_modules/properties/test_api.py
@@ -0,0 +1,56 @@
+from slave import recipe_test_api
+
+class PropertiesTestApi(recipe_test_api.RecipeTestApi):
+ def __call__(self, **kwargs):
+ ret = self.test(None)
+ ret.properties.update(kwargs)
+ return ret
+
+ def generic(self, **kwargs):
+ """
+ Merge kwargs into a typical buildbot properties blob, and return the blob.
+ """
+ ret = self(
+ 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