Radish alpha
r
Radicle CI broker
Radicle
Git (anonymous pull)
Log in to clone via SSH
tests(ci-broker.md): re-enable all subplot scenarios
Lars Wirzenius committed 2 years ago
commit 5a5e2af108dfc22421c22c218b9c43e76ec06b2a
parent d4ab0af114bba5286f3818746d1f9a17cc8a5d0c
1 file changed +14 -20
modified ci-broker.md
@@ -122,7 +122,7 @@ with open(filename, "w") as f:

# Acceptance criteria

-
<!--  ## Smoke test: Runs adapter
+
## Smoke test: Runs adapter

_Requirement:_ CI broker can run its adapter.

@@ -150,7 +150,7 @@ given file trigger.json
given file shutdown.json
given file set-rid
when I run env HOME=../homedir python3 set-rid trigger.json testy
-
when I run synthetic-events synt.sock trigger.json shutdown.json
+
when I run synthetic-events synt.sock trigger.json shutdown.json --log log.txt

given an installed ci-broker
given file broker.yaml
@@ -158,13 +158,12 @@ given file dummy.sh
when I run chmod +x dummy.sh

when I run sed -i 's/"auto"/false/' homedir/.radicle/config.json
-
when I run env HOME=homedir RAD_HOME=homedir/.radicle RAD_SOCKET=synt.sock RUST_LOG=debug ci-broker broker.yaml
+
when I try to run env HOME=homedir RAD_HOME=homedir/.radicle RAD_SOCKET=synt.sock RUST_LOG=debug ci-broker broker.yaml
then command is successful
~~~

-
-->

-
<!-- ## Gives helpful error message if node socket can't be found
+
## Gives helpful error message if node socket can't be found

_Requirement:_ If the CI broker can't connect to the Radicle node
control socket, it gives an error message that helps the user to
@@ -187,9 +186,7 @@ then command fails
then stderr contains "ERROR: node control socket does not exist: xyzzy.sock"
~~~

-
-->
-

-
<!-- ## Gives helpful error message if it doesn't understand its configuration file
+
## Gives helpful error message if it doesn't understand its configuration file

_Requirement:_ If the CI broker is given a configuration file that it
can't understand, it gives an error message that explains the problem
@@ -222,10 +219,7 @@ then stderr contains "ERROR: failed to parse configuration file as YAML: not-yam
This file is not YAML.
~~~

-
-->
-

-

-
<!-- ## Stops if the node connection breaks
+
## Stops if the node connection breaks

_Requirement:_ If the connection to the Radicle node, via its control
socket, breaks, the CI broker terminates with a message saying why.
@@ -243,18 +237,16 @@ when I run env HOME=homedir RAD_HOME=homedir/.radicle RAD_PASSPHRASE= rad auth -

given an installed ci-broker
given an installed synthetic-events
-
when I run synthetic-events synt.sock
+
when I run synthetic-events synt.sock --log log.txt
given file broker.yaml
when I run sed -i 's/"auto"/false/' homedir/.radicle/config.json
when I try to run env HOME=homedir RAD_HOME=homedir/.radicle RAD_SOCKET=synt.sock ci-broker broker.yaml
-
then command fails
then stderr contains "connection to the node control socket broke"
~~~

-
-->


-
<!-- ## Shuts down when requested
+
## Shuts down when requested

_Requirement:_ The test suite can request the CI broker to shut down
cleanly, and it doesn't result in an error.
@@ -277,15 +269,12 @@ given an installed ci-broker
given an installed synthetic-events
given file shutdown.json
given file broker.yaml
-
when I run synthetic-events synt.sock shutdown.json
-
when I run sed -i 's/"auto"/false/' homedir/.radicle/config.json
+
when I run synthetic-events synt.sock shutdown.json --log synt.log
when I run sed -i 's/"auto"/false/' homedir/.radicle/config.json
when I try to run env RUST_LOG=trace HOME=homedir RAD_HOME=homedir/.radicle RAD_SOCKET=synt.sock ci-broker broker.yaml
then command is successful
~~~

-
-->
-


# Acceptance criteria for test tooling

@@ -326,6 +315,10 @@ changed for other platforms.
Note also that the version of `nc` must support the `-U` option, which
in Debian means using the `netcat-openbsd` package.

+
We sleep for a very short time to make sure the `synthetic-events`
+
daemon has time to remove the socket file before we check that it's
+
been deleted.
+

~~~scenario
given an installed synthetic-events

@@ -335,5 +328,6 @@ when I run synthetic-events synt.sock
then file synt.sock exists

when I run nc -U synt.sock
+
when I run sleep 0.1
then file synt.sock does not exist
~~~