Skip to content

Conversation

@Skn0tt
Copy link
Member

@Skn0tt Skn0tt commented Nov 27, 2025

No description provided.

@Skn0tt Skn0tt requested a review from dgozman November 27, 2025 10:29
@Skn0tt Skn0tt self-assigned this Nov 27, 2025
@Skn0tt
Copy link
Member Author

Skn0tt commented Nov 27, 2025

gotta figure out what to do about result.errors 🤔

@Skn0tt Skn0tt marked this pull request as draft November 27, 2025 10:53
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Skn0tt Skn0tt marked this pull request as ready for review November 27, 2025 11:23
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.


_emitErrors() {
const errors = this.errors.slice(this._reportedError);
this._reportedError = this.errors.length;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this._reportedError = this.errors.length;
this._reportedError = Math.max(this._reportedError, this.errors.length);

Copy link
Member Author

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);
Copy link
Contributor

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?

Copy link
Member Author

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);
Copy link
Contributor

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.

Copy link
Member Author

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

@Skn0tt Skn0tt requested a review from dgozman November 27, 2025 13:54
@Skn0tt Skn0tt mentioned this pull request Nov 28, 2025
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) {
Copy link
Contributor

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 {
Copy link
Contributor

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;
Copy link
Contributor

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> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private?

@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2025

Test results for "MCP"

3 failed
❌ [webkit] › mcp/launch.spec.ts:21 › test reopen browser @mcp-ubuntu-latest
❌ [webkit] › mcp/launch.spec.ts:80 › persistent context @mcp-ubuntu-latest
❌ [webkit] › mcp/video.spec.ts:63 › should work with recordVideo (isolated) @mcp-ubuntu-latest

794 passed, 42 skipped


Merge workflow run.

@github-actions

This comment has been minimized.

@Skn0tt Skn0tt requested a review from dgozman December 1, 2025 15:43
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
Copy link
Contributor

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!

Comment on lines 439 to 442
result.errors.push(...params.errors);
result.error = result.errors[0];
for (const error of result.errors)
this._reporter.onTestError?.(test, result, error);
Copy link
Contributor

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.errors multiple times.
  • It is better for consistency to maintain that result.errors[result.errors.length - 1] === newError inside onTestError().
Suggested change
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);
}

Comment on lines 455 to 458
result.errors.push(...errors);
result.error = result.errors[0];
for (const error of result.errors)
this._reporter.onTestError?.(test, result, error);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);
}

@Skn0tt Skn0tt requested a review from dgozman December 2, 2025 07:36
@Skn0tt Skn0tt merged commit 7199022 into microsoft:main Dec 2, 2025
33 of 34 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

Test results for "tests 1"

6 flaky ⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1079 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node18`
⚠️ [firefox-page] › page/page-event-request.spec.ts:182 › should return response body when Cross-Origin-Opener-Policy is set `@firefox-ubuntu-22.04-node18`
⚠️ [firefox-page] › page/page-wait-for-function.spec.ts:104 › should work with strict CSP policy `@firefox-ubuntu-22.04-node18`
⚠️ [webkit-library] › library/proxy.spec.ts:93 › should proxy local network requests › with other bypasses › loopback address `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-library] › library/proxy.spec.ts:146 › should work with authenticate followed by redirect `@webkit-ubuntu-22.04-node18`
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:354 › should watch test defined outside of .spec.ts file `@windows-latest-node18-2`

40350 passed, 790 skipped


Merge workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants