Radish alpha
r
rad:zwTxygwuz5LDGBq255RA2CbNGrz8
Radicle CI broker
Radicle
Git
tests(ci-broker.md): verify that cibtool checks repo exists
Merged liw opened 1 year ago

When adding an event, via “cibtool event add” or “cibtool trigger”, verify the tool checks that the repository the event is for actually exists. The check was already there, this just adds a verification scenario for that.

Signed-off-by: Lars Wirzenius liw@liw.fi

1 file changed +37 -0 40cb793a 2c70b462
modified ci-broker.md
@@ -1051,6 +1051,43 @@ then stdout contains ""state": "finished""
then stdout contains ""result": "failure""
~~~

+
## Don't insert event for non-existent repository
+

+
_Want:_ `cibtool` won't insert an event to the queue for a repository
+
that isn't in the local node.
+

+
_Why:_ This prevents adding events that can't ever trigger a CI run.
+

+
_Who:_ `cib-devs`
+

+
Note that we verify both lookup by name and by repository ID, and by
+
`cibtool event add` and `cibtool trigger`, to cover all the cases.
+

+
~~~scenario
+
given file radenv.sh
+
given file setup-node.sh
+
when I run bash radenv.sh bash setup-node.sh
+

+
given an installed cibtool
+

+
when I try to run bash radenv.sh cibtool --db x.db event add --repo missing --ref main --commit HEAD --base c0ffee
+
then command fails
+
then stderr contains "missing"
+

+
when I try to run bash radenv.sh cibtool --db x.db event add --repo rad:z3byzFpcfbMJBp4tKYyuuTZiP8WUB --ref main --commit HEAD --base c0ffee
+
then command fails
+
then stderr contains "rad:z3byzFpcfbMJBp4tKYyuuTZiP8WUB"
+

+
when I try to run bash radenv.sh cibtool --db x.db trigger --repo missing --ref main --commit HEAD --id-file id.txt
+
then command fails
+
then stderr contains "missing"
+

+
when I try to run bash radenv.sh cibtool --db x.db trigger --repo rad:z3byzFpcfbMJBp4tKYyuuTZiP8WUB --ref main --commit HEAD --id-file id.txt
+
then command fails
+
then stderr contains "rad:z3byzFpcfbMJBp4tKYyuuTZiP8WUB"
+

+
~~~
+

# Acceptance criteria for logging

The CI broker writes log messages to its standard error output