Skip to content

fix(testServer): add location to config loading errors #35710

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mxschmitt
Copy link
Member

@mxschmitt mxschmitt commented Apr 23, 2025

When having e.g. a SyntaxError or a throw new Error inside a config and using the VSCode extension, there was no error shown in the problems tab. This is because we didn't add the location property to the TestError which we sent back over to VSCode.

Looks like it regressed when migrating to TestServer. Or a bit after it. When using CLI, we add the location property` here.

This comment has been minimized.

@mxschmitt mxschmitt force-pushed the fix(testServer)--add-location-to-config-loading-errors branch 2 times, most recently from 183f0e5 to 83d9787 Compare April 23, 2025 15:52

This comment has been minimized.

This comment has been minimized.

@mxschmitt mxschmitt marked this pull request as ready for review April 23, 2025 17:01
@mxschmitt mxschmitt requested a review from dgozman April 23, 2025 17:01
Copy link
Contributor

@dgozman dgozman left a comment

Choose a reason for hiding this comment

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

This brings more questions than answers 😄

@@ -418,7 +418,17 @@ export class TestServerDispatcher implements TestServerInterface {
}
return { config };
} catch (e) {
return { config: null, error: serializeError(e) };
const error: reporterTypes.TestError = serializeError(e);
if (e.name === 'SyntaxError' && e.code === 'BABEL_PARSE_ERROR' && this._configLocation.resolvedConfigFile) {
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 find a better place for this. At least in utils. Don't we have such code somewhere already? Perhaps serializeError() should do that automatically and always set location?

@mxschmitt mxschmitt force-pushed the fix(testServer)--add-location-to-config-loading-errors branch from 83d9787 to d7abd99 Compare April 24, 2025 10:49

This comment has been minimized.

@mxschmitt mxschmitt force-pushed the fix(testServer)--add-location-to-config-loading-errors branch from d7abd99 to d926aea Compare April 24, 2025 12:14
Copy link
Contributor

Test results for "tests 1"

2 failed
❌ [legacy-reuse] › run-tests.spec.ts:1153:5 › should produce output twice @vscode-extension
❌ [webkit-library] › library/emulation-focus.spec.ts:104:3 › should not affect screenshots @webkit-ubuntu-22.04-node18

6 flaky ⚠️ [chromium-library] › library/chromium/oopif.spec.ts:284:3 › should click @chromium-ubuntu-22.04-node18
⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:986:7 › cli codegen › should not throw csp directive violation errors @firefox-ubuntu-22.04-node18
⚠️ [firefox-page] › page/page-evaluate.spec.ts:424:3 › should throw for too deep reference chain @firefox-ubuntu-22.04-node18
⚠️ [webkit-library] › library/screenshot.spec.ts:55:14 › page screenshot › should work with a mobile viewport and clip @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:153:5 › page screenshot › should clip rect with fullPage @webkit-ubuntu-22.04-node18
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:145:5 › should watch all @windows-latest-node18-1

39093 passed, 803 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