-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(nextjs): Improve integration test debugging #4144
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
lobsterkatie
merged 6 commits into
master
from
kmclb-nextjs-improve-integration-test-debugging
Nov 15, 2021
Merged
ref(nextjs): Improve integration test debugging #4144
lobsterkatie
merged 6 commits into
master
from
kmclb-nextjs-improve-integration-test-debugging
Nov 15, 2021
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size-limit report
|
AbhiPrasad
approved these changes
Nov 11, 2021
iker-barriocanal
approved these changes
Nov 15, 2021
lobsterkatie
added a commit
that referenced
this pull request
Nov 15, 2021
This includes two changes I made to help myself while debugging the nextjs integration tests for a recent PR: 1) Add the ability to set `debug: true` in `Sentry.init()` via a command line flag. In order to do this, I changed the `--debug` flag from a boolean to one which can appear multiple times and which accepts an optional string, either `requests` or `logs`, with the following behavior: - `yarn test:integration` -> no debug logging of any kind (matches current behavior) - `yarn test:integration --debug` -> sets `debug: true` in `Sentry.init()` (change in behavior) - `yarn test:integration --debug logs` -> sets `debug: true` in `Sentry.init()` (change in behavior) - `yarn test:integration --debug requests` -> logs intercepted requests (current behavior of `--debug` flag) I chose to make SDK debug logging the default (what you get if you just use `--debug` without an argument) because of the two options, it is significantly more useful in my experience. (Logging intercepted requests gets unwieldy fast, as they are large objects and end up just creating a lot of noise to sift through in order to find the one piece of data you might want.) Since bare `--debug` has up until now logged intercepted requests, this is technically a breaking change, but since these tests have a userbase of under 5 people, all of them on our team, I figured we could probably roll with it. :-) 2) Improve the VSCode debugger setup for the integration tests. This involved: - Adding a bash function to link sentry packages into the test app, so that we can test against any changes we make without having to reinstall all of the test app's dependencies again just to use the updated files. - Creating a task to be executed before each run of the debugger, which uses the above script to link monorepo packages (if not already linked) and then rebuilds the test app. (This happens by calling a new `yarn` script.) - Setting up the debugger's sourcemap config, so we can step through TS files rather than the generated JS files. - Adding more comments to the debug config to explain what each bit does and why.
onurtemizkan
pushed a commit
that referenced
this pull request
Dec 19, 2021
This includes two changes I made to help myself while debugging the nextjs integration tests for a recent PR: 1) Add the ability to set `debug: true` in `Sentry.init()` via a command line flag. In order to do this, I changed the `--debug` flag from a boolean to one which can appear multiple times and which accepts an optional string, either `requests` or `logs`, with the following behavior: - `yarn test:integration` -> no debug logging of any kind (matches current behavior) - `yarn test:integration --debug` -> sets `debug: true` in `Sentry.init()` (change in behavior) - `yarn test:integration --debug logs` -> sets `debug: true` in `Sentry.init()` (change in behavior) - `yarn test:integration --debug requests` -> logs intercepted requests (current behavior of `--debug` flag) I chose to make SDK debug logging the default (what you get if you just use `--debug` without an argument) because of the two options, it is significantly more useful in my experience. (Logging intercepted requests gets unwieldy fast, as they are large objects and end up just creating a lot of noise to sift through in order to find the one piece of data you might want.) Since bare `--debug` has up until now logged intercepted requests, this is technically a breaking change, but since these tests have a userbase of under 5 people, all of them on our team, I figured we could probably roll with it. :-) 2) Improve the VSCode debugger setup for the integration tests. This involved: - Adding a bash function to link sentry packages into the test app, so that we can test against any changes we make without having to reinstall all of the test app's dependencies again just to use the updated files. - Creating a task to be executed before each run of the debugger, which uses the above script to link monorepo packages (if not already linked) and then rebuilds the test app. (This happens by calling a new `yarn` script.) - Setting up the debugger's sourcemap config, so we can step through TS files rather than the generated JS files. - Adding more comments to the debug config to explain what each bit does and why.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This includes two changes I made to help myself while debugging the nextjs integration tests for a recent PR:
Add the ability to set
debug: true
inSentry.init()
via a command line flag. In order to do this, I changed the--debug
flag from a boolean to one which can appear multiple times and which accepts an optional string, eitherrequests
orlogs
, with the following behavior:yarn test:integration
-> no debug logging of any kind (matches current behavior)yarn test:integration --debug
-> setsdebug: true
inSentry.init()
(change in behavior)yarn test:integration --debug logs
-> setsdebug: true
inSentry.init()
(change in behavior)yarn test:integration --debug requests
-> logs intercepted requests (current behavior of--debug
flag)I chose to make SDK debug logging the default (what you get if you just use
--debug
without an argument) because, of the two options, it is significantly more useful in my experience. (Logging intercepted requests gets unwieldy fast, as they are large objects and end up just creating a lot of noise to sift through in order to find the one piece of data you might want.) Since bare--debug
has up until now logged intercepted requests, this is technically a breaking change, but since these tests have a userbase of under 5 people, all of them on our team, I figured we could probably roll with it. :-)Improve the VSCode debugger setup for the integration tests. This involved:
yarn
script.)