1
0

Remove verbose flag

This commit is contained in:
dump_stack() 2023-03-18 22:39:24 +00:00
parent c2c3837f44
commit 3f16599109
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

17
pew.go
View File

@ -36,7 +36,6 @@ type PewCmd struct {
Dist string `help:"build result path" default:"/dev/null"` Dist string `help:"build result path" default:"/dev/null"`
Threads int `help:"threads" default:"1"` Threads int `help:"threads" default:"1"`
Tag string `help:"log tagging"` Tag string `help:"log tagging"`
Verbose bool `help:"show more information"`
Timeout time.Duration `help:"timeout after tool will not spawn new tests"` Timeout time.Duration `help:"timeout after tool will not spawn new tests"`
ArtifactConfig string `help:"path to artifact config" type:"path"` ArtifactConfig string `help:"path to artifact config" type:"path"`
@ -118,7 +117,7 @@ func (cmd PewCmd) Run(g *Globals) (err error) {
err = performCI(ka, kcfg, cmd.Binary, cmd.Test, stop, err = performCI(ka, kcfg, cmd.Binary, cmd.Test, stop,
qemuTimeout, dockerTimeout, qemuTimeout, dockerTimeout,
cmd.Max, cmd.Runs, cmd.Dist, cmd.Tag, cmd.Max, cmd.Runs, cmd.Dist, cmd.Tag,
cmd.Threads, db, cmd.Verbose) cmd.Threads, db)
if err != nil { if err != nil {
return return
} }
@ -499,7 +498,7 @@ func copyStandardModules(q *qemu.System, ki config.KernelInfo) (err error) {
func whatever(swg *sizedwaitgroup.SizedWaitGroup, ka config.Artifact, func whatever(swg *sizedwaitgroup.SizedWaitGroup, ka config.Artifact,
ki config.KernelInfo, binaryPath, testPath string, ki config.KernelInfo, binaryPath, testPath string,
qemuTimeout, dockerTimeout time.Duration, dist, tag string, qemuTimeout, dockerTimeout time.Duration, dist, tag string,
db *sql.DB, verbose bool) { db *sql.DB) {
defer swg.Done() defer swg.Done()
@ -537,17 +536,15 @@ func whatever(swg *sizedwaitgroup.SizedWaitGroup, ka config.Artifact,
} }
defer q.Stop() defer q.Stop()
if verbose {
go func() { go func() {
for !q.Died { for !q.Died {
time.Sleep(time.Minute) time.Sleep(time.Minute)
log.Print(ka.Name, ki.DistroType, log.Debug().Msgf("still alive %s %s %s %s",
ki.DistroRelease, ki.KernelRelease, ka.Name, ki.DistroType,
"still alive") ki.DistroRelease, ki.KernelRelease)
} }
}() }()
}
usr, err := user.Current() usr, err := user.Current()
if err != nil { if err != nil {
@ -628,7 +625,7 @@ func performCI(ka config.Artifact, kcfg config.KernelConfig, binaryPath,
testPath string, stop time.Time, testPath string, stop time.Time,
qemuTimeout, dockerTimeout time.Duration, qemuTimeout, dockerTimeout time.Duration,
max, runs int64, dist, tag string, threads int, max, runs int64, dist, tag string, threads int,
db *sql.DB, verbose bool) (err error) { db *sql.DB) (err error) {
found := false found := false
@ -654,7 +651,7 @@ func performCI(ka config.Artifact, kcfg config.KernelConfig, binaryPath,
swg.Add() swg.Add()
go whatever(&swg, ka, kernel, binaryPath, go whatever(&swg, ka, kernel, binaryPath,
testPath, qemuTimeout, dockerTimeout, testPath, qemuTimeout, dockerTimeout,
dist, tag, db, verbose) dist, tag, db)
} }
} }
} }