-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
refactor(@jest/reporters): improve annotation formatting of GitHubActionsReporter
#12826
refactor(@jest/reporters): improve annotation formatting of GitHubActionsReporter
#12826
Conversation
failureMessages.forEach(failure => { | ||
const {message, stack} = separateMessageFromStack(stripAnsi(failure)); | ||
|
||
const relativeTestPath = slash(relative('', test.path)); |
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.
For some reason, rootDir
is not pointing to the right place. See #12822 (comment).
In the other hand, in CI it feels right to keep paths relative to root of the repo.
One more case to do: would be nice to annotate |
Exciting! 😀 |
line: string, | ||
) => { | ||
config: StackTraceConfig, | ||
relativeTestPath: string | null = null, |
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.
Perhaps fine to have null
as default, it just enables more styling.
aggregatedResults?: AggregatedResult, | ||
): void { | ||
const messages = getMessages(aggregatedResults?.testResults); | ||
onTestFileResult({context}: Test, {testResults}: TestResult): void { |
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.
onTestFileResult
is needed to annotate retries. I was trying to use onTestCaseResult
first, but it reports retried tests as failures. (By the way, strangely TestContext
from onTestCaseResult
has wrong rootDir
, but all is good with onTestFileResult
.)
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.
By the way, strangely
TestContext
fromonTestCaseResult
has wrongrootDir
, but all is good withonTestFileResult
.)
can you file an issue for it?
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.
Have to figure out what is the root of that. Locally all was fine, but not on CI. Strange thing. Let’s see.
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.
great stuff!
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Split from #12822
Summary
As mentioned, annotations produced by
GitHubActionsReporter
is very nice improvement. Few details could make them even better:Test plan
Reworked unit tests. And some screenshots from temporary failing tests.