From 605013533be3234413b25d0a96a3c00bb88cf316 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 24 Feb 2014 11:21:46 +0000 Subject: First step for /1.0/give-me-job --- lorry-controller-webapp | 10 ++++++++++ yarns.webapp/040-running-jobs.yarn | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 yarns.webapp/040-running-jobs.yarn 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 -- cgit v1.2.1