Tooling: xUnit output not showing for successful tests (Asp.Net Core RC2 tooling for VS 2015)

Created on 27 May 2016  路  15Comments  路  Source: aspnet/Tooling

The issue is with ASP.NET Core RC2 tooling in VisualStudio 2015.
Test output (ITestOutputhelper) is only shown when the test fails. If it succeeds there is not link to the output.

I used this capability to review generated SQL code against performance metrics.

Here is the project:

{
    "version": "1.0.0-*",

    "dependencies": {
        "NETStandard.Library": "1.5.0-rc2-24027",
        "xunit": "2.1.0-*",
        "dotnet-test-xunit": "1.0.0-*"
    },
    "frameworks": {
        "netcoreapp1.0": {
            "dependencies": {
                "Microsoft.NETCore.App": {
                    "type": "platform",
                    "version": "1.0.0-rc2-3002702"
                }
            },
            "imports": [
                "dnxcore50",
                "portable-net45+win8"
            ]
        }
    },
    "testRunner": "xunit"
}

Here is the test class:

     public class Class1 {
        readonly ITestOutputHelper output;

        public Class1(ITestOutputHelper output) {
            this.output = output;
        }

        [Fact]
        public void ShowOutput() {
            output.WriteLine("Inside Showoutput().");
            //Assert.Equal(2, 3);
        }
    }
TFS Tracked

Most helpful comment

Hi @sayedihashimi,

I think a solution for VS2015 is needed as some of us won't be moving to VS2017 for some time. Would it be possible that a release is made that works with VS2015?

All 15 comments

TFS: 226141
I've added this to our internal TFS, we will reply back here soon.

Any news @sayedihashimi. The lack of visibility of test logs is rather annoying.

Hello, I have the same behaviour as @kwaclaw.

In Visual Studio 2015, there is a link to test output if the test fails, but not if the test succeeds.

On the command line (dotnet test), test output prints if the test fails, but not if the test succeeds.

It seems there is also an older related issue #324.

+1

+1

No success even with the latest pre-release dotnet-test-xunit (2.2.0-preview3-build1047).

+1

+1

I broke down and cloned the dotnet-test-xunit repository, also fixed issue https://github.com/xunit/xunit/issues/934 and now I have a working build. At least it works for me. See attached file.

dotnet-test-xunit.99.99.99-dev.nupkg.zip

@kwaclaw - it would be helpful if you'd send that in a pull request so we can all benefit. I don't even see an xunit fork on your GitHub page.

@mj1856 I dont know the code base well enough to assume that my fix is the correct one. It just keeps me going in my work.

To be clear, this issue here is already fixed in the repo. All I did was build the repo with the additional fix described in https://github.com/xunit/xunit/issues/934.

So anyone trying to get this issue here fixed only needs to build from source.

Sorry for the delay here. We've had a lot of updates over the past few months and I believe that this is working now in VS2017 RC. Can you try with the latest VS2017 and try again? I'll close this now, but please reopen if this issue still persists.

Hi @sayedihashimi,

I think a solution for VS2015 is needed as some of us won't be moving to VS2017 for some time. Would it be possible that a release is made that works with VS2015?

Hi @sayedihashimi,

Can I reopen this issue?

Was this page helpful?
0 / 5 - 0 ratings