-
Notifications
You must be signed in to change notification settings - Fork 894
refactor: improve e2e test reporting #10304
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
Changes from 1 commit
54c4b2d
1096c2f
e7d17dc
011dc55
335593a
91475e4
395a019
406b6ed
1c6ff27
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,21 +31,15 @@ class CoderReporter implements Reporter { | |
|
||
onStdOut(chunk: string, test?: TestCase, _?: TestResult): void { | ||
if (!test) { | ||
const preserve = this.config?.preserveOutput === "always"; | ||
if (preserve) { | ||
console.log(`[stdout] ${chunk.replace(/\n$/g, "")}`); | ||
} | ||
console.log(`[stdout] ${chunk.replace(/\n$/g, "")}`); | ||
return; | ||
} | ||
this.testOutput.get(test.id)!.push([process.stdout, chunk]); | ||
} | ||
|
||
onStdErr(chunk: string, test?: TestCase, _?: TestResult): void { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might be losing here output from
It looks like the new reporter simply skips these log records. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that was sort of intentional. it adds a lot of noise when trying to debug a frontend failure, and since it's not tied to a specific test case it's hard to buffer and display later in a way that makes sense. I also added some logic for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the idea was supposed to be that backend peeps could set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. example run, which now has 41 occurrences of the word "error" but succeeded https://github.com/coder/coder/actions/runs/6549912328/job/17787879014?pr=10304 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A good compromise would be only filtering out I would leave coderd output as it is helpful with debugging the request flow or provisioner behavior, especially while dealing with flaky issues. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we can also ignore lines like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree 👍 |
||
if (!test) { | ||
const preserve = this.config?.preserveOutput === "always"; | ||
if (preserve) { | ||
console.error(`[stderr] ${chunk.replace(/\n$/g, "")}`); | ||
} | ||
console.error(`[stderr] ${chunk.replace(/\n$/g, "")}`); | ||
return; | ||
} | ||
this.testOutput.get(test.id)!.push([process.stderr, chunk]); | ||
|
@@ -66,14 +60,11 @@ class CoderReporter implements Reporter { | |
this.timedOutTests.push(test); | ||
} | ||
|
||
const outputFile = `test-results/debug-pprof-goroutine-${test.title}.txt`; | ||
const fsTestTitle = test.title.replaceAll(" ", "-"); | ||
const outputFile = `test-results/debug-pprof-goroutine-${fsTestTitle}.txt`; | ||
await exportDebugPprof(outputFile); | ||
|
||
const preserve = this.config?.preserveOutput; | ||
const logOutput = | ||
preserve === "always" || | ||
(result.status !== "passed" && preserve !== "never"); | ||
if (logOutput) { | ||
if (result.status !== "passed") { | ||
console.log(`Data from pprof has been saved to ${outputFile}`); | ||
console.log("==> Output"); | ||
const output = this.testOutput.get(test.id)!; | ||
|
Uh oh!
There was an error while loading. Please reload this page.