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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
Run queue management
====================
This chapter contains tests meant for managing the run-queue in
WEBAPP.
Start and stop job scheduling
-----------------------------
The administrator needs to be able to stop WEBAPP from scheduling any
new jobs, and later to start it again.
SCENARIO admin can start and stop WEBAPP job scheduling
GIVEN a running WEBAPP
WHEN admin makes request GET /1.0/status
THEN response has running-queue set to false
WHEN admin makes request GET /1.0/start-queue
AND admin makes request GET /1.0/status
THEN response has running-queue set to true
Further, the state change needs to be persistent across WEBAPP
instances, so we kill the WEBAPP that's currently running, and start a
new one, and verify that the `running-queue` status is still `true`.
WHEN WEBAPP is terminated
THEN WEBAPP isn't running
GIVEN a running WEBAPP
WHEN admin makes request GET /1.0/status
THEN response has running-queue set to true
Finally, clean up.
FINALLY WEBAPP terminates
Read CONFGIT
------------
We need to be able to get Lorry Controller, specifically WEBAPP, to
update its configuration and run-queue from CONFGIT using the
`/1.0/read-configuration` HTTP API request.
First, set up WEBAPP.
SCENARIO WEBAPP updates its configuration from CONFGIT
GIVEN a new git repository in CONFGIT
AND WEBAPP uses CONFGIT as its configuration directory
AND a running WEBAPP
We'll start with an empty configuration. This is the default state
when WEBAPP has never read its configuration.
WHEN admin makes request GET /1.0/list-queue
THEN response has queue set to []
Make WEBAPP read an empty configuration. Or rather, a configuration
that does not match any existing `.lorry` files.
GIVEN an empty lorry-controller.conf in CONFGIT
WHEN admin makes request GET /1.0/read-configuration
AND admin makes request GET /1.0/list-queue
THEN response has queue set to []
Add a `.lorry` file, with one Lorry spec, and make sure reading the
configuration makes `/list-queue` report it.
GIVEN Lorry file CONFGIT/foo.lorry with {"foo":{"type":"git","url":"git://foo"}}
AND lorry-controller.conf in CONFGIT adds lorries *.lorry using prefix upstream
WHEN admin makes request GET /1.0/read-configuration
AND admin makes request GET /1.0/list-queue
THEN response has queue set to ["upstream/foo"]
If the `.lorry` file is removed, the queue should again become empty.
GIVEN file CONFGIT/foo.lorry is removed
WHEN admin makes request GET /1.0/read-configuration
AND admin makes request GET /1.0/list-queue
THEN response has queue set to []
Finally, clean up.
FINALLY WEBAPP terminates
|