Skip to content

Incorrect Exit Code For Skipped Tests In Lower SDK Versions #7150

@pnquest

Description

@pnquest

Describe the bug

When using what appears to be most/all .net sdks less than the latest .net 10 sdk, The dotnet test command seems to return exit code 1 instead of 8 when run against a solution with multiple test projects and one of the projects tests are completely filtered out by the condition in a --treenode-filter flag.

Steps To Reproduce

  1. Install a lower sdk (this has been tested with the original .net 10 sdk release and the latest .net 8 sdk release. Using global.json to configure which sdk is used works fine for this when you have multiple installed.)
  2. Make a solution with 2 test projects (I was using TUnit). Put 1 test in each test project and set different Category on both tests.
  3. Run dotnet test -- treenode-filter /*/*/*/*[Category=<One of the names>]

Expected behavior

Should return exit code 8

Actual behavior

Returns exit code 1

Additional context

See original issue opened on the TUnit Repo thomhurst/TUnit#4102
Oddly enough if I also include --ignore-exit-code 8 it results in exit code 0.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions