Radish alpha
r
rad:zwTxygwuz5LDGBq255RA2CbNGrz8
Radicle CI broker
Radicle
Git
fix: make test suite run on Macs
Merged liw opened 1 year ago

Change the radenv.sh script to use tilde expansion instead of getent. Macs do not have a getent - that’s a tool that’s specific to glibc, so it’s mostly only available on Linux systems. But we don’t need that: Bash can do the expansion directly.

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

1 file changed +24 -3 c7cbcb00 40cb793a
modified ci-broker.md
@@ -156,10 +156,8 @@ set -euo pipefail

homedir="$(pwd)/homedir"

-
CI_USER_HOME="$(getent passwd "$USER" | awk -F: '{ print $6 }')"
-

env \
-
    PATH="$CI_USER_HOME/.radicle/bin:$PATH" \
+
    PATH=~/.radicle/bin:"$PATH" \
	HOME="$homedir" \
	RAD_PASSPHRASE=secret \
	RAD_HOME="$homedir/.radicle" \
@@ -481,6 +479,29 @@ we have not convenient way to know the repository ID.
The event synthesizer is a helper to feed the CI broker node events in
a controlled fashion.

+
## We can run rad
+

+
_Want:_ We can run rad.
+

+
_Why:_ For many of the verification scenarios for the CI broker we
+
need to run the Radicle `rad` command line tool. Depending on the
+
environment we use for verification, `rad` may be installed in various
+
places. Commonly, if installed using the Radicle installer, `rad` is
+
installed into `~/.radicle/bin` and edits the shell initialization
+
file to add that to `$PATH`. However, in a CI context, that
+
initialization is not necessarily done and so the `radenv.sh` helper
+
script adds that directory to the `$PATH` just in case. We verify in
+
this scenario that we can run `rad` at all.
+

+
_Who:_ `cib-devs`
+

+
~~~scenario
+
given file radenv.sh
+
when I run bash radenv.sh rad --version
+
then command is successful
+
~~~
+

+

## Dummy adapter runs successfully

_Want:_ The dummy adapter (in embedded file `dummy.sh`) runs