-
Notifications
You must be signed in to change notification settings - Fork 4.9k
feat: pause on --debug
#38345
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
feat: pause on --debug
#38345
Conversation
|
gotta figure out what to do about |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
||
| _emitErrors() { | ||
| const errors = this.errors.slice(this._reportedError); | ||
| this._reportedError = this.errors.length; |
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.
| this._reportedError = this.errors.length; | |
| this._reportedError = Math.max(this._reportedError, this.errors.length); |
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.
is this just being defensive, or is there a race here that I don't see?
| return; | ||
| const { result } = data; | ||
| for (const error of params.errors) | ||
| addLocationAndSnippetToError(this._config.config, error); |
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.
Shouldn't internal reporter do this already, upon reporter.onTestEnd? I am afraid we'll get double snippets. Perhaps this should be handled specifically in onTestPaused?
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.
I moved all result/step snippet adding into dispatcher, that's the cleanest way of doing things I think.
| } | ||
|
|
||
| onStepBegin(test: TestCase, result: TestResult, step: TestStep) { | ||
| this._addSnippetToTestErrors(test, result); |
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.
Oh, this will definitely produce double snippets. We should figure out this part.
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.
When you say "produce double snippets", you mean that we wastefully compute them twice, right? Because I don't see how we store them multiple times
| const codeFrame = codeFrameColumns(source, { start: location }, { highlightCode: true }); | ||
| // Convert /var/folders to /private/var/folders on Mac. | ||
| if (!file || fs.realpathSync(file) !== location.file) { | ||
| if (!file || fs.realpathSync(file) !== location.file && false) { |
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.
Surprising change here!
| import { traverse, babelParse, T, types as t } from './babelBundle'; | ||
| import type { Location } from '../../types/testReporter'; | ||
|
|
||
| function containsPosition(location: T.SourceLocation, position: Location): boolean { |
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.
I don't like that we mix both position and location terms in this file. Let's stick to one.
| private _onStepBegin: (payload: StepBeginPayload) => void; | ||
| private _onStepEnd: (payload: StepEndPayload) => void; | ||
| private _onAttach: (payload: AttachmentPayload) => void; | ||
| private _onErrors: (errors: TestErrorPayload) => 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.
TestErrorPayload -> TestErrorsPayload?
| return filteredStackTrace(this.error.stack.split('\n'))[0]; | ||
| } | ||
|
|
||
| async _testEndLocation(): Promise<Location | undefined> { |
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.
private?
Test results for "MCP"3 failed 794 passed, 42 skipped Merge workflow run. |
This comment has been minimized.
This comment has been minimized.
| onStepBegin(test: reporterTypes.TestCase, result: reporterTypes.TestResult, step: reporterTypes.TestStep): void { | ||
| (step as any)[this._idSymbol] = createGuid(); | ||
| // This is here to support "test paused" step, where we want to see all errors | ||
| // at the time of the pause. If we were to have `onTestError()` reporter api, this |
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.
Hmm.... We do now have onTestError!
| result.errors.push(...params.errors); | ||
| result.error = result.errors[0]; | ||
| for (const error of result.errors) | ||
| this._reporter.onTestError?.(test, result, error); |
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.
- We should not notify about the same error from
result.errorsmultiple times. - It is better for consistency to maintain that
result.errors[result.errors.length - 1] === newErrorinsideonTestError().
| result.errors.push(...params.errors); | |
| result.error = result.errors[0]; | |
| for (const error of result.errors) | |
| this._reporter.onTestError?.(test, result, error); | |
| for (const error of params.errors) { | |
| result.errors.push(error); | |
| result.error = result.errors[0]; | |
| this._reporter.onTestError?.(test, result, error); | |
| } |
| result.errors.push(...errors); | ||
| result.error = result.errors[0]; | ||
| for (const error of result.errors) | ||
| this._reporter.onTestError?.(test, result, error); |
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.
| result.errors.push(...errors); | |
| result.error = result.errors[0]; | |
| for (const error of result.errors) | |
| this._reporter.onTestError?.(test, result, error); | |
| for (const error of errors) { | |
| result.errors.push(error); | |
| result.error = result.errors[0]; | |
| this._reporter.onTestError?.(test, result, error); | |
| } |
Test results for "tests 1"6 flaky40350 passed, 790 skipped Merge workflow run. |
No description provided.