Skip to content
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

Fix debugging for browser-based tests, add debugging section to CONTRIBUTING.md #7767

Merged
merged 7 commits into from
Feb 25, 2025

Conversation

hl662
Copy link
Contributor

@hl662 hl662 commented Feb 24, 2025

Part of #7691

  • Wrote a section on debugging tests, adding them to CONTRIBUTING.md

For tests using vitest browser:

  • When using pnpm to execute vitest as part of a package.json script, within a debugging launch config, the attached debugger couldn't pick up the breakpoints. Resorted to directly executing the compiled vitest source as written in vitest's docs.

@hl662 hl662 self-assigned this Feb 24, 2025
@hl662 hl662 marked this pull request as ready for review February 24, 2025 19:44
@hl662
Copy link
Contributor Author

hl662 commented Feb 24, 2025

@markschlosseratbentley @andremig-bentley would you be able to try setting a breakpoint in core frontend, following the instructions here? Looking for feedback on whether the instructions are clear enough

@markschlosseratbentley
Copy link
Contributor

@markschlosseratbentley @andremig-bentley would you be able to try setting a breakpoint in core frontend, following the instructions here? Looking for feedback on whether the instructions are clear enough

Are breakpoints working for you in VSCode on this branch? I tried setting some in core/frontend/src/test/Viewport.test.ts inside "Viewport", "constructor", "invokes initialize method", but they remain unbound.

Is that link supposed to discuss breakpoints? I see discussion at that linked section about selecting only a single test to run.

@hl662
Copy link
Contributor Author

hl662 commented Feb 24, 2025

Is that link supposed to discuss breakpoints? I see discussion at that linked section about selecting only a single test to run.

It's not explicitly calling out breakpoints, I guess it's implied that one knows how to set breakpoints, it's more so an explanation on how to run debugging in core.

Are breakpoints working for you in VSCode on this branch? I tried setting some in core/frontend/src/test/Viewport.test.ts inside "Viewport", "constructor", "invokes initialize method", but they remain unbound.

Yes, breakpoints are working for me, I just set a breakpoint in Viewport.test.ts as well, and ran the Frontend Tests launch config in Run and Debug

@markschlosseratbentley
Copy link
Contributor

markschlosseratbentley commented Feb 24, 2025

Is that link supposed to discuss breakpoints? I see discussion at that linked section about selecting only a single test to run.

It's not explicitly calling out breakpoints, I guess it's implied that one knows how to set breakpoints, it's more so an explanation on how to run debugging in core.

Are breakpoints working for you in VSCode on this branch? I tried setting some in core/frontend/src/test/Viewport.test.ts inside "Viewport", "constructor", "invokes initialize method", but they remain unbound.

Yes, breakpoints are working for me, I just set a breakpoint in Viewport.test.ts as well, and ran the Frontend Tests launch config in Run and Debug

Oh, interesting. I was trying "Electron Frontend Tests".

Edit: I should have been trying "Frontend Tests".

Copy link
Contributor

@markschlosseratbentley markschlosseratbentley left a comment

Choose a reason for hiding this comment

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

This works for me --- with the latest timeout included.

@hl662 hl662 enabled auto-merge (squash) February 25, 2025 20:06
@hl662 hl662 merged commit 5e14461 into master Feb 25, 2025
16 checks passed
@hl662 hl662 deleted the nam/debugger-frontend branch February 25, 2025 21:29
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.

3 participants