Radish alpha
r
rad:zwTxygwuz5LDGBq255RA2CbNGrz8
Radicle CI broker
Radicle
Git
tests(ci-broker.md): add scenario for JSON config file
Lars Wirzenius committed 7 months ago
commit 6f29315b46d2bc8d1fa299e7b42e478d11f0d020
parent adde3f4
1 file changed +55 -1
modified ci-broker.md
@@ -381,7 +381,7 @@ to do that verification in detail.

# Acceptance criteria

-
## Shows config as JSON
+
## Shows YAML config as JSON

_Want:_ The CI broker can write out the configuration it uses
at run time as JSON.
@@ -403,6 +403,60 @@ then command is successful
~~~


+
## Shows JSON config as JSON
+

+
_Want:_ The CI broker can write out the configuration it usesc
+
at run time as JSON.
+

+
_Why:_ This is helpful for the node operator to verify that
+
they have configured the program correctly.
+

+
_Who:_ `cib-devs`
+

+
Our verification here is quite simplistic, and only checks that the
+
output is in the JSON format. It does not try to make sure the JSON
+
matches the YAML semantically.
+

+
~~~scenario
+
given a Radicle node, with CI configured with config.json and adapter dummy.sh
+
when I run cib --config config.json config --output actual.json
+
when I run jq . actual.json
+
then command is successful
+
~~~
+

+
~~~{#config.json .file .json}
+
{
+
  "default_adapter": "mcadapterface",
+
  "triggers": null,
+
  "report_dir": "reports",
+
  "db": "ci-broker.db",
+
  "adapters": {
+
    "mcadapterface": {
+
      "command": "./adapter.sh",
+
      "env": {
+
        "PATH": "/bin"
+
      },
+
      "sensitive_env": {
+
        "API_KEY": "<REDACTED>"
+
      },
+
      "config": {
+
        "foo": "bar"
+
      },
+
      "config_env": "RADICLE_NATIVE_CI"
+
    }
+
  },
+
  "filters": [
+
    {
+
      "Branch": "main"
+
    }
+
  ],
+
  "max_run_time": "1min",
+
  "queue_len_interval": "1s",
+
  "concurrent_adapters": null
+
}
+
~~~
+

+

## Shows adapter specification

_Want:_ The CI broker can write out the specification for an adapter.