Skip to content

Commit

Permalink
Updating ConsoleCheckText
Browse files Browse the repository at this point in the history
  • Loading branch information
c4rt0 committed Sep 3, 2024
1 parent d8e6c82 commit 4592b7c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
3 changes: 1 addition & 2 deletions mantle/cmd/kola/testiso.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,7 @@ func awaitCompletion(ctx context.Context, inst *platform.QemuInstance, outdir st
if err != nil {
errchan <- err
}
}()
}
}
go func() {
err := inst.Wait()
// only one Wait() gets process data, so also manually check for signal
Expand Down
21 changes: 8 additions & 13 deletions mantle/kola/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -1919,30 +1919,26 @@ func ScpKolet(machines []platform.Machine) error {


// CheckConsoleText checks console output for badness
func CheckConsoleText(consoleOutput []byte) (bool, []string) {
var badlines []string
warnOnly, allowRerunSuccess := true, true
func CheckConsoleText(badlines []string) (bool, []string) {
badness := true
for _, check := range consoleChecks {
if check.skipFlag != nil {
continue
}
match := check.match.FindSubmatch(consoleOutput)
if match != nil {
match := check.match.FindString(badlines[1])
if match != "" {
badline := check.desc
if len(match) > 1 {
// include first subexpression
badline += fmt.Sprintf(" (%s)", match[1])

Check failure on line 1933 in mantle/kola/harness.go

View workflow job for this annotation

GitHub Actions / golangci-lint

printf: fmt.Sprintf format %s has arg match[1] of wrong type byte, see also https://pkg.go.dev/fmt#hdr-Printing (govet)
}
badlines = append(badlines, badline)
if !check.warnOnly {
warnOnly = false
}
if !check.allowRerunSuccess {
allowRerunSuccess = false
badness = false
}
}
}
return warnOnly, badlines
return badness, badlines
}

// CheckConsole checks some console output for badness and returns short
Expand Down Expand Up @@ -1972,9 +1968,8 @@ func CheckConsole(output []byte, t *register.Test) (bool, []string) {
if !check.allowRerunSuccess {
allowRerunSuccess = false
}
cc := CheckConsoleText([]byte(output))
fmt.Printf("Test failed: %v", cc)
fmt.Printf("// Leftovers \n\n")
is_it_err,checkConsole := CheckConsoleText([]string(badlines))
fmt.Printf("%v\n,%v", checkConsole, is_it_err)
}
}
if len(badlines) > 0 && allowRerunSuccess && t != nil {
Expand Down
1 change: 0 additions & 1 deletion mantle/platform/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import (
"syscall"
"time"

"github.com/coreos/coreos-assembler/mantle/kola"
"github.com/coreos/coreos-assembler/mantle/platform/conf"
"github.com/coreos/coreos-assembler/mantle/util"
coreosarch "github.com/coreos/stream-metadata-go/arch"
Expand Down

0 comments on commit 4592b7c

Please sign in to comment.