Closed matan-yadgar closed 2 days ago
Whether the custom ITestCollectionOrderer
is appropriate or resolve you problem?
No - the ITestCollectionOrderer
sets the order between collections - not the order of classes in the same collection. The only way to set class order is using the XunitTestCollectionRunner
as mentioned above
ITestCaseOrderer
?
See test.
This feature request is not related to an open bug/issue - AFAIK
The feature request description is:
I'd like to control the test class execution order in my test project.
In xUnit - it is implemented by: 1) inheriting "XunitTestCollectionRunner" class and overriding the "protected override async Task RunTestClassesAsync()" function
2) using the implemented runner with TestFrameExecutor and AssemblyRunner
3) setting this framework on an assembly level in the AssemblyInfo.cs file like so:
[assembly: TestFramework("Path.To.TestFramework.Namespce", "ProjectName")]
Xunit.DependencyInjection package sets its own test framework.
Adding another TestFramework is invalid.
Hence there is no possibility to control test class execution order inside a collection.
The Xunit.DependencyInjection framework is sealed so it cant be inherited and re-implemented.
I suggest: 1 - honestly - Im not very familiar with this repo so the technical options Im aware of are limited 2 - maybe dont seal the "DependencyInjectionTestFramework"? 3 - allow inhriting the "TestCollectionRunner" in a manner that the new implementation is used instead of the base class 4 - allow somehow overriding the function that sorts the test classes inside a collection