dotnet / dotnet/source-build

UX when there is failing SDK Diff and License Scan Tests could be improved.

Open
#4,329 1 comment 0 reactions 0 assignees View on GitHub
area-testing
Dominant language
No language data
Stars
287
Forks
145
Avg merge
1d 22h
Merged PRs (30d)
10

Description

Related to https://github.com/dotnet/source-build/issues/3910 and https://github.com/dotnet/source-build/issues/4093

When running the SDK diff and license scan tests, extra knowledge is needed to know where to look for the updated files.

Additionally, when doing the SDK diff tests, it can sometimes be difficult to determine which test failed:

```
Determining projects to restore...
All projects are up-to-date for restore.
TestUtilities -> /mnt/vss/_work/1/s/artifacts/bin/TestUtilities/linux/Release/TestUtilities.dll
Microsoft.DotNet.SourceBuild.SmokeTests -> /mnt/vss/_work/1/s/artifacts/bin/Microsoft.DotNet.SourceBuild.SmokeTests/linux/Release/Microsoft.DotNet.SourceBuild.SmokeTests.dll
/mnt/vss/_work/1/s/.dotnet/sdk/9.0.100-preview.4.24178.10/Microsoft.TestPlatform.targets(46,5): error : [xUnit.net 00:00:20.21] Microsoft.DotNet.SourceBuild.SmokeTests.SdkContentTests.CompareMsftToSbFileList [FAIL] [/mnt/vss/_work/1/s/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj]
/mnt/vss/_work/1/s/test/Microsoft.DotNet.SourceBuild.SmokeTests/BaselineHelper.cs(76): error VSTEST1: Microsoft.DotNet.SourceBuild.SmokeTests.SdkContentTests.CompareMsftToSbFileList: Microsoft.DotNet.SourceBuild.SmokeTests.BaselineHelper.CompareFiles(String expectedFilePath, String actualFilePath, ITestOutputHelper outputHelper, Boolean warnOnDiffs) Assert.Null() Failure: Value is not null [/mnt/vss/_work/1/s/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj]
/mnt/vss/_work/1/s/test/Microsoft.DotNet.SourceBuild.SmokeTests/BaselineHelper.cs(76): error VSTEST1: Expected: null [/mnt/vss/_work/1/s/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj]
/mnt/vss/_work/1/s/test/Microsoft.DotNet.SourceBuild.SmokeTests/BaselineHelper.cs(76): error VSTEST1: Actual: "\nExpected file '/mnt/vss/_work/1/s/artifacts/bin/"··· [/mnt/vss/_work/1/s/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj]
/mnt/vss/_work/1/s/.dotnet/sdk/9.0.100-preview.4.24178.10/Microsoft.TestPlatform.targets(46,5): error : [xUnit.net 00:00:24.66] Microsoft.DotNet.SourceBuild.SmokeTests.ArtifactsSizeTest.CompareArtifactsToBaseline [FAIL] [/mnt/vss/_work/1/s/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj]
/mnt/vss/_work/1/s/test/Microsoft.DotNet.SourceBuild.SmokeTests/ArtifactsSizeTest.cs(195): error VSTEST1: Microsoft.DotNet.SourceBuild.SmokeTests.ArtifactsSizeTest.CompareArtifactsToBaseline: Microsoft.DotNet.SourceBuild.SmokeTests.ArtifactsSizeTest.ReportDifferences() Differences were found in the artifacts sizes. [/mnt/vss/_work/1/s/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj]
Passed Microsoft.DotNet.SourceBuild.SmokeTests.SdkContentTests.CompareMsftToSbAssemblyVersions [27s 109ms]
Outputs:
Standard Output Messages:
Executing: tar xzf /mnt/vss/_work/1/Artifacts/dotnet-sdk-9.0.100-preview.2.24163.1-centos.9-x64.tar.gz -C /tmp/414eaz4n.b1m/sb
Executing: tar xzf /mnt/vss/_work/1/Artifacts/dotnet-sdk-9.0.100-preview.2.24163.3-linux-x64.tar.gz -C /tmp/414eaz4n.b1m/msft
Executing: git diff --no-index msft_assemblyversions.txt sb_assemblyversions.txt

Failed! - Failed: 2, Passed: 1, Skipped: 0, Total: 3, Duration: [47s 824ms]
```

One way to improve the UX would be to include the diff in the standard output. Another way would be to clearly summarize which tests failed with clear instructions on how to view the updated files.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.