Skip to content

Commit

Permalink
Merge pull request #1179 from Zocdoc/issue_1138
Browse files Browse the repository at this point in the history
Exclude the partition filter from test expansion
  • Loading branch information
OsirisTerje authored Jul 18, 2024
2 parents 9f5391f + 8b62d78 commit e0c21e5
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 e0c21e5

Please sign in to comment.