Radish alpha
r
Radicle CI broker
Radicle
Git (anonymous pull)
Log in to clone via SSH
test: in acceptance scenarios, search for log ids, not message texts
Lars Wirzenius committed 1 year ago
commit 3ce84a47c0300cacd98fc13766d58829570e64b1
parent cdd6a6c212d935b19e8e94058bd6fa4e502a2272
2 files changed +20 -20
modified ci-broker.md
@@ -299,9 +299,9 @@ when I run ./env.sh synthetic-events synt.sock event.json --log log.txt
given a directory reports
when I run ./env.sh cib --config broker.yaml process-events

-
then stderr contains "CI broker starts"
-
then stderr contains "loaded configuration"
-
then stderr contains "CI broker ends successfully"
+
then stderr contains "CibStart"
+
then stderr contains "CibConfig"
+
then stderr contains "CibEndSuccess"
then file reports/index.html exists
then file reports/status.json exists
then file reports/index.rss exists
@@ -614,7 +614,7 @@ _Who:_ `node-ops`
given a Radicle node, with CI configured with broker.yaml and adapter dummy.sh

when I run ./env.sh cib --config broker.yaml config
-
then stderr contains "CI broker starts"
+
then stderr contains "CibStart"

when I run ./env.sh cib --config broker.yaml --log-level error config
then stderr is exactly ""
@@ -891,8 +891,8 @@ when I run cibtool --db ci-broker.db event shutdown

given a directory reports
when I run ./env.sh cib --config broker.yaml queued
-
then stderr contains "Action: run"
-
then stderr contains "Action: shutdown"
+
then stderr contains "QueueProcActionRun"
+
then stderr contains "QueueProcActionShutdown"

when I run cibtool --db ci-broker.db event list
then stdout is empty
@@ -1490,8 +1490,8 @@ given a Radicle node, with CI configured with broker.yaml and adapter dummy.sh
given a directory reports
when I run ./env.sh cib --config broker.yaml queued

-
then stderr contains "CI broker starts"
-
then stderr contains "CI broker ends successfully"
+
then stderr contains "CibStart"
+
then stderr contains "CibEndSuccess"
~~~

## Logs termination due to error
@@ -1510,8 +1510,8 @@ an error it can't recover from.
~~~scenario
given a Radicle node, with CI configured with broker.yaml and adapter dummy.sh
when I try to run env RAD_HOME=/does/not/exist cib --config broker.yaml queued
-
then stderr contains "CI broker starts"
-
then stderr contains "CI broker ends in unrecoverable error"
+
then stderr contains "CibStart"
+
then stderr contains "CibEndFailure"
~~~

# Acceptance criteria for reports
modified src/logger.rs
@@ -103,20 +103,12 @@ enum Id {
    QueueProcStart,

    TimeoutLineReceiverCheckChild,
-
    TimeoutLineReceiverDisconnected,
    TimeoutLineReceiverChildDisconnected,
-
    TimeoutLineReceiverLostChild,
+
    TimeoutLineReceiverDisconnected,
    TimeoutLineReceiverLine,
+
    TimeoutLineReceiverLostChild,
    TimeoutLineReceiverTried,
    TimeoutLineReceiverTry,
-
    TimeoutNonblockingEnd,
-
    TimeoutNonblockingEndOfFile,
-
    TimeoutNonblockingError,
-
    TimeoutNonblockingTooMuch,
-
    TimeoutNonblockingTried,
-
    TimeoutNonblockingTry,
-
    TimeoutOk,
-
    TimeoutRequestEnd,
    TimeoutNannyEnd,
    TimeoutNannyLostChild,
    TimeoutNannyNotifyTooLong,
@@ -125,6 +117,14 @@ enum Id {
    TimeoutNannyWaitEnd,
    TimeoutNannyWaitWord,
    TimeoutNannyWord,
+
    TimeoutNonblockingEnd,
+
    TimeoutNonblockingEndOfFile,
+
    TimeoutNonblockingError,
+
    TimeoutNonblockingTooMuch,
+
    TimeoutNonblockingTried,
+
    TimeoutNonblockingTry,
+
    TimeoutOk,
+
    TimeoutRequestEnd,
    TimeoutWaitChildEnd,
    TimeoutWaitChildExitStatus,
    TimeoutWaitStderrReaderEnd,