Radish alpha
r
Radicle CI broker
Radicle
Git (anonymous pull)
Log in to clone via SSH
test: document and test step to construct a refsFetched event
Lars Wirzenius committed 1 year ago
commit 45129128043f732cac0370be218c39f25774cf06
parent 4589438f46c47c9f0f4c5df5fc2a76c596737517
1 file changed +39 -0
modified ci-broker.md
@@ -312,6 +312,10 @@ repository.

> `given a Git repository {name} in the Radicle node`

+
The captured part of the step is:
+

+
* `name` — the Git and Radicle repository name
+

We run the step and look at the results. We need the node creation
step first.

@@ -336,6 +340,41 @@ when I run ./env.sh rad ls --all
then stdout contains "reppy"
~~~

+
## Queue a node event for processing
+

+
This step queues a node event to be processed later by the
+
`synthetic-events` test helper tool that is part of the CI broker. The
+
step does this by creating a fake `refsUpdated` node event and writing
+
that to file with a specific name.
+

+
> `given the Radicle node emits a refsUpdated event for {repodir}`
+

+
The captured part of the step is:
+

+
* `repodir` — the directory where the repository is for which
+
  the event is created
+

+
To set up this step, we need to have node and a repository first.
+

+
~~~scenario
+
given a Radicle node, with CI configured with broker.yaml and adapter dummy.sh
+
given a Git repository reppy in the Radicle node
+
given the Radicle node emits a refsUpdated event for reppy
+
~~~
+

+
We check that the event file looks roughly correct by querying it with
+
the `jq` tool.
+

+
~~~scenario
+
then file event.json exists
+
when I run jq .type event.json
+
then stdout contains ""refsFetched""
+
~~~
+

+
This is a very rudimentary check, but if the event file is incorrect,
+
then Radicle code will reject it. We don't want to duplicate the logic
+
to do that verification in detail.
+


# Acceptance criteria