jcansdale / TestDriven.Net-Issues

Issue tracking for TestDriven.Net
https://github.com/jcansdale/TestDriven.Net-Issues/issues
24 stars 2 forks source link

Cannot navigate to test failures from the output window with xUnit tests #70

Open jeremydmiller opened 7 years ago

jeremydmiller commented 7 years ago

I mentioned this one on Twitter a couple weeks ago. Using xUnit with a project.json project, TD.Net seems to run the tests against a Release build so you can't navigate from stacktrace failures in the output window because there are no line numbers in the stacktrace.

Any idea what's going on here?

jcansdale commented 7 years ago

Can I see your project.json?

jeremydmiller commented 7 years ago
{
  "version": "1.0.0-*",
  "buildOptions": {
    "debugType": "portable"
  },
  "dependencies": {
    "System.Runtime.Serialization.Primitives": "4.1.1",
    "xunit": "2.2.0-beta3-build3402",
    "dotnet-test-xunit": "2.2.0-preview2-build1029",
    "StoryTeller": { "target": "project" },
    "ST": { "target": "project" },
    "Specifications": { "target": "project" },
    "Samples": { "target": "project" },
    "MultipleSystems": { "target": "project" },
    "BadSystem": { "target": "project" },
    "InvalidExamples": { "target": "project" },
    "StoryTeller.Samples": { "target": "project" },
    "StoryTeller.Gallery": { "target": "project" },
    "Shouldly": "2.8.2",
    "NSubstitute": "2.0.0-rc",
    "xunit.runner.visualstudio": "2.2.0-beta3-build1187"
  },
  "testRunner": "xunit",
  "frameworks": {
    "net46": {} ,

    "netcoreapp1.0": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "type": "platform",
          "version": "1.0.0"
        }
      },
      "imports": [
        "dotnet5.4",
        "portable-net451+win8"
      ]
    }
  }
}
jcansdale commented 7 years ago

@jeremydmiller,

This appears to be the culprit:

  "buildOptions": {
    "debugType": "portable"
  },

When "debugType" is "portable", you only seem to get file/line info when running under .NET Core. If you comment this out, file/line info appears for both .NET Core and Framework.

Is there a reason you have to use "portable"? I'm guessing "portable" might be required when running on non-Windows platforms?

jcansdale commented 7 years ago

@jeremydmiller,

Could you try changing your frameworks section to this:

  "frameworks": {
    "net46": { },
    "netcoreapp1.0": {
      "buildOptions": {
        "debugType": "portable"
      },

I think that might do the trick, since "net46" is a Windows only thing. 😄