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

Debug Tests on a Class Library Project #787

Closed
robvanpamel opened this issue Sep 27, 2016 · 8 comments
Closed

Debug Tests on a Class Library Project #787

robvanpamel opened this issue Sep 27, 2016 · 8 comments

Comments

@robvanpamel
Copy link

robvanpamel commented Sep 27, 2016

Environment data

dotnet --info output:
.NET Command Line Tools (1.0.0-preview2-003131)

Product Information:
Version: 1.0.0-preview2-003131
Commit SHA-1 hash: 635cf40e58

Runtime Environment:
OS Name: ubuntu
OS Version: 16.04
OS Platform: Linux
RID: ubuntu.16.04-x64

VS Code version: 1.5.3
C# Extension version: 1.5.0-beta1

Steps to reproduce

  1. Create "Class Library Project" with a class to test in it (SUT) .
    project file looks like this:
    '{
    "version": "1.0.0-*",
    "dependencies": {
    },
    "frameworks": {
    "netcoreapp1.0": {
    "dependencies": {
    "Microsoft.NETCore.App": {
    "type": "platform",
    "version": "1.0.0"
    }
    }
    }
    }
    }'

  2. Create another class library (which will act as test project)
    project file looks like this.
    ´{
    "version": "1.0.0-*",
    "testRunner": "xunit",
    "buildOptions": {

    "debugType": "portable"
    },
    "dependencies": {
    "SAG.NextGen.MessageBroker": "1.0.0-*",
    "xunit": "2.2.0-beta2-build3300",
    "dotnet-test-xunit": "2.2.0-preview2-build1029"
    },
    "frameworks": {
    "netcoreapp1.0": {
    "dependencies": {
    "Microsoft.NETCore.App": {
    "type": "platform",
    "version": "1.0.0"
    }
    }
    }
    }

  3. Create class Calculator with add method in Class Library Project

  4. Create class CalculatorTestFixture with TestAdd method in Test project second.

  5. Add Fact attribute on TestAdd Method.

  6. Call Add method from Class Library Project

  7. Add breakpoint in the TestAdd Method

  8. Click on the debug link above the TestAdd Method

Expected behavior

Debugging is started on the test method

Actual behavior

An exception is thrown and a red bar appears in VSCode

Failed to start debugger on test because Error: Debug adapter executable '/home/rvpamel/.vscode/extensions/ms-vscode.csharp-1.5.0-beta1/out/coreclr-debug/proxy.js' not found..

Edit : When adding a Program and main method i'm able to debug the unit test but this shouldn't be the case

@gregg-miskelly
Copy link
Contributor

@robvanpamel do you have the file mentioned in the error message? I don't understand what that file would be missing, though maybe the error message is just BS and the real problem is something else.

@robvanpamel
Copy link
Author

robvanpamel commented Sep 29, 2016

@gregg-miskelly
The file is not there, however the file exists at this location (mind the additional 'src' folder )
/home/rvpamel/.vscode/extensions/ms-vscode.csharp-1.5.0-beta1/out/src/coreclr-debug

Maybe interesting to mention is that upgraded from the current version to this beta version. (if I downgrade this works again ...)

@gregg-miskelly
Copy link
Contributor

@robvanpamel this looks like something that was broken in 1.5.0-beta1. @DustinCampbell based on da488c5 I assume this is an expected side effect of 94ca7e7 and we should update package.json. Is that correct?

@DustinCampbell
Copy link
Member

where is this specified in package.json?

@gregg-miskelly
Copy link
Contributor

@DustinCampbell
Copy link
Member

Ah, yes. Sorry, the package.json had gotten updated on my machine because I was debugging the extension with Node debugger.

Yup, that needs fixing. I'll submit a fix shortly.

@DustinCampbell
Copy link
Member

sorry for missing that.

@DustinCampbell
Copy link
Member

I've produced a new beta, v1.5-beta2, that should address this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants