1
0
Fork 0

Reliability threshold flag

master
dump_stack() 2023-01-31 09:34:12 +00:00
parent ce7794ce84
commit 330da3b930
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
1 changed files with 5 additions and 0 deletions

5
pew.go
View File

@ -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
}