From 8303fded120e9e29ae89cd36a8616d4483209867 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Wed, 18 Oct 2023 16:43:55 -0400 Subject: [PATCH] count successes and failues --- raidengine/raidengine.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/raidengine/raidengine.go b/raidengine/raidengine.go index 6e0806b..0995aaf 100644 --- a/raidengine/raidengine.go +++ b/raidengine/raidengine.go @@ -104,6 +104,7 @@ func RunRaid(name string, strikes []Strike) error { closeHandler() var attempts int + var successes int var failures int raidResults := &RaidResults{ @@ -118,6 +119,7 @@ func RunRaid(name string, strikes []Strike) error { strikeResult.Message = "Strike did not return a result, and may still be under construction." } if strikeResult.Passed { + successes += 1 logger.Info(strikeResult.Message) } else { failures += 1 @@ -131,7 +133,7 @@ func RunRaid(name string, strikes []Strike) error { raidResults.WriteStrikeResultsYAML() cleanup() output := fmt.Sprintf( - "%v/%v strikes succeeded. View the output logs for more details.", failures, attempts) + "%v/%v strikes succeeded. View the output logs for more details.", successes, attempts) logger.Info(output) if failures > 0 { return errors.New(output)