Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
3c637d7
Update dependencies from https://github.com/dotnet/runtime build 2022…
dotnet-maestro[bot] Aug 24, 2022
e58c862
Update dependencies from https://github.com/dotnet/runtime build 2022…
dotnet-maestro[bot] Aug 25, 2022
f78debf
Update dependencies from https://github.com/dotnet/runtime build 2022…
dotnet-maestro[bot] Aug 26, 2022
d6efb7c
Update dependencies from https://github.com/dotnet/runtime build 2022…
dotnet-maestro[bot] Aug 27, 2022
92aec57
Update dependencies from https://github.com/dotnet/runtime build 2022…
dotnet-maestro[bot] Aug 28, 2022
ba2c4a8
Update dependencies from https://github.com/dotnet/runtime build 2022…
dotnet-maestro[bot] Aug 30, 2022
900dfc3
Update dependencies from https://github.com/dotnet/runtime build 2022…
dotnet-maestro[bot] Aug 31, 2022
0bb3a6d
Update dependencies from https://github.com/dotnet/runtime build 2022…
dotnet-maestro[bot] Sep 1, 2022
ecabb4d
Don't treat the "cannot load analyzer" warning as an error in the tes…
jkoritzinsky Sep 1, 2022
bd42170
Append to WarningsNotAsErrors
jkoritzinsky Sep 1, 2022
6293323
Update dependencies from https://github.com/dotnet/runtime build 2022…
dotnet-maestro[bot] Sep 2, 2022
3c73282
Update dependencies from https://github.com/dotnet/runtime build 2022…
dotnet-maestro[bot] Sep 3, 2022
1564131
Update dependencies from https://github.com/dotnet/runtime build 2022…
dotnet-maestro[bot] Sep 4, 2022
f3650ca
Merge branch 'main' of https://github.com/dotnet/sdk into darc-main-3…
Sep 5, 2022
9c8f90a
update Blazor assets test
pavelsavara Sep 5, 2022
a4eddd2
Update dependencies from https://github.com/dotnet/runtime build 2022…
dotnet-maestro[bot] Sep 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Don't treat the "cannot load analyzer" warning as an error in the tes…
…ts that treat all warnings as errors.
  • Loading branch information
jkoritzinsky committed Sep 1, 2022
commit ecabb4d4e3a67586114f966efe478d4462b03e45
9 changes: 9 additions & 0 deletions src/Assets/TestProjects/WatchNoDepsApp/WatchNoDepsApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
<TargetFramework>$(CurrentTargetFramework)</TargetFramework>
<OutputType>exe</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!--
Don't error when generators/analyzers can't be loaded.
This can occur when running tests against FullFramework MSBuild
if the build machine has an MSBuild install with an older version of Roslyn
than the generators in the SDK reference. We aren't testing the generators here
and this failure will occur more clearly in other places when it's
actually an important failure, so don't error out here.
-->
<WarningsNotAsErrors>CS9057</WarningsNotAsErrors>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public void FilesFromAspNetCoreSharedFrameworkAreNotIncluded()
outputDirectory.Should().NotHaveFile("Microsoft.Extensions.DependencyInjection.Abstractions.dll");
}

[Fact]
[CoreMSBuildOnlyFact]
public void AnalyzersAreConflictResolved()
{
var testProject = new TestProject()
Expand All @@ -248,6 +248,14 @@ public void AnalyzersAreConflictResolved()
project.Root.Add(itemGroup);
itemGroup.Add(new XElement(ns + "EnableNETAnalyzers", "true"));
itemGroup.Add(new XElement(ns + "TreatWarningsAsErrors", "true"));

// Don't error when generators/analyzers can't be loaded.
// This can occur when running tests against FullFramework MSBuild
// if the build machine has an MSBuild install with an older version of Roslyn
// than the generators in the SDK reference. We aren't testing the generators here
// and this failure will occur more clearly in other places when it's
// actually an important failure, so don't error out here.
itemGroup.Add(new XElement(ns + "WarningsNotAsErrors", "CS9057"));
});

var buildCommand = new BuildCommand(testAsset);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1672,6 +1672,15 @@ private TestProject CreateTestProjectWithAnalysisWarnings(string targetFramework
TargetFrameworks = targetFramework,
IsExe = isExe
};

// Don't error when generators/analyzers can't be loaded.
// This can occur when running tests against FullFramework MSBuild
// if the build machine has an MSBuild install with an older version of Roslyn
// than the generators in the SDK reference. We aren't testing the generators here
// and this failure will occur more clearly in other places when it's
// actually an important failure, so don't error out here.
// If we're actually testing that we build with no warnings, the test will still fail.
testProject.AdditionalProperties["WarningsNotAsErrors"] = "CS9057";

testProject.SourceFiles[$"{projectName}.cs"] = @"
using System;
Expand Down