summaryrefslogtreecommitdiff
path: root/yarns.webapp/040-running-jobs.yarn
blob: 8d35ab0c2e9f187a669f0c6a94b1ec27b90d244d (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
30
31
32
33
34
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"

Requesting another job should now again return null.

    WHEN admin makes request GET /1.0/give-me-job
    THEN response has job-id set to null