Skip to content

Commit

Permalink
[wasm] Enable source generators tests that were failing due to OOM
Browse files Browse the repository at this point in the history
- `Microsoft.Extensions.Logging.Generators.Roslyn3.11.Tests`
- `Microsoft.Extensions.Logging.Generators.Roslyn4.0.Tests`
- `System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests`
- `System.Text.Json.SourceGeneration.Roslyn4.0.Unit.Tests`
- `System.Text.RegularExpressions.Generators.Tests`

Some individual ones are disabled due to
dotnet#58226, and
dotnet#60899 .

Fixes dotnet#51961 .
  • Loading branch information
radical committed Oct 27, 2021
1 parent 8436395 commit 9a6d859
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<RoslynApiVersion>$(MicrosoftCodeAnalysisCSharpWorkspacesVersion_3_11)</RoslynApiVersion>
<IsHighAotMemoryUsageTest>true</IsHighAotMemoryUsageTest>
</PropertyGroup>

<Import Project="Microsoft.Extensions.Logging.Generators.targets"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<PropertyGroup>
<RoslynApiVersion>$(MicrosoftCodeAnalysisCSharpWorkspacesVersion)</RoslynApiVersion>
<DefineConstants>$(DefineConstants);ROSLYN4_0_OR_GREATER</DefineConstants>
<IsHighAotMemoryUsageTest>true</IsHighAotMemoryUsageTest>
<EmccLinkOptimizationFlag Condition="'$(ContinuousIntegrationBuild)' == 'true'">-O1</EmccLinkOptimizationFlag>
<WasmNativeStrip>false</WasmNativeStrip>
</PropertyGroup>

<Import Project="Microsoft.Extensions.Logging.Generators.targets"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public class IndexViewModel
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/58226", TestPlatforms.Browser)]
public void NameClashSourceGeneration()
{
// Without resolution.
Expand All @@ -149,6 +150,7 @@ public void NameClashSourceGeneration()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/58226", TestPlatforms.Browser)]
public void ProgramsThatDontUseGeneratorCompile()
{
// No STJ usage.
Expand Down Expand Up @@ -192,6 +194,7 @@ public static void Main()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/58226", TestPlatforms.Browser)]
public void WarnOnClassesWithInitOnlyProperties()
{
Compilation compilation = CompilationHelper.CreateCompilationWithInitOnlyProperties();
Expand All @@ -206,6 +209,7 @@ public void WarnOnClassesWithInitOnlyProperties()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/58226", TestPlatforms.Browser)]
public void WarnOnClassesWithInaccessibleJsonIncludeProperties()
{
Compilation compilation = CompilationHelper.CreateCompilationWithInaccessibleJsonIncludeProperties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace System.Text.Json.SourceGeneration.UnitTests
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/58226", TestPlatforms.Browser)]
public class GeneratorTests
{
[Fact]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RoslynApiVersion>$(MicrosoftCodeAnalysisCSharpWorkspacesVersion_3_11)</RoslynApiVersion>
<IsHighAotMemoryUsageTest>true</IsHighAotMemoryUsageTest>
</PropertyGroup>

<Import Project="System.Text.Json.SourceGeneration.Unit.Tests.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<RoslynApiVersion>$(MicrosoftCodeAnalysisCSharpWorkspacesVersion)</RoslynApiVersion>
<DefineConstants>$(DefineConstants);ROSLYN4_0_OR_GREATER</DefineConstants>
<IsHighAotMemoryUsageTest>true</IsHighAotMemoryUsageTest>
</PropertyGroup>

<Import Project="System.Text.Json.SourceGeneration.Unit.Tests.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace System.Text.Json.SourceGeneration.UnitTests
public class TypeWrapperTests
{
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/58226", TestPlatforms.Browser)]
public void MetadataLoadFilePathHandle()
{
// Create a MetadataReference from new code.
Expand Down Expand Up @@ -79,6 +80,7 @@ public void MySecondMethod() { }
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/58226", TestPlatforms.Browser)]
public void CanGetAttributes()
{
string source = @"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ public static IEnumerable<object[]> Match_In_Different_Cultures_CriticalCases_Te
public static IEnumerable<object[]> Match_In_Different_Cultures_CriticalCases_TestData() =>
Match_In_Different_Cultures_CriticalCases_TestData_For(RegexOptions.None).Union(Match_In_Different_Cultures_CriticalCases_TestData_For(RegexOptions.Compiled));

[ActiveIssue("https://github.com/dotnet/runtime/issues/60899", TestPlatforms.Browser)]
[Theory]
[MemberData(nameof(Match_In_Different_Cultures_TestData))]
public void Match_In_Different_Cultures(string pattern, RegexOptions options, CultureInfo culture, string input, string match_expected)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<Nullable>enable</Nullable>
<!-- xUnit2008 is about regexes and isn't appropriate in the test project for regexes -->
<NoWarn>$(NoWarn);xUnit2008</NoWarn>
<IsHighAotMemoryUsageTest>true</IsHighAotMemoryUsageTest>
</PropertyGroup>

<ItemGroup>
Expand Down
9 changes: 0 additions & 9 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
</PropertyGroup>

<ItemGroup Condition="'$(TargetOS)' == 'Browser' and '$(BuildAOTTestsOnHelix)' == 'true' and '$(RunDisabledWasmTests)' != 'true' and '$(RunAOTCompilation)' == 'true'">
<!-- Exceeds VM resources in CI on compilation: https://github.com/dotnet/runtime/issues/51961 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Logging.Abstractions\tests\Microsoft.Extensions.Logging.Generators.Tests\Microsoft.Extensions.Logging.Generators.Roslyn3.11.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Logging.Abstractions\tests\Microsoft.Extensions.Logging.Generators.Tests\Microsoft.Extensions.Logging.Generators.Roslyn4.0.Tests.csproj" />
</ItemGroup>

<!-- Projects that don't support code coverage measurement. -->
Expand Down Expand Up @@ -223,12 +220,6 @@

<!-- https://github.com/dotnet/runtime/issues/58226 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.InteropServices\tests\DllImportGenerator.UnitTests\DllImportGenerator.Unit.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Unit.Tests\System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Unit.Tests\System.Text.Json.SourceGeneration.Roslyn4.0.Unit.Tests.csproj" />

<!-- hhttps://github.com/dotnet/runtime/issues/60048 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.RegularExpressions\tests\System.Text.RegularExpressions.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.RegularExpressions\tests\System.Text.RegularExpressions.Generators.Tests\System.Text.RegularExpressions.Generators.Tests.csproj" />
</ItemGroup>

<!-- Aggressive Trimming related failures -->
Expand Down

0 comments on commit 9a6d859

Please sign in to comment.