| |
~~~
|
| |
|
| |
|
| - |
## Shuts down when requested
|
| + |
## Can shut down cleanly
|
| |
|
| - |
_Want:_ The test suite can request the CI broker to shut down
|
| - |
cleanly, and it doesn't result in an error.
|
| + |
_Want:_ The node operator can instrut the running CI broker to shut down after
|
| + |
currently executing runs finish.
|
| |
|
| - |
_Why:_ In the integration test suite, we need to start and
|
| - |
stop the CI broker many times. We need to easily detect errors.
|
| + |
_Why:_This is useful for both the CI broker test suite and for operators to
|
| + |
shut down service for maintenance.
|
| |
|
| - |
_Who:_ `cib-devs`
|
| + |
_Who:_ `cib-devs`, `node-ops`
|
| |
|
| - |
We use a special magic fake node event to signal shutdown: a
|
| - |
`RefsFetched` event with a skipped update for a ref "`shutdown`" and
|
| - |
an object id of all zeros. This should be sufficiently impossible to
|
| - |
happen in real life.
|
| + |
We verify this by starting a relatively long-running CI run and also telling
|
| + |
`cib` to shut down, and then verifying the CI run finished successfully.
|
| |
|
| |
~~~scenario
|
| |
given a Radicle node, with CI configured with broker.yaml and adapter dummy.sh
|
| |
given a Git repository xyzzy in the Radicle node
|
| - |
given the Radicle node emits a refsUpdated event for xyzzy
|
| - |
when I run ./env.sh synthetic-events synt.sock event.json --log log.txt
|
| - |
when I try to run ./env.sh cib --config broker.yaml insert
|
| + |
when I run cibtool --db ci-broker.db trigger --repo xyzzy --commit HEAD
|
| + |
when I run cibtool --db ci-broker.db event shutdown
|
| + |
when I try to run ./env.sh cib --config broker.yaml queued
|
| |
then command is successful
|
| - |
when I run cibtool --db ci-broker.db run list
|
| - |
then stdout is empty
|
| + |
when I run cibtool --db ci-broker.db run list --json
|
| + |
then stdout contains "success"
|
| |
~~~
|
| |
|
| |
|