From 5d2205b071917a0f6507ee047f1f8152d05e5229 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 00:22:11 +0200 Subject: [PATCH 01/24] TEST-1234 Add test project --- .github/workflows/backend-ci.yml | 11 ++ .github/workflows/deploy-cd.yml | 8 +- src/backend/Backend.sln | 28 ++- tests/backend/Directory.Build.props | 3 + tests/backend/WebApi.Tests/UnitTest1.cs | 15 ++ .../backend/WebApi.Tests/WebApi.Tests.csproj | 24 +++ tests/backend/WebApi.Tests/packages.lock.json | 166 ++++++++++++++++++ 7 files changed, 250 insertions(+), 5 deletions(-) create mode 100644 tests/backend/Directory.Build.props create mode 100644 tests/backend/WebApi.Tests/UnitTest1.cs create mode 100644 tests/backend/WebApi.Tests/WebApi.Tests.csproj create mode 100644 tests/backend/WebApi.Tests/packages.lock.json diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index deb55c84..028e94b9 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -107,6 +107,17 @@ jobs: comment-identifier: "${{ env.WORKFLOW_SHORT_NAME }}-build-results" comment-content: ${{ steps.npm-build.outputs.result }} + - name: Unit tests + uses: zyborg/dotnet-tests-report@v1 + with: + project_path: ../../tests/backend/WebApi.Tests + report_name: contoso_business_tests + report_title: Contos Business Tests + github_token: ${{ secrets.GITHUB_TOKEN }} + # gist_name: contoso_business_tests.md + # gist_badge_label: 'Contoso Business: %Counters_passed%/%Counters_total%' + # gist_token: ${{ secrets.GIST_TOKEN }} + - name: Inspect code uses: muno92/resharper_inspectcode@v1 if: always() diff --git a/.github/workflows/deploy-cd.yml b/.github/workflows/deploy-cd.yml index e31c46d6..595f242f 100644 --- a/.github/workflows/deploy-cd.yml +++ b/.github/workflows/deploy-cd.yml @@ -39,10 +39,10 @@ env: DOCKER_REGISTRY_SERVER: "crtest${{ inputs.deploy_target }}ne.azurecr.io" DOCKER_REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} DOCKER_REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} - ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }} - ARM_SUBSCRIPTION_ID: ${{ vars.ARM_SUBSCRIPTION_ID }} - ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} - ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }} + # ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }} + # ARM_SUBSCRIPTION_ID: ${{ vars.ARM_SUBSCRIPTION_ID }} + # ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} + # ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }} POWERAPPS_ENVIRONMENTURL: ${{ secrets.POWERAPPS_ENVIRONMENTURL }} POWERAPPS_APPID: ${{ secrets.POWERAPPS_APPID }} POWERAPPS_TENANTID: ${{ secrets.POWERAPPS_TENANTID }} diff --git a/src/backend/Backend.sln b/src/backend/Backend.sln index 1d9c51cb..a887cd7c 100644 --- a/src/backend/Backend.sln +++ b/src/backend/Backend.sln @@ -3,7 +3,25 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.7.34031.279 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApi", "WebApi\WebApi.csproj", "{967AAD03-89D9-4352-BAF5-40CF10F28C35}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApi", "WebApi\WebApi.csproj", "{967AAD03-89D9-4352-BAF5-40CF10F28C35}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApi.Tests", "..\..\tests\backend\WebApi.Tests\WebApi.Tests.csproj", "{83C523DE-4F91-4C54-A4F0-5D24CCF251D0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9EBA80A2-4F3D-4EBC-AC53-3D4DE1719443}" + ProjectSection(SolutionItems) = preProject + ..\..\README.md = ..\..\README.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{B9B9AD30-0723-4C38-868E-5E9D9CB458CE}" + ProjectSection(SolutionItems) = preProject + ..\..\tests\backend\Directory.Build.props = ..\..\tests\backend\Directory.Build.props + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F9FCA971-68B4-4828-A6EC-1A16DDF1E983}" + ProjectSection(SolutionItems) = preProject + Directory.Build.props = Directory.Build.props + global.json = global.json + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -15,10 +33,18 @@ Global {967AAD03-89D9-4352-BAF5-40CF10F28C35}.Debug|Any CPU.Build.0 = Debug|Any CPU {967AAD03-89D9-4352-BAF5-40CF10F28C35}.Release|Any CPU.ActiveCfg = Release|Any CPU {967AAD03-89D9-4352-BAF5-40CF10F28C35}.Release|Any CPU.Build.0 = Release|Any CPU + {83C523DE-4F91-4C54-A4F0-5D24CCF251D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {83C523DE-4F91-4C54-A4F0-5D24CCF251D0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {83C523DE-4F91-4C54-A4F0-5D24CCF251D0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {83C523DE-4F91-4C54-A4F0-5D24CCF251D0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {B9B9AD30-0723-4C38-868E-5E9D9CB458CE} = {9EBA80A2-4F3D-4EBC-AC53-3D4DE1719443} + {F9FCA971-68B4-4828-A6EC-1A16DDF1E983} = {9EBA80A2-4F3D-4EBC-AC53-3D4DE1719443} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {A57A04D2-2D56-4C4F-A03F-BC3E671898F8} EndGlobalSection diff --git a/tests/backend/Directory.Build.props b/tests/backend/Directory.Build.props new file mode 100644 index 00000000..9e48d722 --- /dev/null +++ b/tests/backend/Directory.Build.props @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/tests/backend/WebApi.Tests/UnitTest1.cs b/tests/backend/WebApi.Tests/UnitTest1.cs new file mode 100644 index 00000000..f8816902 --- /dev/null +++ b/tests/backend/WebApi.Tests/UnitTest1.cs @@ -0,0 +1,15 @@ +namespace WebApi.Tests; + +public class Tests +{ + [SetUp] + public void Setup() + { + } + + [Test] + public void Test1() + { + Assert.Pass(); + } +} \ No newline at end of file diff --git a/tests/backend/WebApi.Tests/WebApi.Tests.csproj b/tests/backend/WebApi.Tests/WebApi.Tests.csproj new file mode 100644 index 00000000..0c3577b4 --- /dev/null +++ b/tests/backend/WebApi.Tests/WebApi.Tests.csproj @@ -0,0 +1,24 @@ + + + + false + true + + + + + + + + + + + + + + + + + + + diff --git a/tests/backend/WebApi.Tests/packages.lock.json b/tests/backend/WebApi.Tests/packages.lock.json new file mode 100644 index 00000000..21906507 --- /dev/null +++ b/tests/backend/WebApi.Tests/packages.lock.json @@ -0,0 +1,166 @@ +{ + "version": 1, + "dependencies": { + "net8.0": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "tW3lsNS+dAEII6YGUX/VMoJjBS1QvsxqJeqLaJXub08y1FSjasFPtQ4UBUsudE9PNrzLjooClMsPtY2cZLdXpQ==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.8.0, )", + "resolved": "17.8.0", + "contentHash": "BmTYGbD/YuDHmApIENdoyN1jCk0Rj1fJB0+B/fVekyTdVidr91IlzhqzytiUgaEAzL1ZJcYCme0MeBMYvJVzvw==", + "dependencies": { + "Microsoft.CodeCoverage": "17.8.0", + "Microsoft.TestPlatform.TestHost": "17.8.0" + } + }, + "NUnit": { + "type": "Direct", + "requested": "[3.14.0, )", + "resolved": "3.14.0", + "contentHash": "R7iPwD7kbOaP3o2zldWJbWeMQAvDKD0uld27QvA3PAALl1unl7x0v2J7eGiJOYjimV/BuGT4VJmr45RjS7z4LA==", + "dependencies": { + "NETStandard.Library": "2.0.0" + } + }, + "NUnit.Analyzers": { + "type": "Direct", + "requested": "[3.9.0, )", + "resolved": "3.9.0", + "contentHash": "8bGAEljlBnzR+uU8oGQhTVKnbgBw1Mo71qjVkgzHdvtUkiB5XOIDyjAcS4KUo/j+F2Zv/xBUZRkCWXmejx4bfA==" + }, + "NUnit3TestAdapter": { + "type": "Direct", + "requested": "[4.5.0, )", + "resolved": "4.5.0", + "contentHash": "s8JpqTe9bI2f49Pfr3dFRfoVSuFQyraTj68c3XXjIS/MRGvvkLnrg6RLqnTjdShX+AdFUCCU/4Xex58AdUfs6A==" + }, + "Microsoft.AspNetCore.OpenApi": { + "type": "Transitive", + "resolved": "8.0.4", + "contentHash": "TFiXbP0tqRgJKcpiCSSp79q6QaiF8gqRhZgrU48FQajhVkiwHSp1O1b1hkYC4Ehl4clbk3pHwdfwN9mRtDAFbQ==", + "dependencies": { + "Microsoft.OpenApi": "1.4.3" + } + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.8.0", + "contentHash": "KC8SXWbGIdoFVdlxKk9WHccm0llm9HypcHMLUUFabRiTS3SO2fQXNZfdiF3qkEdTJhbRrxhdRxjL4jbtwPq4Ew==" + }, + "Microsoft.Extensions.ApiDescription.Server": { + "type": "Transitive", + "resolved": "6.0.5", + "contentHash": "Ckb5EDBUNJdFWyajfXzUIMRkhf52fHZOQuuZg/oiu8y7zDCVwD0iHhew6MnThjHmevanpxL3f5ci2TtHQEN6bw==" + }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" + }, + "Microsoft.OpenApi": { + "type": "Transitive", + "resolved": "1.4.3", + "contentHash": "rURwggB+QZYcSVbDr7HSdhw/FELvMlriW10OeOzjPT7pstefMo7IThhtNtDudxbXhW+lj0NfX72Ka5EDsG8x6w==" + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.8.0", + "contentHash": "AYy6vlpGMfz5kOFq99L93RGbqftW/8eQTqjT9iGXW6s9MRP3UdtY8idJ8rJcjeSja8A18IhIro5YnH3uv1nz4g==", + "dependencies": { + "NuGet.Frameworks": "6.5.0", + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.TestHost": { + "type": "Transitive", + "resolved": "17.8.0", + "contentHash": "9ivcl/7SGRmOT0YYrHQGohWiT5YCpkmy/UEzldfVisLm6QxbLaK3FAJqZXI34rnRLmqqDCeMQxKINwmKwAPiDw==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.8.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "Microsoft.VisualStudio.Azure.Containers.Tools.Targets": { + "type": "Transitive", + "resolved": "1.20.1", + "contentHash": "H4bIRdEOuyWBotgdPA5oCjJmUekWrtU5lOKnMAVaSNduZXHnqFZECsYbkm4vIOE4aeIO8TEYqfsZaJus1KknLQ==" + }, + "NETStandard.Library": { + "type": "Transitive", + "resolved": "2.0.0", + "contentHash": "7jnbRU+L08FXKMxqUflxEXtVymWvNOrS8yHgu9s6EM8Anr6T/wIX4nZ08j/u3Asz+tCufp3YVwFSEvFTPYmBPA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + }, + "Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.1", + "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + }, + "NuGet.Frameworks": { + "type": "Transitive", + "resolved": "6.5.0", + "contentHash": "QWINE2x3MbTODsWT1Gh71GaGb5icBz4chS8VYvTgsBnsi8esgN6wtHhydd7fvToWECYGq7T4cgBBDiKD/363fg==" + }, + "Swashbuckle.AspNetCore": { + "type": "Transitive", + "resolved": "6.5.0", + "contentHash": "FK05XokgjgwlCI6wCT+D4/abtQkL1X1/B9Oas6uIwHFmYrIO9WUD5aLC9IzMs9GnHfUXOtXZ2S43gN1mhs5+aA==", + "dependencies": { + "Microsoft.Extensions.ApiDescription.Server": "6.0.5", + "Swashbuckle.AspNetCore.Swagger": "6.5.0", + "Swashbuckle.AspNetCore.SwaggerGen": "6.5.0", + "Swashbuckle.AspNetCore.SwaggerUI": "6.5.0" + } + }, + "Swashbuckle.AspNetCore.ReDoc": { + "type": "Transitive", + "resolved": "6.5.0", + "contentHash": "MlysLblpiWftmqhMGaBEymkroFBlssFZzKr+7YHvvBrV5ymwAjdJ7bDBTTv5/qhaPZK6HoMu1ig3IwK2YtLTOg==" + }, + "Swashbuckle.AspNetCore.Swagger": { + "type": "Transitive", + "resolved": "6.5.0", + "contentHash": "XWmCmqyFmoItXKFsQSwQbEAsjDKcxlNf1l+/Ki42hcb6LjKL8m5Db69OTvz5vLonMSRntYO1XLqz0OP+n3vKnA==", + "dependencies": { + "Microsoft.OpenApi": "1.2.3" + } + }, + "Swashbuckle.AspNetCore.SwaggerGen": { + "type": "Transitive", + "resolved": "6.5.0", + "contentHash": "Y/qW8Qdg9OEs7V013tt+94OdPxbRdbhcEbw4NiwGvf4YBcfhL/y7qp/Mjv/cENsQ2L3NqJ2AOu94weBy/h4KvA==", + "dependencies": { + "Swashbuckle.AspNetCore.Swagger": "6.5.0" + } + }, + "Swashbuckle.AspNetCore.SwaggerUI": { + "type": "Transitive", + "resolved": "6.5.0", + "contentHash": "OvbvxX+wL8skxTBttcBsVxdh73Fag4xwqEU2edh4JMn7Ws/xJHnY/JB1e9RoCb6XpDxUF3hD9A0Z1lEUx40Pfw==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, + "webapi": { + "type": "Project", + "dependencies": { + "Microsoft.AspNetCore.OpenApi": "[8.0.4, )", + "Microsoft.VisualStudio.Azure.Containers.Tools.Targets": "[1.20.1, )", + "Swashbuckle.AspNetCore": "[6.5.0, )", + "Swashbuckle.AspNetCore.ReDoc": "[6.5.0, )" + } + } + }, + "net8.0/linux-musl-x64": {}, + "net8.0/win-x64": {} + } +} \ No newline at end of file From 2c671b4f30baf8e79622582d5a98c9dcd5ce709d Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 00:27:02 +0200 Subject: [PATCH 02/24] TEST-1234 Fix path --- .github/workflows/backend-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 028e94b9..fabffd29 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -110,7 +110,7 @@ jobs: - name: Unit tests uses: zyborg/dotnet-tests-report@v1 with: - project_path: ../../tests/backend/WebApi.Tests + project_path: tests/backend/WebApi.Tests report_name: contoso_business_tests report_title: Contos Business Tests github_token: ${{ secrets.GITHUB_TOKEN }} From 76df6605d485a2e873d643dc5f24e81fd51c5aaf Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 00:30:59 +0200 Subject: [PATCH 03/24] TEST-1234 Add gist --- .github/workflows/backend-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index fabffd29..9ab3b77e 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -114,9 +114,9 @@ jobs: report_name: contoso_business_tests report_title: Contos Business Tests github_token: ${{ secrets.GITHUB_TOKEN }} - # gist_name: contoso_business_tests.md - # gist_badge_label: 'Contoso Business: %Counters_passed%/%Counters_total%' - # gist_token: ${{ secrets.GIST_TOKEN }} + gist_name: contoso_business_tests.md + gist_badge_label: "Contoso Business: %Counters_passed%/%Counters_total%" + gist_token: ${{ secrets.GIST_TOKEN }} - name: Inspect code uses: muno92/resharper_inspectcode@v1 From c978c8aa3d3c6295908fd076c23562ec073cd80a Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 00:38:11 +0200 Subject: [PATCH 04/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 9ab3b77e..850ff1fc 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -107,16 +107,26 @@ jobs: comment-identifier: "${{ env.WORKFLOW_SHORT_NAME }}-build-results" comment-content: ${{ steps.npm-build.outputs.result }} - - name: Unit tests - uses: zyborg/dotnet-tests-report@v1 + - name: WebApi Tests + run: | + dotnet test tests/backend/WebApi.Tests --logger "trx;LogFileName=test-results.trx" + + - uses: dorny/test-reporter@v1 with: - project_path: tests/backend/WebApi.Tests - report_name: contoso_business_tests - report_title: Contos Business Tests - github_token: ${{ secrets.GITHUB_TOKEN }} - gist_name: contoso_business_tests.md - gist_badge_label: "Contoso Business: %Counters_passed%/%Counters_total%" - gist_token: ${{ secrets.GIST_TOKEN }} + name: WebApi Tests # Name of the check run which will be created + path: "*.trx" # Path to test results (inside artifact .zip) + reporter: dotnet-trx # Format of test results + + # - name: Unit tests + # uses: zyborg/dotnet-tests-report@v1 + # with: + # project_path: tests/backend/WebApi.Tests + # report_name: contoso_business_tests + # report_title: Contos Business Tests + # github_token: ${{ secrets.GITHUB_TOKEN }} + # gist_name: contoso_business_tests.md + # gist_badge_label: "Contoso Business: %Counters_passed%/%Counters_total%" + # gist_token: ${{ secrets.GIST_TOKEN }} - name: Inspect code uses: muno92/resharper_inspectcode@v1 From c149c173503e7a2abaf6c9e466025c6e065ac669 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 00:41:23 +0200 Subject: [PATCH 05/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 850ff1fc..41cf88c0 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -109,7 +109,7 @@ jobs: - name: WebApi Tests run: | - dotnet test tests/backend/WebApi.Tests --logger "trx;LogFileName=test-results.trx" + dotnet test ../../tests/backend/WebApi.Tests --logger "trx;LogFileName=test-results.trx" - uses: dorny/test-reporter@v1 with: From a81e9eeb317e0d68b7501c89628965fb4dd0b504 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 00:43:34 +0200 Subject: [PATCH 06/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 41cf88c0..f24f586c 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -114,8 +114,8 @@ jobs: - uses: dorny/test-reporter@v1 with: name: WebApi Tests # Name of the check run which will be created - path: "*.trx" # Path to test results (inside artifact .zip) - reporter: dotnet-trx # Format of test results + path: "../../tests/backend/WebApi.Tests/TestResults/test-results.trx" + reporter: dotnet-trx # - name: Unit tests # uses: zyborg/dotnet-tests-report@v1 From bb7aeed224904ae4c28799ec13843ade44ad1858 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 00:51:27 +0200 Subject: [PATCH 07/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index f24f586c..8d47056e 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -114,7 +114,7 @@ jobs: - uses: dorny/test-reporter@v1 with: name: WebApi Tests # Name of the check run which will be created - path: "../../tests/backend/WebApi.Tests/TestResults/test-results.trx" + path: "tests/backend/WebApi.Tests/TestResults/test-results.trx" reporter: dotnet-trx # - name: Unit tests From 023540e3c62837b93bfba343c3ec12c92cfd44c4 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 01:00:45 +0200 Subject: [PATCH 08/24] TEST-1234 Add report generator --- .github/workflows/backend-ci.yml | 18 +++++++++++++++++- src/backend/.config/dotnet-tools.json | 6 ++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 8d47056e..a3d325b9 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -109,13 +109,29 @@ jobs: - name: WebApi Tests run: | - dotnet test ../../tests/backend/WebApi.Tests --logger "trx;LogFileName=test-results.trx" + dotnet tool restore + dotnet test ../../tests/backend/WebApi.Tests --logger "trx;LogFileName=test-results.trx" /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura + dotnet reportgenerator -reports:"../../tests/backend/WebApi.Tests/TestResults/**/coverage.cobertura.xml" -targetdir:"coveragereport" -reporttypes:Html - uses: dorny/test-reporter@v1 with: name: WebApi Tests # Name of the check run which will be created path: "tests/backend/WebApi.Tests/TestResults/test-results.trx" reporter: dotnet-trx + fail-on-error: true + + - name: Code Coverage Report + uses: irongut/CodeCoverageSummary@v1.3.0 + with: + filename: coverage/**/coverage.cobertura.xml + badge: true + fail_below_min: true + format: markdown + hide_branch_rate: false + hide_complexity: true + indicators: true + output: both + thresholds: "60 80" # - name: Unit tests # uses: zyborg/dotnet-tests-report@v1 diff --git a/src/backend/.config/dotnet-tools.json b/src/backend/.config/dotnet-tools.json index 677ed3f7..d6b6f812 100644 --- a/src/backend/.config/dotnet-tools.json +++ b/src/backend/.config/dotnet-tools.json @@ -7,6 +7,12 @@ "commands": [ "dotnet-ef" ] + }, + "dotnet-reportgenerator-globaltool": { + "version": "5.2.4", + "commands": [ + "reportgenerator" + ] } } } \ No newline at end of file From 74de254da905e097821894ccf82c94bde6ddeaba Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 01:03:20 +0200 Subject: [PATCH 09/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index a3d325b9..50e1ba98 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -111,6 +111,7 @@ jobs: run: | dotnet tool restore dotnet test ../../tests/backend/WebApi.Tests --logger "trx;LogFileName=test-results.trx" /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura + ls -la ../../tests/backend/WebApi.Tests dotnet reportgenerator -reports:"../../tests/backend/WebApi.Tests/TestResults/**/coverage.cobertura.xml" -targetdir:"coveragereport" -reporttypes:Html - uses: dorny/test-reporter@v1 From 3b85d49491639eb8e2b64c659f8c7dab1acac46d Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 01:05:32 +0200 Subject: [PATCH 10/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 50e1ba98..1072012b 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -111,7 +111,7 @@ jobs: run: | dotnet tool restore dotnet test ../../tests/backend/WebApi.Tests --logger "trx;LogFileName=test-results.trx" /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura - ls -la ../../tests/backend/WebApi.Tests + ls -la ../../tests/backend/WebApi.Tests/TestResults dotnet reportgenerator -reports:"../../tests/backend/WebApi.Tests/TestResults/**/coverage.cobertura.xml" -targetdir:"coveragereport" -reporttypes:Html - uses: dorny/test-reporter@v1 From 427ca57ae5517bb458fa675a10de6375fa21a633 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 01:26:42 +0200 Subject: [PATCH 11/24] TEST-1234 Update .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 5073cb63..51fca6ab 100644 --- a/.gitignore +++ b/.gitignore @@ -402,3 +402,6 @@ FodyWeavers.xsd # OS-specific files .DS_Store + +# Coverage report files +CoverageReport/ From 8611c4da2047deaa85d0f09ac74cffad2fc92eb4 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 01:26:56 +0200 Subject: [PATCH 12/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 1072012b..542aa90c 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -65,8 +65,11 @@ jobs: - name: dotnet restore run: dotnet restore --locked-mode + - name: dotnet tool restore + run: dotnet tool restore + - name: Build - id: npm-build + id: dotnet-build run: | dotnet build -c Release --no-restore --nologo -consoleLoggerParameters:NoSummary -verbosity:quiet 1>build.out 2>&1 || (exit 0) grep "): error " build.out > build.err || (exit 0) @@ -105,14 +108,10 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} comment-identifier: "${{ env.WORKFLOW_SHORT_NAME }}-build-results" - comment-content: ${{ steps.npm-build.outputs.result }} + comment-content: ${{ steps.dotnet-build.outputs.result }} - name: WebApi Tests - run: | - dotnet tool restore - dotnet test ../../tests/backend/WebApi.Tests --logger "trx;LogFileName=test-results.trx" /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura - ls -la ../../tests/backend/WebApi.Tests/TestResults - dotnet reportgenerator -reports:"../../tests/backend/WebApi.Tests/TestResults/**/coverage.cobertura.xml" -targetdir:"coveragereport" -reporttypes:Html + run: dotnet test ../../tests/backend/WebApi.Tests --no-restore --no-build --collect:"XPlat Code Coverage" --logger "trx;LogFileName=test-results.trx" /p:CollectCoverage=true /p:CoverletOutput='../../tests/backend/WebApi.Tests/TestResults/' /p:CoverletOutputFormat=cobertura - uses: dorny/test-reporter@v1 with: @@ -121,10 +120,25 @@ jobs: reporter: dotnet-trx fail-on-error: true + - name: Generate report for all tests + id: reportgenerator + run: | + dotnet reportgenerator -reports:"../../tests/backend/**/TestResults/**/coverage.cobertura.xml" -targetdir:"../../tests/backend/CoverageReport" -reporttypes:Html;Cobertura;MarkdownSummaryGithub;Badges + content=`cat ../../tests/backend/CoverageReport/SummaryGithub.md` + echo markdown=$content >> $GITHUB_OUTPUT + + - name: "Create or Update PR Comment" + uses: im-open/update-pr-comment@v1.2.2 + if: ${{ always() && github.event_name == 'pull_request' }} + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + comment-identifier: "${{ env.WORKFLOW_SHORT_NAME }}-reportgenerator-results" + comment-content: ${{ steps.reportgenerator.outputs.markdown }} + - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 with: - filename: coverage/**/coverage.cobertura.xml + filename: ../../tests/backend/CoverageReport/Cobertura.xml badge: true fail_below_min: true format: markdown From ef3743caf4b53dd2a9531f13f81770b94e08ce8e Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 01:29:13 +0200 Subject: [PATCH 13/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 542aa90c..def7644d 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -111,7 +111,7 @@ jobs: comment-content: ${{ steps.dotnet-build.outputs.result }} - name: WebApi Tests - run: dotnet test ../../tests/backend/WebApi.Tests --no-restore --no-build --collect:"XPlat Code Coverage" --logger "trx;LogFileName=test-results.trx" /p:CollectCoverage=true /p:CoverletOutput='../../tests/backend/WebApi.Tests/TestResults/' /p:CoverletOutputFormat=cobertura + run: dotnet test ../../tests/backend/WebApi.Tests --no-restore --no-build --collect:"XPlat Code Coverage" --logger "trx;LogFileName=test-results.trx" /p:CollectCoverage=true /p:CoverletOutput="../../tests/backend/WebApi.Tests/TestResults/" /p:CoverletOutputFormat=cobertura - uses: dorny/test-reporter@v1 with: @@ -148,20 +148,8 @@ jobs: output: both thresholds: "60 80" - # - name: Unit tests - # uses: zyborg/dotnet-tests-report@v1 - # with: - # project_path: tests/backend/WebApi.Tests - # report_name: contoso_business_tests - # report_title: Contos Business Tests - # github_token: ${{ secrets.GITHUB_TOKEN }} - # gist_name: contoso_business_tests.md - # gist_badge_label: "Contoso Business: %Counters_passed%/%Counters_total%" - # gist_token: ${{ secrets.GIST_TOKEN }} - - name: Inspect code uses: muno92/resharper_inspectcode@v1 - if: always() with: workingDirectory: ${{ env.BACKEND_SOLUTION_PATH }} solutionPath: Backend.sln From 6d62958017faf2ae24e8e3b12c92742bd02ff1b9 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 01:30:49 +0200 Subject: [PATCH 14/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index def7644d..3d898c5d 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -111,7 +111,7 @@ jobs: comment-content: ${{ steps.dotnet-build.outputs.result }} - name: WebApi Tests - run: dotnet test ../../tests/backend/WebApi.Tests --no-restore --no-build --collect:"XPlat Code Coverage" --logger "trx;LogFileName=test-results.trx" /p:CollectCoverage=true /p:CoverletOutput="../../tests/backend/WebApi.Tests/TestResults/" /p:CoverletOutputFormat=cobertura + run: dotnet test ../../tests/backend/WebApi.Tests/WebApi.Tests.csproj --no-restore --no-build --collect:"XPlat Code Coverage" --logger "trx;LogFileName=test-results.trx" /p:CollectCoverage=true /p:CoverletOutput="../../tests/backend/WebApi.Tests/TestResults/" /p:CoverletOutputFormat=cobertura - uses: dorny/test-reporter@v1 with: From 68dac138cf49ecadba0d6607d721a10e86e3b7b3 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 01:32:12 +0200 Subject: [PATCH 15/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 3d898c5d..b6307932 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -111,7 +111,7 @@ jobs: comment-content: ${{ steps.dotnet-build.outputs.result }} - name: WebApi Tests - run: dotnet test ../../tests/backend/WebApi.Tests/WebApi.Tests.csproj --no-restore --no-build --collect:"XPlat Code Coverage" --logger "trx;LogFileName=test-results.trx" /p:CollectCoverage=true /p:CoverletOutput="../../tests/backend/WebApi.Tests/TestResults/" /p:CoverletOutputFormat=cobertura + run: dotnet test ../../tests/backend/WebApi.Tests --no-restore --collect:"XPlat Code Coverage" --logger "trx;LogFileName=test-results.trx" /p:CollectCoverage=true /p:CoverletOutput="../../tests/backend/WebApi.Tests/TestResults/" /p:CoverletOutputFormat=cobertura - uses: dorny/test-reporter@v1 with: From d316c6f1aee68e35fe6578fb174de3a1ea171f7b Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 01:33:31 +0200 Subject: [PATCH 16/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index b6307932..0185658e 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -123,7 +123,7 @@ jobs: - name: Generate report for all tests id: reportgenerator run: | - dotnet reportgenerator -reports:"../../tests/backend/**/TestResults/**/coverage.cobertura.xml" -targetdir:"../../tests/backend/CoverageReport" -reporttypes:Html;Cobertura;MarkdownSummaryGithub;Badges + dotnet reportgenerator -reports:"../../tests/backend/**/TestResults/**/coverage.cobertura.xml" -targetdir:"../../tests/backend/CoverageReport" -reporttypes:"Html;Cobertura;MarkdownSummaryGithub;Badges" content=`cat ../../tests/backend/CoverageReport/SummaryGithub.md` echo markdown=$content >> $GITHUB_OUTPUT From a0c70ff0357f7a4097b8ec69c3b3aca1de48df76 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 01:36:07 +0200 Subject: [PATCH 17/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 0185658e..761fe19d 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -138,7 +138,7 @@ jobs: - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 with: - filename: ../../tests/backend/CoverageReport/Cobertura.xml + filename: "tests/backend/CoverageReport/Cobertura.xml" badge: true fail_below_min: true format: markdown From 4f55d5abdaaf00f5138e0e0d0364f8943009178f Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 01:40:50 +0200 Subject: [PATCH 18/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 761fe19d..8a235f3a 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -132,7 +132,7 @@ jobs: if: ${{ always() && github.event_name == 'pull_request' }} with: github-token: ${{ secrets.GITHUB_TOKEN }} - comment-identifier: "${{ env.WORKFLOW_SHORT_NAME }}-reportgenerator-results" + comment-identifier: "${{ env.WORKFLOW_SHORT_NAME }}-reportgenerator" comment-content: ${{ steps.reportgenerator.outputs.markdown }} - name: Code Coverage Report @@ -140,7 +140,7 @@ jobs: with: filename: "tests/backend/CoverageReport/Cobertura.xml" badge: true - fail_below_min: true + fail_below_min: false format: markdown hide_branch_rate: false hide_complexity: true @@ -148,6 +148,20 @@ jobs: output: both thresholds: "60 80" + - name: Create output variable + id: code-coverage-summary + run: | + content=`cat ../../tests/backend/CoverageReport/SummaryGithub.md` + echo markdown=$content >> $GITHUB_OUTPUT + + - name: "Create or Update PR Comment" + uses: im-open/update-pr-comment@v1.2.2 + if: ${{ always() && github.event_name == 'pull_request' }} + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + comment-identifier: "${{ env.WORKFLOW_SHORT_NAME }}-CodeCoverageSummary" + comment-content: ${{ steps.code-coverage-summary.outputs.markdown }} + - name: Inspect code uses: muno92/resharper_inspectcode@v1 with: From 0d4688759bb69d66d620bfe03aa5ea7401104734 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 01:43:46 +0200 Subject: [PATCH 19/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 8a235f3a..41b9ff08 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -151,8 +151,9 @@ jobs: - name: Create output variable id: code-coverage-summary run: | - content=`cat ../../tests/backend/CoverageReport/SummaryGithub.md` - echo markdown=$content >> $GITHUB_OUTPUT + echo "markdown<> $GITHUB_OUTPUT + cat ../../tests/backend/CoverageReport/SummaryGithub.md >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT - name: "Create or Update PR Comment" uses: im-open/update-pr-comment@v1.2.2 From 9283fe3386960300be2bb42e84f4b7a813730293 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 01:45:40 +0200 Subject: [PATCH 20/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 41b9ff08..f31f2d8b 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -124,8 +124,9 @@ jobs: id: reportgenerator run: | dotnet reportgenerator -reports:"../../tests/backend/**/TestResults/**/coverage.cobertura.xml" -targetdir:"../../tests/backend/CoverageReport" -reporttypes:"Html;Cobertura;MarkdownSummaryGithub;Badges" - content=`cat ../../tests/backend/CoverageReport/SummaryGithub.md` - echo markdown=$content >> $GITHUB_OUTPUT + echo "markdown<> $GITHUB_OUTPUT + cat ../../tests/backend/CoverageReport/SummaryGithub.md >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT - name: "Create or Update PR Comment" uses: im-open/update-pr-comment@v1.2.2 @@ -152,7 +153,7 @@ jobs: id: code-coverage-summary run: | echo "markdown<> $GITHUB_OUTPUT - cat ../../tests/backend/CoverageReport/SummaryGithub.md >> $GITHUB_OUTPUT + cat code-coverage-results.md >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - name: "Create or Update PR Comment" From 153349e7053d791d0aafd1a9f96da005ca59cfdc Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 01:46:58 +0200 Subject: [PATCH 21/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index f31f2d8b..0998a298 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -124,6 +124,7 @@ jobs: id: reportgenerator run: | dotnet reportgenerator -reports:"../../tests/backend/**/TestResults/**/coverage.cobertura.xml" -targetdir:"../../tests/backend/CoverageReport" -reporttypes:"Html;Cobertura;MarkdownSummaryGithub;Badges" + cat ../../tests/backend/CoverageReport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY echo "markdown<> $GITHUB_OUTPUT cat ../../tests/backend/CoverageReport/SummaryGithub.md >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT @@ -152,6 +153,7 @@ jobs: - name: Create output variable id: code-coverage-summary run: | + cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY echo "markdown<> $GITHUB_OUTPUT cat code-coverage-results.md >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT From 991038de554ef0b2020dd5e8d27ac2e721055e80 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 01:48:53 +0200 Subject: [PATCH 22/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 0998a298..ad7b25b8 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -153,6 +153,10 @@ jobs: - name: Create output variable id: code-coverage-summary run: | + echo first + ls -la + echo second + ls -la ../../ cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY echo "markdown<> $GITHUB_OUTPUT cat code-coverage-results.md >> $GITHUB_OUTPUT From e127a207063c14fa3f5b4cb8fbd03036b5f31b97 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 01:50:03 +0200 Subject: [PATCH 23/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index ad7b25b8..d46a36c6 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -153,13 +153,9 @@ jobs: - name: Create output variable id: code-coverage-summary run: | - echo first - ls -la - echo second - ls -la ../../ - cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY + cat ../../code-coverage-results.md >> $GITHUB_STEP_SUMMARY echo "markdown<> $GITHUB_OUTPUT - cat code-coverage-results.md >> $GITHUB_OUTPUT + cat ../../code-coverage-results.md >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - name: "Create or Update PR Comment" From a4c6c1c7e6326db01e5cb9385cb347d491cb4a65 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 20 Apr 2024 01:57:41 +0200 Subject: [PATCH 24/24] TEST-1234 Update backend-ci.yml --- .github/workflows/backend-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index d46a36c6..d1b9dcb4 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -115,7 +115,7 @@ jobs: - uses: dorny/test-reporter@v1 with: - name: WebApi Tests # Name of the check run which will be created + name: "WebApi Tests" path: "tests/backend/WebApi.Tests/TestResults/test-results.trx" reporter: dotnet-trx fail-on-error: true @@ -128,6 +128,7 @@ jobs: echo "markdown<> $GITHUB_OUTPUT cat ../../tests/backend/CoverageReport/SummaryGithub.md >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT + # TODO: commit the badges for README.md - name: "Create or Update PR Comment" uses: im-open/update-pr-comment@v1.2.2