From 83d9d5ad2c6d35ab77ef52835bd3d3f848a71c1c Mon Sep 17 00:00:00 2001 From: jbe2277 Date: Fri, 1 Nov 2024 21:05:56 +0100 Subject: [PATCH] Build: Add unit test logger (#55) * Test: Add GitHubActions logger for unit tests * UITest: Add GitHubActions logger for UI tests * UITest: use ManagePackageVersionsCentrally * Build: try to fix step summary headers * Build: fix syntax error * Build: fix minor formatting issue * UITest: add Directory.Build.props --- .github/workflows/System.Waf.CI.yml | 8 ++++++-- .../BookLibrary.Test/BookLibrary.Test.csproj | 10 ++++------ src/Samples.UITest/Directory.Build.props | 6 ++++++ src/Samples.UITest/Directory.Packages.props | 14 ++++++++++++++ .../InformationManager.Test.csproj | 10 ++++------ src/Samples.UITest/Samples.UITest.sln | 8 +++++++- src/Samples.UITest/UITest.Core/UITest.Core.csproj | 7 ++----- src/Samples.UITest/Writer.Test/Writer.Test.csproj | 10 ++++------ src/System.Waf/Directory.Build.props | 6 ++---- src/System.Waf/Directory.Packages.props | 13 +++++++------ 10 files changed, 56 insertions(+), 36 deletions(-) create mode 100644 src/Samples.UITest/Directory.Build.props create mode 100644 src/Samples.UITest/Directory.Packages.props diff --git a/.github/workflows/System.Waf.CI.yml b/.github/workflows/System.Waf.CI.yml index b7697a84..f13535d3 100644 --- a/.github/workflows/System.Waf.CI.yml +++ b/.github/workflows/System.Waf.CI.yml @@ -27,7 +27,9 @@ jobs: run: dotnet build ./src/System.Waf/System.Waf.sln -c Release -p:ContinuousIntegrationBuild=true - name: 🕵️ Test - run: dotnet test ./src/System.Waf/System.Waf.sln -c Release --no-build + run: | + echo "## 🕵️ Test Results - System.Waf.sln" >> $Env:GITHUB_STEP_SUMMARY + dotnet test ./src/System.Waf/System.Waf.sln -c Release --no-build --logger GitHubActions - name: 📦 Upload NuGet Packages uses: actions/upload-artifact@v4 @@ -39,7 +41,9 @@ jobs: src/System.Waf/System.Waf/**/*.snupkg - name: 🖥️ UI Test - run: dotnet test ./src/Samples.UITest/Samples.UITest.sln --logger "console;verbosity=detailed" -maxCpuCount:1 + run: | + echo "## 🕵️ Test Results - Samples.UITest.sln" >> $Env:GITHUB_STEP_SUMMARY + dotnet test ./src/Samples.UITest/Samples.UITest.sln --logger GitHubActions -maxCpuCount:1 - name: 📦 Upload UI Test results uses: actions/upload-artifact@v4 diff --git a/src/Samples.UITest/BookLibrary.Test/BookLibrary.Test.csproj b/src/Samples.UITest/BookLibrary.Test/BookLibrary.Test.csproj index 43bba286..b52542b2 100644 --- a/src/Samples.UITest/BookLibrary.Test/BookLibrary.Test.csproj +++ b/src/Samples.UITest/BookLibrary.Test/BookLibrary.Test.csproj @@ -2,15 +2,13 @@ net8.0-windows UITest.BookLibrary - - enable - enable - - - + + + + diff --git a/src/Samples.UITest/Directory.Build.props b/src/Samples.UITest/Directory.Build.props new file mode 100644 index 00000000..b92e722b --- /dev/null +++ b/src/Samples.UITest/Directory.Build.props @@ -0,0 +1,6 @@ + + + enable + enable + + diff --git a/src/Samples.UITest/Directory.Packages.props b/src/Samples.UITest/Directory.Packages.props new file mode 100644 index 00000000..51df380d --- /dev/null +++ b/src/Samples.UITest/Directory.Packages.props @@ -0,0 +1,14 @@ + + + true + + + + + + + + + + + \ No newline at end of file diff --git a/src/Samples.UITest/InformationManager.Test/InformationManager.Test.csproj b/src/Samples.UITest/InformationManager.Test/InformationManager.Test.csproj index 886af137..aa9d4a3c 100644 --- a/src/Samples.UITest/InformationManager.Test/InformationManager.Test.csproj +++ b/src/Samples.UITest/InformationManager.Test/InformationManager.Test.csproj @@ -2,15 +2,13 @@ net8.0-windows UITest.InformationManager - - enable - enable - - - + + + + diff --git a/src/Samples.UITest/Samples.UITest.sln b/src/Samples.UITest/Samples.UITest.sln index 3b467a48..1f32a63c 100644 --- a/src/Samples.UITest/Samples.UITest.sln +++ b/src/Samples.UITest/Samples.UITest.sln @@ -9,7 +9,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookLibrary.Test", "BookLib EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UITest.Core", "UITest.Core\UITest.Core.csproj", "{4B2174D9-B723-42AA-90DA-2F556409F19A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InformationManager.Test", "InformationManager.Test\InformationManager.Test.csproj", "{18006BE9-7056-48FB-97CF-F7B25C43358B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InformationManager.Test", "InformationManager.Test\InformationManager.Test.csproj", "{18006BE9-7056-48FB-97CF-F7B25C43358B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DAAFA839-8A98-4353-9AAD-CD1484DFEDE5}" + ProjectSection(SolutionItems) = preProject + Directory.Build.props = Directory.Build.props + Directory.Packages.props = Directory.Packages.props + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/Samples.UITest/UITest.Core/UITest.Core.csproj b/src/Samples.UITest/UITest.Core/UITest.Core.csproj index 69ec98c9..4aa0f5ed 100644 --- a/src/Samples.UITest/UITest.Core/UITest.Core.csproj +++ b/src/Samples.UITest/UITest.Core/UITest.Core.csproj @@ -2,13 +2,10 @@ net8.0-windows UITest - - enable - enable - - + + diff --git a/src/Samples.UITest/Writer.Test/Writer.Test.csproj b/src/Samples.UITest/Writer.Test/Writer.Test.csproj index 438af642..aa26c3ef 100644 --- a/src/Samples.UITest/Writer.Test/Writer.Test.csproj +++ b/src/Samples.UITest/Writer.Test/Writer.Test.csproj @@ -2,15 +2,13 @@ net8.0-windows UITest.Writer - - enable - enable - - - + + + + diff --git a/src/System.Waf/Directory.Build.props b/src/System.Waf/Directory.Build.props index ec7dda43..2ca98af6 100644 --- a/src/System.Waf/Directory.Build.props +++ b/src/System.Waf/Directory.Build.props @@ -11,10 +11,7 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -24,6 +21,7 @@ $(MSBuildThisFileDirectory)CodeCoverage.runsettings + diff --git a/src/System.Waf/Directory.Packages.props b/src/System.Waf/Directory.Packages.props index eae4432f..5208030f 100644 --- a/src/System.Waf/Directory.Packages.props +++ b/src/System.Waf/Directory.Packages.props @@ -2,16 +2,16 @@ true - + - + - + - + @@ -19,10 +19,11 @@ - + + - + \ No newline at end of file