diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index d29a6192a..d1bd6fab0 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -100,12 +100,16 @@ extends: arguments: '--configuration $(BuildConfiguration) --no-incremental' # Run the Unit test - - task: DotNetCoreCLI@2 + - pwsh: | + dotnet test "$(Build.SourcesDirectory)\Microsoft.OpenApi.slnx" ` + --configuration $(BuildConfiguration) ` + --no-build ` + -- ` + --report-azdo ` + --publish-azdo-test-results ` + --results-directory="$(Agent.TempDirectory)\TestResults" ` + --minimum-expected-tests 1 displayName: 'test' - inputs: - command: test - projects: '$(Build.SourcesDirectory)\Microsoft.OpenApi.slnx' - arguments: '--configuration $(BuildConfiguration) --no-build' - task: EsrpCodeSigning@6 displayName: 'ESRP CodeSigning binaries' diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 49c969ced..22ae8e30f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,35 +1,48 @@ version: 2 updates: - - package-ecosystem: "github-actions" - # default location of `.github/workflows` - directory: "/" - open-pull-requests-limit: 10 - schedule: - interval: "daily" - - package-ecosystem: "nuget" - # location of package manifests - directory: "/" - open-pull-requests-limit: 10 - schedule: - interval: "daily" - groups: - MicrosoftExtensions: - patterns: - - "Microsoft.Extensions.*" - coverlet: - patterns: - - "coverlet.*" - - package-ecosystem: dotnet-sdk - directory: / - schedule: - interval: "daily" - ignore: - - dependency-name: '*' - update-types: - - version-update:semver-major - - version-update:semver-minor - - package-ecosystem: "devcontainers" - directory: "/" - open-pull-requests-limit: 10 - schedule: - interval: "daily" +- package-ecosystem: github-actions + directory: / + open-pull-requests-limit: 10 + schedule: + interval: daily + groups: + codeql: + patterns: + - github/codeql-action* + cooldown: + default-days: 7 +- package-ecosystem: nuget + directory: / + open-pull-requests-limit: 10 + schedule: + interval: daily + groups: + MicrosoftExtensions: + patterns: + - Microsoft.Extensions.* + testing: + patterns: + - coverlet.* + - Microsoft.NET.Test.Sdk + - Microsoft.Testing.* + - xunit.* + cooldown: + default-days: 7 +- package-ecosystem: dotnet-sdk + directory: / + schedule: + interval: daily + ignore: + - dependency-name: '*' + update-types: + - version-update:semver-major + - version-update:semver-minor + cooldown: + default-days: 7 +- package-ecosystem: devcontainers + directory: / + open-pull-requests-limit: 10 + schedule: + interval: daily + cooldown: + default-days: 7 diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index fb99868ee..967cfe776 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -45,7 +45,7 @@ jobs: id: run_unit_tests shell: pwsh run: | - dotnet test Microsoft.OpenApi.slnx -c Release --no-build -v n --collect:"XPlat Code Coverage" + dotnet test --solution Microsoft.OpenApi.slnx -c Release -v n --results-directory=./TestResults --coverlet --coverlet-output-format cobertura --report-gh - name: Install report generator shell: pwsh @@ -55,7 +55,7 @@ jobs: - name: Generate coverage report shell: pwsh run: | - reportgenerator -reports:**/coverage.cobertura.xml -targetdir:./reports/coverage -reporttypes:"Html;MarkdownSummaryGithub;Cobertura" + reportgenerator -reports:./TestResults/**/coverage.cobertura.*.xml -targetdir:./reports/coverage -reporttypes:"Html;MarkdownSummaryGithub;Cobertura" - name: Add coverage to job summary shell: bash diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index fe5afd83a..545c995dd 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -68,5 +68,5 @@ jobs: dotnet tool run dotnet-sonarscanner begin /k:"microsoft_OpenAPI.NET" /o:"microsoft" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="test/**/coverage.opencover.xml" dotnet workload restore dotnet build - dotnet test Microsoft.OpenApi.slnx --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - dotnet tool run dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file + dotnet test --solution Microsoft.OpenApi.slnx --verbosity normal --coverlet --coverlet-output-format opencover --report-gh + dotnet tool run dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" diff --git a/global.json b/global.json index d0c1ec64c..2f38dd557 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,8 @@ { "sdk": { - "version": "10.0.302" + "version": "10.0.400" + }, + "test": { + "runner": "Microsoft.Testing.Platform" } } \ No newline at end of file diff --git a/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj b/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj index aa951724a..2271cbb81 100644 --- a/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj +++ b/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj @@ -10,15 +10,16 @@ CA2007 true ..\..\src\Microsoft.OpenApi.snk + true - - + + + + - - - + diff --git a/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj b/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj index 94b847f86..c050aa8cd 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj +++ b/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj @@ -4,6 +4,7 @@ false true ..\..\src\Microsoft.OpenApi.snk + true @@ -15,11 +16,11 @@ - - - - - + + + + + diff --git a/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj b/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj index 78235960d..9c7675513 100644 --- a/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj +++ b/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj @@ -5,16 +5,17 @@ true Library ..\..\src\Microsoft.OpenApi.snk + true - - - + + + + - - - + +