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

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: License headers 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
« no previous file with comments | « scripts/slave/recipe_modules/platform/test_api.py ('k') | scripts/slave/recipe_modules/python/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..fefa897db30870b22522a32dff965da41da361c3
--- /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://codereview.chromium.org',
+ root='src',
+ )
+ ret.properties.update(kwargs)
+ return ret
« no previous file with comments | « scripts/slave/recipe_modules/platform/test_api.py ('k') | scripts/slave/recipe_modules/python/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698