Skip to content

Commit

Permalink
Merge pull request #5 from privateerproj/fix/success-counts
Browse files Browse the repository at this point in the history
count successes and failues
  • Loading branch information
eddie-knight authored Oct 18, 2023
2 parents b6309a6 + 8303fde commit 1abe00b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion raidengine/raidengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func RunRaid(name string, strikes []Strike) error {
closeHandler()

var attempts int
var successes int
var failures int

raidResults := &RaidResults{
Expand All @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 1abe00b

Please sign in to comment.