Conditionally enable/disable targeting pack tests (#20255)

This commit is contained in:
John Luo 2020-03-28 18:04:20 -07:00 committed by GitHub
parent e3c705dbc2
commit 306ef044cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View File

@ -36,6 +36,10 @@
<_Parameter1>TargetingPackLayoutRoot</_Parameter1>
<_Parameter2>$(TargetingPackLayoutRoot)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
<_Parameter1>IsTargetingPackBuilding</_Parameter1>
<_Parameter2>$(IsTargetingPackBuilding)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
<_Parameter1>VerifyAncmBinary</_Parameter1>
<_Parameter2>$(VerifyAncmBinary)</_Parameter2>

View File

@ -20,17 +20,24 @@ namespace Microsoft.AspNetCore
private readonly string _expectedRid;
private readonly string _targetingPackRoot;
private readonly ITestOutputHelper _output;
private readonly bool _isTargetingPackBuilding;
public TargetingPackTests(ITestOutputHelper output)
{
_output = output;
_expectedRid = TestData.GetSharedFxRuntimeIdentifier();
_targetingPackRoot = Path.Combine(TestData.GetTestDataValue("TargetingPackLayoutRoot"), "packs", "Microsoft.AspNetCore.App.Ref", TestData.GetTestDataValue("TargetingPackVersion"));
_isTargetingPackBuilding = bool.Parse(TestData.GetTestDataValue("IsTargetingPackBuilding"));
}
[Fact(Skip="https://github.com/aspnet/AspNetCore/issues/14832")]
[Fact]
public void AssembliesAreReferenceAssemblies()
{
if (!_isTargetingPackBuilding)
{
return;
}
IEnumerable<string> dlls = Directory.GetFiles(_targetingPackRoot, "*.dll", SearchOption.AllDirectories);
Assert.NotEmpty(dlls);
@ -55,9 +62,14 @@ namespace Microsoft.AspNetCore
});
}
[Fact(Skip="https://github.com/aspnet/AspNetCore/issues/14832")]
[Fact]
public void PlatformManifestListsAllFiles()
{
if (!_isTargetingPackBuilding)
{
return;
}
var platformManifestPath = Path.Combine(_targetingPackRoot, "data", "PlatformManifest.txt");
var expectedAssemblies = TestData.GetSharedFxDependencies()
.Split(';', StringSplitOptions.RemoveEmptyEntries)