Skip to content

Clean up test skip conditions #17529

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

Merged
merged 5 commits into from
Dec 5, 2019
Merged

Clean up test skip conditions #17529

merged 5 commits into from
Dec 5, 2019

Conversation

Tratcher
Copy link
Member

@Tratcher Tratcher commented Dec 2, 2019

This is a general cleanup of skip conditions and OS version checks

  • Use the new MaximumOSVersion attribute and remove a custom local version.
  • Switch from OSSkipCondition to MinimumOSVersion, I'll send an extensions PR to remove version check support from OSSkipCondition.
  • Remove checks for WindowsVersions.Win2008R2, it's the same value as Win7. I'll send an extensions PR to remove Win2008R2.
  • UnFlaky'd the HttpSys Https tests. The linked issue didn't give any details for why they were marked Flaky and the only linked builds have expired.

@Tratcher Tratcher added this to the 2.1.x milestone Dec 2, 2019
@Tratcher Tratcher self-assigned this Dec 2, 2019
@Tratcher Tratcher modified the milestones: 2.1.x, 5.0.0-preview1 Dec 2, 2019
@github-actions github-actions bot added area-auth Includes: Authn, Authz, OAuth, OIDC, Bearer area-servers labels Dec 2, 2019
@Tratcher Tratcher removed the area-auth Includes: Authn, Authz, OAuth, OIDC, Bearer label Dec 2, 2019
@Tratcher
Copy link
Member Author

Tratcher commented Dec 2, 2019

Found a bug in my last MaximumOSVersionAttribute change that copied a Version object. Apparently the value for unspecified segments is -1, which the constructor refuses.

[xUnit.net 00:00:00.68] Microsoft.AspNetCore.Server.Kestrel.Tests: Exception thrown during theory discovery on 'Microsoft.AspNetCore.Server.Kestrel.Tests.KestrelConfigurationBuilderTests.DefaultConfigSectionCanSetProtocols_MacAndWin7'; falling back to single test case.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.ArgumentOutOfRangeException: Version's parameters must be greater than or equal to zero. (Parameter 'build')
   at System.Version..ctor(Int32 major, Int32 minor, Int32 build)
   at Microsoft.AspNetCore.Testing.MaximumOSVersionAttribute..ctor(OperatingSystems targetOS, Version maxVersion, OperatingSystems currentOS, Version currentVersion)
   at Microsoft.AspNetCore.Testing.MaximumOSVersionAttribute..ctor(OperatingSystems operatingSystem, String maxVersion)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at Xunit.Sdk.ReflectionAttributeInfo.Instantiate(CustomAttributeData attributeData) in C:\Dev\xunit\xunit\src\xunit.execution\Sdk\Reflection\ReflectionAttributeInfo.cs:line 136
   at Xunit.Sdk.ReflectionMethodInfo.GetCustomAttributes(MethodInfo method, Type attributeType, AttributeUsageAttribute attributeUsage) in C:\Dev\xunit\xunit\src\xunit.execution\Sdk\Reflection\ReflectionMethodInfo.cs:line 100
   at Xunit.Sdk.ReflectionMethodInfo.GetCustomAttributes(MethodInfo method, String assemblyQualifiedAttributeTypeName) in C:\Dev\xunit\xunit\src\xunit.execution\Sdk\Reflection\ReflectionMethodInfo.cs:line 87
   at Xunit.Sdk.ReflectionMethodInfo.GetCustomAttributes(String assemblyQualifiedAttributeTypeName) in C:\Dev\xunit\xunit\src\xunit.execution\Sdk\Reflection\ReflectionMethodInfo.cs:line 80
   at Microsoft.AspNetCore.Testing.TestMethodExtensions.EvaluateSkipConditions(ITestMethod testMethod)
   at Microsoft.AspNetCore.Testing.ConditionalTheoryDiscoverer.CreateTestCasesForDataRow(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo theoryAttribute, Object[] dataRow)
   at Xunit.Sdk.TheoryDiscoverer.Discover(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo theoryAttribute) in C:\Dev\xunit\xunit\src\xunit.execution\Sdk\Frameworks\TheoryDiscoverer.cs:line 238

@@ -110,8 +103,7 @@ public async Task Https_ClientCertRequested_ClientCertPresent()
}

[ConditionalFact]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2209", FlakyOn.Helix.All)]
[OSDontSkipCondition(OperatingSystems.Windows, WindowsVersions.Win7, WindowsVersions.Win2008R2)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol this was a thing.

@Tratcher Tratcher force-pushed the tratcher/skipcleanup branch from 25503d4 to f4b302d Compare December 4, 2019 19:25
@github-actions github-actions bot added the area-auth Includes: Authn, Authz, OAuth, OIDC, Bearer label Dec 4, 2019
@Tratcher Tratcher merged commit 5033efb into master Dec 5, 2019
@Tratcher Tratcher deleted the tratcher/skipcleanup branch December 5, 2019 12:42
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-auth Includes: Authn, Authz, OAuth, OIDC, Bearer area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants