Skip to content

Commit 306ef04

Browse files
author
John Luo
authored
Conditionally enable/disable targeting pack tests (#20255)
1 parent e3c705d commit 306ef04

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
<_Parameter1>TargetingPackLayoutRoot</_Parameter1>
3737
<_Parameter2>$(TargetingPackLayoutRoot)</_Parameter2>
3838
</AssemblyAttribute>
39+
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
40+
<_Parameter1>IsTargetingPackBuilding</_Parameter1>
41+
<_Parameter2>$(IsTargetingPackBuilding)</_Parameter2>
42+
</AssemblyAttribute>
3943
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
4044
<_Parameter1>VerifyAncmBinary</_Parameter1>
4145
<_Parameter2>$(VerifyAncmBinary)</_Parameter2>

src/Framework/test/TargetingPackTests.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,24 @@ public class TargetingPackTests
2020
private readonly string _expectedRid;
2121
private readonly string _targetingPackRoot;
2222
private readonly ITestOutputHelper _output;
23+
private readonly bool _isTargetingPackBuilding;
2324

2425
public TargetingPackTests(ITestOutputHelper output)
2526
{
2627
_output = output;
2728
_expectedRid = TestData.GetSharedFxRuntimeIdentifier();
2829
_targetingPackRoot = Path.Combine(TestData.GetTestDataValue("TargetingPackLayoutRoot"), "packs", "Microsoft.AspNetCore.App.Ref", TestData.GetTestDataValue("TargetingPackVersion"));
30+
_isTargetingPackBuilding = bool.Parse(TestData.GetTestDataValue("IsTargetingPackBuilding"));
2931
}
3032

31-
[Fact(Skip="https://github.com/aspnet/AspNetCore/issues/14832")]
33+
[Fact]
3234
public void AssembliesAreReferenceAssemblies()
3335
{
36+
if (!_isTargetingPackBuilding)
37+
{
38+
return;
39+
}
40+
3441
IEnumerable<string> dlls = Directory.GetFiles(_targetingPackRoot, "*.dll", SearchOption.AllDirectories);
3542
Assert.NotEmpty(dlls);
3643

@@ -55,9 +62,14 @@ public void AssembliesAreReferenceAssemblies()
5562
});
5663
}
5764

58-
[Fact(Skip="https://github.com/aspnet/AspNetCore/issues/14832")]
65+
[Fact]
5966
public void PlatformManifestListsAllFiles()
6067
{
68+
if (!_isTargetingPackBuilding)
69+
{
70+
return;
71+
}
72+
6173
var platformManifestPath = Path.Combine(_targetingPackRoot, "data", "PlatformManifest.txt");
6274
var expectedAssemblies = TestData.GetSharedFxDependencies()
6375
.Split(';', StringSplitOptions.RemoveEmptyEntries)

0 commit comments

Comments
 (0)