From 330da3b930df795ed05b45b2979fe86a959691df Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Tue, 31 Jan 2023 09:34:12 +0000 Subject: [PATCH] Reliability threshold flag --- pew.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pew.go b/pew.go index e165394..5b8dd70 100644 --- a/pew.go +++ b/pew.go @@ -41,6 +41,8 @@ type PewCmd struct { QemuTimeout time.Duration `help:"timeout for qemu"` DockerTimeout time.Duration `help:"timeout for docker"` + + Threshold float64 `help:"Reliablity threshold for exit code" default:"1.00"` } func (cmd PewCmd) Run(g *Globals) (err error) { @@ -104,6 +106,9 @@ func (cmd PewCmd) Run(g *Globals) (err error) { return } + if successRate(state) < *threshold { + err = errors.New("reliability threshold not met") + } return }