Skip to content

feat(testing): Unify VSCode debug config #4117

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

Merged
merged 3 commits into from
Nov 4, 2021

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Nov 4, 2021

For a long time, we've had the following TODO in our VSCode launch.json (debug config) file:

// TODO: these are all alike save the package, so figure out how to make that variable

which was there because we had an ever-expanding number of nearly identical configurations, one per package. Each time we wanted to debug the tests in a new package, we had to copy and paste and make a new PR to get it on master. It was inefficient and frankly kind of a pain.

When the need for yet another package's tests to be debugged came up, rather than continue the madness, I finally answered that TODO. This PR does a few things to make that happen:

  • Add an inputs section to the debug configuration, to allow more than the standard values in the config to be dynamic. - Include a command for reading the one part of the config that has been different per config entry - the package name - off of the open test file.
  • Use that command in the now-unified debug config.
  • Add the VSCode extension which enables the input command to the list of recommended extensions, and a note about it to launch.json.
  • Add a "Debugging Tests" section to CONTRIBUTING.md explaining how to use the debugger.

There's also a small amount of cleanup done to both the newly-unified config entry and the one other remaining one (which runs nextjs integration tests).

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2021

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 22.47 KB (-0.01% 🔽)
@sentry/browser - Webpack 23.35 KB (0%)
@sentry/react - Webpack 23.39 KB (0%)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 29.92 KB (-0.01% 🔽)

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

Would really appreciate a note somewhere (maybe CONTRIBUTING.md?) on how to best use these new debug configs.

@lobsterkatie lobsterkatie force-pushed the kmclb-unify-vscode-debug-config branch 2 times, most recently from 0e731db to 2e714a0 Compare November 4, 2021 21:53
@lobsterkatie
Copy link
Member Author

Would really appreciate a note somewhere (maybe CONTRIBUTING.md?) on how to best use these new debug configs.

The comments in launch.json are meant to cover that, but it's a good idea to put it in CONTRIBUTING.md also. Have added a Debugging Tests section.

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

Sweet, thanks for adding the contributing docs.

@lobsterkatie lobsterkatie force-pushed the kmclb-unify-vscode-debug-config branch from 2e714a0 to 8c64903 Compare November 4, 2021 21:55
@lobsterkatie lobsterkatie force-pushed the kmclb-unify-vscode-debug-config branch from 8c64903 to e15ee02 Compare November 4, 2021 21:58
@lobsterkatie lobsterkatie enabled auto-merge (squash) November 4, 2021 22:01
@lobsterkatie lobsterkatie merged commit 9f1374d into master Nov 4, 2021
@lobsterkatie lobsterkatie deleted the kmclb-unify-vscode-debug-config branch November 4, 2021 22:11
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