Skip to content
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

Clean up test skip conditions #17529

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 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 requested review from anurse, halter73 and jkotalik as code owners 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
@Tratcher Tratcher removed the area-security label Dec 2, 2019
@Tratcher

This comment has been minimized.

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)]

This comment has been minimized.

Copy link
@jkotalik

jkotalik Dec 2, 2019

Member

Lol this was a thing.

@Tratcher Tratcher force-pushed the tratcher/skipcleanup branch from 25503d4 to f4b302d Dec 4, 2019
@Tratcher Tratcher merged commit 5033efb into master Dec 5, 2019
19 checks passed
19 checks passed
triage
Details
AspNetCore-ci #20191204.30 succeeded
Details
AspNetCore-ci (Build Build: Linux ARM) Build Build: Linux ARM succeeded
Details
AspNetCore-ci (Build Build: Linux ARM64) Build Build: Linux ARM64 succeeded
Details
AspNetCore-ci (Build Build: Linux Musl ARM64) Build Build: Linux Musl ARM64 succeeded
Details
AspNetCore-ci (Build Build: Linux Musl x64) Build Build: Linux Musl x64 succeeded
Details
AspNetCore-ci (Build Build: Linux x64) Build Build: Linux x64 succeeded
Details
AspNetCore-ci (Build Build: Windows ARM) Build Build: Windows ARM succeeded
Details
AspNetCore-ci (Build Build: Windows x64/x86) Build Build: Windows x64/x86 succeeded
Details
AspNetCore-ci (Build Build: macOS) Build Build: macOS succeeded
Details
AspNetCore-ci (Build Code check) Build Code check succeeded
Details
AspNetCore-ci (Build Test: Linux Source Build) Build Test: Linux Source Build succeeded
Details
AspNetCore-ci (Build Test: Templates - Windows Server 2016 x64) Build Test: Templates - Windows Server 2016 x64 succeeded
Details
AspNetCore-ci (Build Test: Ubuntu 16.04 x64) Build Test: Ubuntu 16.04 x64 succeeded
Details
AspNetCore-ci (Build Test: Windows Server 2016 x64) Build Test: Windows Server 2016 x64 succeeded
Details
AspNetCore-ci (Build Test: macOS 10.13) Build Test: macOS 10.13 succeeded
Details
AspNetCore-ci (Build Tests: Helix x64) Build Tests: Helix x64 succeeded
Details
AspNetCore-helix-test #20191204.8 succeeded
Details
license/cla All CLA requirements met.
Details
@Tratcher Tratcher deleted the tratcher/skipcleanup branch Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.