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

Limit the number of generated tests to a random subset #61

Open
alrz opened this issue Feb 26, 2023 · 1 comment
Open

Limit the number of generated tests to a random subset #61

alrz opened this issue Feb 26, 2023 · 1 comment

Comments

@alrz
Copy link

alrz commented Feb 26, 2023

Given a set of generated test cases, it's useful to be able to select a random subset for each run to reduce the CI time, while keeping the original combinatorial definition intact. e.g.

[Theory]
[CombinatorialCount(30)] 
public void Test(...) {}

There's already a helper to do this Random.GetItem in dotnet 8p1 but I think it's easy to backport.

@AArnott
Copy link
Owner

AArnott commented Feb 26, 2023

I think we typically use the Pairwise attribute instead of Combinatorial to keep the set of generated tests to a reasonable number. When combinatorial results in a test case explosion, randomly picking 30 could be a grossly inadequate coverage, whereas Pairwise (or 3-wise, etc.) provides a more provably confident coverage amount. Have you tried the Pairwise attribute?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants