Skip to content

Commit

Permalink
don't expand the partition filter
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-smith-zocdoc committed Jul 14, 2024
1 parent 9f5391f commit 8b62d78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/NUnitTestAdapter/Execution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ protected TestFilter CheckFilter(TestFilter testFilter, IDiscoveryConverter disc
}
return testFilter;
}
if (testFilter.IsPartitionFilter())
{
return testFilter;
}
var filterBuilder = CreateTestFilterBuilder();
return filterBuilder.FilterByList(discovery.LoadedTestCases);
}
Expand Down
3 changes: 3 additions & 0 deletions src/NUnitTestAdapter/NUnitEngine/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public static bool AllWithEmptyFalse<T>(this IEnumerable<T> list, Func<T, bool>
public static bool IsCategoryFilter(this TestFilter filter) =>
filter != TestFilter.Empty && filter.Text.Contains("<cat>");

public static bool IsPartitionFilter(this TestFilter filter) =>
filter != TestFilter.Empty && filter.Text.Contains("<partition>");

public static bool IsNegativeCategoryFilter(this TestFilter filter) =>
filter.IsCategoryFilter() && filter.Text.Contains("<not><cat>");
}

0 comments on commit 8b62d78

Please sign in to comment.