-
Notifications
You must be signed in to change notification settings - Fork 183
testiso.go: Add check for badness #3895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Skipping CI for Draft Pull Request. |
|
ok I think the strategy here should probably be to just call There is precedent for calling coreos-assembler/mantle/cmd/kola/console.go Lines 77 to 81 in 7550a58
So we should be able to do something like: diff --git a/mantle/cmd/kola/testiso.go b/mantle/cmd/kola/testiso.go
index a925d3d25..e2cd761c1 100644
--- a/mantle/cmd/kola/testiso.go
+++ b/mantle/cmd/kola/testiso.go
@@ -729,7 +729,18 @@ func awaitCompletion(ctx context.Context, inst *platform.QemuInstance, outdir st
}
}()
err := <-errchan
- return time.Since(start), err
+ // The test is done so let's record the amount of elapsed time
+ elapsed = time.Since(start)
+ if err == nil; {
+ // No error so far; let's check the console/journal
+ for each of inst.builder.consoleFile and filepath.Join(outdir, "journal.txt") we need to {
+
+ warnOnly, badlines := kola.CheckConsole(readfile, nil)
+ for range badlines
+ do something and set err to !nil if there was badness
+ }
+ }
+ return elapsed, err
}
func printResult(test string, duration time.Duration, err error) bool { |
dd184f1 to
fcb5eb7
Compare
|
I ran the code through the gofmt, yet it still fails the linter check. Can I get any pointers on this, please? 🤔 |
the CI runs gofmt and golangci-lint, which are two different things : https://golangci-lint.run/ |
|
I installed the version of golangci-lint as per the pipeline. The output seems to have nothing to do with code I modified. Here's the result of golangci-lint: All golangci-lint errors I get for the harness.go, testiso.go and qemu.go seem to be unrelated to my modifications. Is this common, or am I missing something? |
|
Maybe can try newer go version like 1.22, see coreos/repo-templates#248 and coreos/repo-templates#249 (as 1.21 is EOL) |
I tried it and it didn't help: |
03fc17e to
40290bd
Compare
After tests are complete this checks for bad lines in the console.txt and journal.txt files. Ref: coreos#3788 Co-authored-by: Dusty Mabe <[email protected]>
|
In the interest of time I'll push up a commit that is working in local testing. |
4d50394 to
dbe4048
Compare
c4rt0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
Thank you @dustymabe for the last update. |
This PR aims to address the first step of a suggestion in the #3788 issue.
(use checkConsole to verify console.txt and journal.txt for badness)