Closed mthalman closed 1 year ago
I made some changes to handle a case where it was still running into the XUnit issue of having an empty set for the member data. That can happen when the paths filter causes the image for a given image type to be filtered out. For example, a 3.5 test leg would have the following paths specified:
There is no wcf path here, by design, so this causes the WCF tests to end up with an empty set of image data and XUnit throws. To work around this, I've added code to compensate for this scenario by injecting a null ImageDescriptor
as a placeholder to allow the test to detect and skip execution in that case. I've also added some validation logic to ensure we only end up in that state for this expected scenario. This also applies to the SDK-only tests.
This updates the test project to reflect the changes that were made in https://github.com/dotnet/dotnet-docker/pull/4207 and to conform to the new test script contract defined by https://github.com/dotnet/docker-tools/pull/1082. This means the test project no longer filters tests by product version but rather by Dockerfile path.
This change made it very cumbersome to attempt to adapt the existing
SkippableTheoryAttribute
class to use the Dockerfile path data in order to determine which tests to skip. So instead of doing that, I got rid of it entirely and went with a different approach. Each of the test projects defined its own set of test data. This data was largely duplicated amongst the classes except for WCF and SDK tests which needed to limit which versions they tested (hence the need forSkippableTheoryAttribute
).I consolidated all of that test data into one set which all the test classes use. Then I made use of the
Xunit.SkippableFact
NuGet package. This provides its ownSkippableTheoryAttribute
that, when used, allows the code to throw aSkipException
to indicate that the test should be skipped. It also provides some helper methods that will throw aSkipException
based on a condition. This then allowed me to reimplement the skip logic based on version in a much more straightforward manner.