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

[NETSDKE2E]The error count displays incorrectly in output of dotnet test xunit. #10050

Open
vdanche opened this issue Apr 22, 2024 · 4 comments
Labels
Area: Terminal Logger Problems with the livelogger/fancylogger/terminallogger -tl functionality. backlog bug needs-design Requires discussion with the dev team before attempting a fix. Priority:3 Work that is nice to have triaged

Comments

@vdanche
Copy link
Member

vdanche commented Apr 22, 2024

Issue Description

Build info:
9.0.100-preview.4.24221.5

The error account displays incorrectly in output of dotnet test xunit.

Steps to Reproduce

In CLI: dotnet new xunit -o myxunit
add below codes

namespace myxunit;

public class UnitTest1
{
    [Fact]
    public void Test3()
    {

    }
    [Fact]
    public void Test1()
    {
Assert.Equal(12, 11);
    }
    [Fact]
    public void Test2()
    {
Assert.Equal(11, 11);
    }
}

dotnet test

Expected Behavior

The log can be displayed well.

Actual Behavior

The log displays "Build failed with 2 errors", but error and error VSTEST1 for test 1 method should be considered an error)
image

8.0
image

Analysis

No response

Versions & Configurations

No response

@vdanche vdanche added the bug label Apr 22, 2024
@vdanche vdanche changed the title [NETSDKE2E]The error account displays incorrectly in output of dotnet test xunit. [NETSDKE2E]The error count displays incorrectly in output of dotnet test xunit. Apr 22, 2024
@v-xiaofchen
Copy link

This issue also repro on MacOS

@ChenhuiYuan01
Copy link
Member

This issue also repro on Linux

@nohwnd
Copy link
Member

nohwnd commented Apr 23, 2024

This is not a bug, the failed test count is 1 which is correct. The number of errors in build is 2, because xunit reports their error, and we report the error from vstest, so there are 2.

This is the same behavior as in the current execution without terminal logger:

image

The highlighted message is error output that is sent by xunit.

@nohwnd
Copy link
Member

nohwnd commented Apr 23, 2024

I do agree it is confusing though because if there are only tests failing in the run, and no additional errors, then it is difficult to see why the counts are not matching.

@AR-May AR-May added backlog needs-design Requires discussion with the dev team before attempting a fix. triaged Area: Terminal Logger Problems with the livelogger/fancylogger/terminallogger -tl functionality. Priority:3 Work that is nice to have labels Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Terminal Logger Problems with the livelogger/fancylogger/terminallogger -tl functionality. backlog bug needs-design Requires discussion with the dev team before attempting a fix. Priority:3 Work that is nice to have triaged
Projects
None yet
Development

No branches or pull requests

5 participants