-
Notifications
You must be signed in to change notification settings - Fork 444
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
Make SmokeTests use repo infrastructure #19290
Conversation
eaeebd9
to
c3d4094
Compare
This allows the test project to just be invoked with `dotnet test` or `dotnet build /t:Test` after the VMR is built. 1. Stop depending on environment variables for state instead use RuntimeConfiguration values same as UnifiedBuild test project. Allow facts and theories to be conditioned based on boolean values instead of env vars. 2. Update the README with the new msbuild property switch names 3. Delete dead-code and the checked-in .sln file
c3d4094
to
a3a75bd
Compare
src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/ArtifactsSizeTest.cs
Show resolved
Hide resolved
src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/LicenseScanTests.cs
Outdated
Show resolved
Hide resolved
src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/OmniSharpTests.cs
Show resolved
Hide resolved
src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/README.md
Show resolved
Hide resolved
Found an AFAICT unintended breaking change in the FileSytemGlobbing API between 8.0.0 and 9.0 Preview 1 and filed an issue for it: dotnet/runtime#100762 I worked around it by downgrading the packages to 8.0.0. |
Validation builds:
Summary:
<PrebuiltLeakReport>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/DotnetTools/dotnet-format/Microsoft.CodeAnalysis.AnalyzerUtilities.dll">
<Type>AssemblyAttribute</Type>
</File>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/DotnetTools/dotnet-watch/x.y.z/tools/netx.y/any/Microsoft.CodeAnalysis.AnalyzerUtilities.dll">
<Type>AssemblyAttribute</Type>
</File>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/Sdks/Microsoft.NET.Sdk/analyzers/cs/Microsoft.CodeAnalysis.NetAnalyzers.resources.dll">
<Type>AssemblyAttribute</Type>
</File>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/Sdks/Microsoft.NET.Sdk/analyzers/de/Microsoft.CodeAnalysis.NetAnalyzers.resources.dll">
<Type>AssemblyAttribute</Type>
</File>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/Sdks/Microsoft.NET.Sdk/analyzers/es/Microsoft.CodeAnalysis.NetAnalyzers.resources.dll">
<Type>AssemblyAttribute</Type>
</File>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/Sdks/Microsoft.NET.Sdk/analyzers/fr/Microsoft.CodeAnalysis.NetAnalyzers.resources.dll">
<Type>AssemblyAttribute</Type>
</File>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/Sdks/Microsoft.NET.Sdk/analyzers/it/Microsoft.CodeAnalysis.NetAnalyzers.resources.dll">
<Type>AssemblyAttribute</Type>
</File>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/Sdks/Microsoft.NET.Sdk/analyzers/ja/Microsoft.CodeAnalysis.NetAnalyzers.resources.dll">
<Type>AssemblyAttribute</Type>
</File>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/Sdks/Microsoft.NET.Sdk/analyzers/ko/Microsoft.CodeAnalysis.NetAnalyzers.resources.dll">
<Type>AssemblyAttribute</Type>
</File>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/Sdks/Microsoft.NET.Sdk/analyzers/Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll">
<Type>AssemblyAttribute</Type>
</File>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/Sdks/Microsoft.NET.Sdk/analyzers/Microsoft.CodeAnalysis.NetAnalyzers.dll">
<Type>AssemblyAttribute</Type>
</File>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/Sdks/Microsoft.NET.Sdk/analyzers/Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers.dll">
<Type>AssemblyAttribute</Type>
</File>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/Sdks/Microsoft.NET.Sdk/analyzers/pl/Microsoft.CodeAnalysis.NetAnalyzers.resources.dll">
<Type>AssemblyAttribute</Type>
</File>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/Sdks/Microsoft.NET.Sdk/analyzers/pt-BR/Microsoft.CodeAnalysis.NetAnalyzers.resources.dll">
<Type>AssemblyAttribute</Type>
</File>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/Sdks/Microsoft.NET.Sdk/analyzers/ru/Microsoft.CodeAnalysis.NetAnalyzers.resources.dll">
<Type>AssemblyAttribute</Type>
</File>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/Sdks/Microsoft.NET.Sdk/analyzers/tr/Microsoft.CodeAnalysis.NetAnalyzers.resources.dll">
<Type>AssemblyAttribute</Type>
</File>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/Sdks/Microsoft.NET.Sdk/analyzers/zh-Hans/Microsoft.CodeAnalysis.NetAnalyzers.resources.dll">
<Type>AssemblyAttribute</Type>
</File>
<File Path="artifacts/assets/Release/dotnet-sdk-x.y.z/sdk/x.y.z/Sdks/Microsoft.NET.Sdk/analyzers/zh-Hant/Microsoft.CodeAnalysis.NetAnalyzers.resources.dll">
<Type>AssemblyAttribute</Type>
</File>
</PrebuiltLeakReport> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future, consider breaking up changes like this into separate PRs to allow for more focused reviews. I feel like this could have easily been 3 separate PRs or even more.
@@ -15,6 +15,7 @@ | |||
</ItemGroup> | |||
|
|||
<ItemGroup> | |||
<EnvironmentVariables Include="NUGET_PACKAGES=$(NuGetPackageRoot)" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this have to do with test infrastructure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before, we globally set NUGET_PACKAGES but we don't do that anymore so that we can have a separate nuget package cache for the VMR tests. Nuget-client is the only repo that doesn't respect the NUGET_PACKAGES env var that is provided by Arcade because they don't use Arcade: https://github.com/dotnet/arcade/blob/f54c598d137ab88bd473ea670b3c751be0540244/src/Microsoft.DotNet.Arcade.Sdk/tools/SourceBuild/SourceBuildArcadeBuild.targets#L90
I filed dotnet/source-build#4293 which is relevant here. nuget-client incorrectly uses the VMR package cache (already in main).
...ourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/SourceBuiltArtifactsTests.cs
Outdated
Show resolved
Hide resolved
In your PR description, you mention that we can use /workspaces/installer/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/DotNetHelper.cs(38): error VSTEST1: (Microsoft.DotNet.SourceBuild.SmokeTests.SourcelinkTests.VerifySourcelinks) Microsoft.DotNet.SourceBuild.SmokeTests.DotNetHelper..ctor(ITestOutputHelper outputHelper) System.InvalidOperationException : Tarball path '' specified in does not exist. I was under the impression that the Sdk tarball path had a default (added by your changes). Can you explain why that default was not set properly when I invoked the tests in this way? Is it because the default is looking for a built SDK in the artifacts? If that's the case, I'd rather this not be the failing exception. Rather, the failure should happen when the tarball path variable is originally set in my opinion. |
Yes, when you build the repo from within the VMR, the Sdk tarball has its default value. The resolution logic depends on this target:
/p:SdkTarballPath property. Please let me know if this scenario worked before but is now regressed. I don't think that's the case.
What I meant is that you can now test the smoke tests project directly with |
src/SourceBuild/content/test/TestUtilities/ConditionalDiscovererException.cs
Outdated
Show resolved
Hide resolved
.../test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj
Show resolved
Hide resolved
When you look at the commits you will noticed that I originally started just with the bare minimum number of changes and then only added to those because the build required those. This organically grew from ~20 to 50 file changes. If you feel that separating these changes into individual PRs is a good investment of time then I can try that but it will be hard because many of these are intertangled. |
No, not necessary to break up this PR at this point. |
.../test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj
Show resolved
Hide resolved
Looks like there are still compilation errors:
|
Ooops, forgot to build everything. That's now fixed. |
Fixes dotnet/source-build#3615
Fixes dotnet/source-build#4289
This allows the test project to just be invoked with
dotnet test
ordotnet build /t:Test
. Running the UnifiedBuild test projects requires the VMR to first be built to have access to the live built SDK but that's already the case.Test
target instead.