Skip to content

When running with --test-modules and --filter, allow "zero tests ran" behavior to apply to entire run vs individual modules #7457

@jbcutting

Description

@jbcutting

Summary

When using dotnet test with --test-modules and a --filter, it should be possible to request (via parameter) that the zero tests ran failure should happen for the entire run instead of for each module.

Background and Motivation

We frequently use a filter in our test runs to run subsets of tests, especially in pipelines. We might only run Priority 1 tests or run a category of tests for a product feature. When doing this, any module with no matches causes the "Zero tests ran" error to be output. With lots of test modules, this yields a lot of potential errors when we know some won't have a match for the filter.

Proposed Feature

I know it's possible to use --ignore-exit-code 8 to suppress the error entirely. However, it's still valuable to have a "zero tests ran" error for the full run instead of one per module. It would be beneficial to have a parameter that makes this behavior apply to the full run at a summary level.

I've also noticed --minimum-expected-tests 0 still fails for each module if there are zero tests run. It seems like --minimum-expected-tests 0 should have the same outcome as --ignore-exit-code 8.

Extending from that, a parameter such as --minimum-expected-tests-for-all-test-modules n might be a way to support the requested behavior.

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