summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-02-24 11:21:46 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-02-24 11:21:46 +0000
commit605013533be3234413b25d0a96a3c00bb88cf316 (patch)
tree508f7deb34f40009220e2056cace4f4a54a69165
parent5a5f9d6b84a4c3bbb11a8caa93c42cb7a15feb3e (diff)
downloadlorry-controller-605013533be3234413b25d0a96a3c00bb88cf316.tar.gz
First step for /1.0/give-me-job
-rwxr-xr-xlorry-controller-webapp10
-rw-r--r--yarns.webapp/040-running-jobs.yarn19
2 files changed, 29 insertions, 0 deletions
diff --git a/lorry-controller-webapp b/lorry-controller-webapp
index 759b0a9..000ded3 100755
--- a/lorry-controller-webapp
+++ b/lorry-controller-webapp
@@ -350,6 +350,16 @@ class StopQueue(LorryControllerRoute):
return 'Queue set to not run'
+class GiveMeJob(LorryControllerRoute):
+
+ http_method = 'GET'
+ path = '/1.0/give-me-job'
+
+ def run(self, **kwargs):
+ logging.debug('%s %s called', self.http_method, self.path)
+ return { 'job-id': None }
+
+
class WEBAPP(cliapp.Application):
def add_settings(self):
diff --git a/yarns.webapp/040-running-jobs.yarn b/yarns.webapp/040-running-jobs.yarn
new file mode 100644
index 0000000..ad70d28
--- /dev/null
+++ b/yarns.webapp/040-running-jobs.yarn
@@ -0,0 +1,19 @@
+Running jobs
+============
+
+This chapter contains tests that verify that WEBAPP schedules jobs,
+accepts job output, and lets the admin kill running jobs.
+
+
+Schedule a job
+--------------
+
+To start with, with an empty run-queue, nothing should be scheduled.
+
+ SCENARIO job scheduling
+ GIVEN a new git repository in CONFGIT
+ AND WEBAPP uses CONFGIT as its configuration directory
+ AND a running WEBAPP
+
+ WHEN admin makes request GET /1.0/give-me-job
+ THEN response has job-id set to null