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

Verifying VS Code debugger with default configuration works on tests in our SDKs #10145

Merged
merged 3 commits into from
Aug 11, 2020

Conversation

deyaaeldeen
Copy link
Member

@deyaaeldeen deyaaeldeen commented Jul 20, 2020

See https://code.visualstudio.com/updates/v1_45#_automatic-debug-configurations for release notes on the vs code debugger with default configuration.

@deyaaeldeen deyaaeldeen changed the title Verifying VS Code debugger works on tests in our SDKs Verifying VS Code debugger with default configuration works on tests in our SDKs Jul 20, 2020
@jeremymeng
Copy link
Member

  • when it gets in the way of the debugger (when mocha uses ts-node).

I'm curious on why nyc is affecting debugging when using ts-node.

@jeremymeng
Copy link
Member

The build pipelines run certain npm test scripts and upload the code coverage results. Please ensure that still work.

@xirzec
Copy link
Member

xirzec commented Jul 20, 2020

So there are two common use cases that I want to confirm still work:

  1. I can set a breakpoint in some unit test and hit F5, which should execute the unit tests and hit my breakpoint
  2. I can set a breakpoint in some sample code that lives in my source tree (e.g. an example usage of a client I am building) and I can F5 into that TS file and then step into the client, etc.

As long as those two cases work this is great!

@deyaaeldeen
Copy link
Member Author

@jeremymeng I guess it has something to do with source maps. I will do some digging and get back to you.

@xirzec So you do the following. Hit CTRL+SHIFT+D to open the debugger panel, click on "show" all automatic debug configurations (if you do not have other debug configs). choose Node.js (Preview) from the dropdown menu, and finally select your favorite npm testing script. Later, you can hit F5 to debug using that same npm script It remembers the automatic config you selected but sometimes it does not if it is the only config you have.

Regarding the second point, debugging samples in vscode is already not working currently on master, or does it?

@deyaaeldeen
Copy link
Member Author

@jeremymeng yup it is source maps related and is fixed by passing --produce-source-map to nyc, see TypeStrong/ts-node#898. However, this triggers the compilation of the whole sdk including samples and I see broken samples in core-arm.

@@ -7,22 +7,15 @@
{
"type": "node",
"request": "launch",
"name": "Current TS File",
"args": ["${fileBasename}"],
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
Copy link
Member Author

Choose a reason for hiding this comment

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

Why do we pass those arguments?

@jeremymeng jeremymeng added Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files) labels Jul 22, 2020
@deyaaeldeen
Copy link
Member Author

deyaaeldeen commented Jul 28, 2020

@ramya-rao-a in our offline discussion, there were two follow-up items
1- investigating running samples through the debugger, I created #10334.
2- investigating restricting the npm scripts accessible to the debugger.

I will look at them later and I believe they are not blocking merging this PR. Does the PR look good to you?

@deyaaeldeen
Copy link
Member Author

This has been sitting idle for too long, would you guys take a look? cc @willmtemple, @jeremymeng, @richardpark-msft, @XiaoningLiu @HarshaNalluru

@jeremymeng
Copy link
Member

/azp run js - storage-queue - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@deyaaeldeen deyaaeldeen merged commit 6531b9b into Azure:master Aug 11, 2020
@deyaaeldeen deyaaeldeen deleted the vscode-debug branch August 11, 2020 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
6 participants