diff --git a/builds/azure-pipelines/template-steps-build-test-linux.yml b/builds/azure-pipelines/template-steps-build-test-linux.yml index 59a553e62..94eae5877 100644 --- a/builds/azure-pipelines/template-steps-build-test-linux.yml +++ b/builds/azure-pipelines/template-steps-build-test-linux.yml @@ -6,7 +6,12 @@ parameters: steps: - task: UseDotNet@2 - displayName: 'Install .NET Core SDK 3.1.x for Build' + displayName: 'Install .NET Core SDK 5.0.x for Running Tests' + inputs: + version: '5.0.x' + +- task: UseDotNet@2 + displayName: 'Install .NET Core 3.1 SDK for Azure Functions Build' inputs: version: '3.1.x' @@ -131,13 +136,7 @@ steps: inputs: command: test projects: '${{ parameters.solution }}' - arguments: '--configuration ${{ parameters.configuration }} ${{ parameters.testFilter }} /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=$(Build.ArtifactStagingDirectory)\TestResults\coverage\ /p:Exclude="[*]Microsoft.Azure.WebJobs.Extensions.Sql.Samples.*"' - -- task: PublishCodeCoverageResults@1 - displayName: 'Publish Code Coverage Results' - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: '$(Build.ArtifactStagingDirectory)/TestResults/coverage/coverage.cobertura.xml' + arguments: '--configuration ${{ parameters.configuration }} ${{ parameters.testFilter }} --collect "Code Coverage" -s $(Build.SourcesDirectory)/test/coverage.runsettings' - script: | docker stop sql1 diff --git a/builds/azure-pipelines/template-steps-build-test.yml b/builds/azure-pipelines/template-steps-build-test.yml index b291e5f32..379513133 100644 --- a/builds/azure-pipelines/template-steps-build-test.yml +++ b/builds/azure-pipelines/template-steps-build-test.yml @@ -127,10 +127,4 @@ steps: inputs: command: test projects: '${{ parameters.solution }}' - arguments: '--configuration ${{ parameters.configuration }} ${{ parameters.testFilter }} /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=$(Build.ArtifactStagingDirectory)\TestResults\coverage\ /p:Exclude="[*]Microsoft.Azure.WebJobs.Extensions.Sql.Samples.*"' - -- task: PublishCodeCoverageResults@1 - displayName: 'Publish Code Coverage Results' - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: '$(Build.ArtifactStagingDirectory)\TestResults\coverage\coverage.cobertura.xml' + arguments: '--configuration ${{ parameters.configuration }} ${{ parameters.testFilter }} --collect "Code Coverage" -s $(Build.SourcesDirectory)/test/coverage.runsettings' \ No newline at end of file diff --git a/test/Integration/IntegrationTestBase.cs b/test/Integration/IntegrationTestBase.cs index 4619f3a99..97ed29457 100644 --- a/test/Integration/IntegrationTestBase.cs +++ b/test/Integration/IntegrationTestBase.cs @@ -181,7 +181,7 @@ protected void StartFunctionHost(string functionName, bool useTestFolder = false this.FunctionHost.BeginOutputReadLine(); this.FunctionHost.BeginErrorReadLine(); - Thread.Sleep(5000); // This is just to give some time to func host to start, maybe there's a better way to do this (check if port's open?) + Thread.Sleep(10000); // This is just to give some time to func host to start, maybe there's a better way to do this (check if port's open?) } private string GetFunctionsCoreToolsPath() diff --git a/test/Microsoft.Azure.WebJobs.Extensions.Sql.Tests.csproj b/test/Microsoft.Azure.WebJobs.Extensions.Sql.Tests.csproj index 92ff1fa41..578804e98 100644 --- a/test/Microsoft.Azure.WebJobs.Extensions.Sql.Tests.csproj +++ b/test/Microsoft.Azure.WebJobs.Extensions.Sql.Tests.csproj @@ -7,12 +7,10 @@ - + - - diff --git a/test/coverage.runsettings b/test/coverage.runsettings new file mode 100644 index 000000000..2495b1594 --- /dev/null +++ b/test/coverage.runsettings @@ -0,0 +1,19 @@ + + + + + + + True + + + + .*\Microsoft.Azure.WebJobs.Extensions.Sql.dll$ + + + + + + + + \ No newline at end of file