dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.23k stars 1.35k forks source link

Enumerate live logger test matrix #8418

Closed marcpopMSFT closed 1 year ago

marcpopMSFT commented 1 year ago

Potential scenario test matrix:

Examples

marcpopMSFT commented 1 year ago

This is for manual testing and analysis. Think about test cases we could hand off to our vendors. Additionally, there may be some testing we can do in an automated fashion but since this is a Ux heavy feature, that may be more difficult. Suggestions welcome.

marcpopMSFT commented 1 year ago

CC @baronfel

rainersigwald commented 1 year ago

Most of the testing so far has been "build the MSBuild repo":

.\build
.\scripts\Deploy-MSBuild.ps1 -destination .\.dotnet\sdk\7.0.101\
.\build -msbuildengine dotnet -ll
AR-May commented 1 year ago

I think it is too early now to write test matrix. It does not seem to me that set of features already set for live logger.

rokonec commented 1 year ago

Bellow test cases are designed to give us good enough coverage.

Test Case Single Console Multi project with tests Orchard non SDK .NET non SDK C++
rebuild /m:1 ✔️ ✔️ ✔️ ✔️ ✔️
rebuild /m ✔️ ✔️ ✔️ ✔️ ✔️
rebuild w/ cancel ✔️ ✔️
restore ✔️ ✔️ ✔️
interactive restore ✔️ ✔️ ✔️
rebuild w/ errors ✔️ ✔️ ✔️ ✔️ ✔️
rebuild w/ lots of errors ✔️ ✔️
restore w/ errors ✔️
dotnet test ✔️ ✔️
test w/ MSBuild server opt in ✔️

I have added dotnet test intuitively, as I know it uses Console colors and Console.Write for test progress reporting.

As for "Multi project with tests" I would recommend sln with one console, three class libraries projects and one test xunit project.

By interactive restore I mean a restore which DeviceFlow prompt: image

Here are some simple steps how to prepare simple console app:

> dotnet new nugetconfig
> dotnet nuget add source https://pkgs.dev.azure.com/dnceng/internal/_packaging/7.0.100-rc.1.22429.3-shipping/nuget/v3/index.json
> dotnet new console
> dotnet build -r win-x64 --interactive --restore
rokonec commented 1 year ago

@ladipro @rainersigwald There might be other non-intuitive risky test cases which I have missed - please feel free to recommend.

ladipro commented 1 year ago

I understand these are manual tests and passing is defined as "looks reasonable and doesn't crash". Please correct me if I'm wrong.

Since the logger makes assumptions about the shape of the build in terms of target names, output messages, and maybe more, it would be interesting to also test custom projects not based on the .NET SDK. And because we have decided to also support the logger in MSBuild.exe, I wonder if we should test C++, non-SDK-style, and whatever else is commonly built on the VS command line.

rokonec commented 1 year ago

we should test C++, non-SDK-style, and whatever else is commonly built on the VS command line

Good point. In order to have test matrix manageable, I have added only non-SDK and C++ for some test cases.

ladipro commented 1 year ago

Filed #8724 to define a test plan using the data in this issue.