Radish alpha
r
Radicle CI broker
Radicle
Git (anonymous pull)
Log in to clone via SSH
test(ci-broker.md): verify event filter BranchUpdated
Lars Wirzenius committed 1 year ago
commit 791b7cad6d656887799b54366422e68ec2600594
parent bb5cf1273a3aa88f089e7cc938a5044442076368
1 file changed +36 -0
modified ci-broker.md
@@ -909,6 +909,42 @@ triggers:
      - !BranchCreated
~~~

+

+
## Filter predicate `BranchUpdated`
+

+
_Want:_ We can allow an event for a branch having been updated.
+

+
_Why:_ We want to constrain CI to only updated branches, as distinct
+
from new branches.
+

+
~~~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 file config.yaml from filter-branchupdated.yaml
+

+
when I run cibtool --db ci-broker.db event add --repo xyzzy --ref main --commit HEAD --kind branch-updated --base main
+
when I run cibtool --db ci-broker.db event add --repo xyzzy --ref oksa --commit HEAD --kind branch-created
+

+
when I run ./env.sh cib --config config.yaml queued
+

+
when I run cibtool --db ci-broker.db run list --json
+
then stdout contains "main"
+
then stdout doesn't contain "oksa"
+
~~~
+

+
~~~{#filter-branchupdated.yaml .file .json}
+
db: ci-broker.db
+
adapters:
+
  default:
+
    command: ./adapter.sh
+
triggers:
+
  - adapter: default
+
    filters:
+
      - !BranchUpdated
+
~~~
+

+

# Acceptance criteria for test tooling

The event synthesizer is a helper to feed the CI broker node events in