summaryrefslogtreecommitdiff
path: root/yarns.webapp/040-running-jobs.yarn
blob: ea5b72e88aba98f4641f31c9063f3130143ca1e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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 an empty lorry-controller.conf in CONFGIT
    AND lorry-controller.conf in CONFGIT adds lorries *.lorry using prefix upstream
    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

Add a Lorry spec to the run-queue, and request a job. We should get
that job now.

    GIVEN Lorry file CONFGIT/foo.lorry with {"foo":{"type":"git","url":"git://foo"}}
    WHEN admin makes request GET /1.0/read-configuration
    AND admin makes request GET /1.0/give-me-job
    THEN response has job-id set to "upstream/foo"