Add progress output while waiting for dependencies

This commit adds progress output while waiting for `depends_on`
conditions to resolve. The initial output looks like so:

     ⠿ Container chbench-zookeeper-1        Waiting      0s
     ⠿ Container chbench-kafka-1            Waiting      0s
     ⠿ Container chbench-one-off            Waiting      0s

Once all conditions have been resolved, the ouput looks like this:

     ⠿ Container chbench-zookeeper-1        Healthy      1.2s
     ⠿ Container chbench-kafka-1            Healthy      3.2s
     ⠿ Container chbench-schema-registry-1  Exited       4s

As shown above, `service_healthy` conditions result in a terminal status
of "Healthy" while `service_exited_successfully` conditions result in a
terminal status of "Exited".

Signed-off-by: Nikhil Benesch <nikhil.benesch@gmail.com>
This commit is contained in:
Nikhil Benesch 2022-01-06 23:17:10 -05:00 committed by Nicolas De loof
parent c5cdce0b60
commit 5eb314a4ca
2 changed files with 38 additions and 3 deletions

View file

@ -68,6 +68,21 @@ func StartedEvent(ID string) Event {
return NewEvent(ID, Done, "Started")
}
// Waiting creates a new waiting event
func Waiting(ID string) Event {
return NewEvent(ID, Working, "Waiting")
}
// Healthy creates a new healthy event
func Healthy(ID string) Event {
return NewEvent(ID, Done, "Healthy")
}
// Exited creates a new exited event
func Exited(ID string) Event {
return NewEvent(ID, Done, "Exited")
}
// RestartingEvent creates a new Restarting in progress Event
func RestartingEvent(ID string) Event {
return NewEvent(ID, Working, "Restarting")