add Net5.0 to Test Infra and Bask SDK Tests (#2272)

This commit is contained in:
Timothy Mothra 2021-05-20 17:09:31 -07:00 коммит произвёл GitHub
Родитель b273a482e7
Коммит 39add8f796
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 18 добавлений и 19 удалений

Просмотреть файл

@ -3,10 +3,12 @@ pool:
strategy:
matrix:
netcoreapp2_1:
framework: netcoreapp2.1
#netcoreapp2_1:
# framework: netcoreapp2.1
netcoreapp3_1:
framework: netcoreapp3.1
net5_0:
framework: net5.0
maxParallel: 2
steps:
@ -20,6 +22,11 @@ steps:
displayName: install dotnet core 3.1
inputs:
version: 3.1.x
- task: UseDotNet@2
displayName: install dotnet 5.0
inputs:
version: '5.0.x'
- task: DotNetCoreCLI@2
displayName: DotNetCoreCLI - Restore Solution
@ -38,7 +45,7 @@ steps:
displayName: DotNetCoreCLI - Test $(framework)
inputs:
command: "test"
projects: "BASE/Test/**/Microsoft.ApplicationInsights.Tests.csproj"
projects: "BASE/Test/**/*.Tests.csproj"
arguments: "--configuration Release --framework $(framework) --no-build -l trx --filter TestCategory!=WindowsOnly"
## Publish Test results
@ -49,16 +56,3 @@ steps:
testRunner: "VSTest"
testResultsFiles: "**/*.trx"
failTaskOnFailedTests: true
#- task: DotNetCoreCLI@2
# inputs:
# command: "publish"
# publishWebProjects: "True"
# arguments: "--configuration Release --output $(build.artifactstagingdirectory)"
# zipAfterPublish: "True"
#- task: PublishBuildArtifacts@1
# inputs:
# PathtoPublish: "$(build.artifactstagingdirectory)"
# ArtifactName: "drop"
# ArtifactType: "Container"

Просмотреть файл

@ -220,7 +220,12 @@
// VALIDATE
Assert.AreEqual(206, result.StatusCode);
Assert.AreEqual("5", result.RetryAfterHeader);
#if NET5_0
Assert.IsTrue(result.Content == string.Empty);
#else
Assert.IsNull(result.Content);
#endif
}
}

Просмотреть файл

@ -34,7 +34,7 @@ namespace Microsoft.ApplicationInsights.DataContracts
Assert.IsFalse(request.Source == null);
Assert.IsFalse(request.Name == null);
Assert.IsFalse(request.ResponseCode == null);
Assert.IsFalse(request.Duration == null);
Assert.IsTrue(request.Duration == default);
Assert.IsTrue(request.Success == null);
Assert.IsTrue(request.Data.success);
Assert.AreEqual(SamplingDecision.None, request.ProactiveSamplingDecision);

Просмотреть файл

@ -504,7 +504,7 @@
}
[TestMethod]
#if NETCOREAPP3_1
#if NETCOREAPP3_1 || NET5_0
[ExpectedExceptionWithMessage(typeof(ArgumentException), "Failed to parse configuration value. Property: 'TimeSpanProperty' Reason: String 'TestValue' was not recognized as a valid TimeSpan.")]
#else
[ExpectedExceptionWithMessage(typeof(ArgumentException), "Failed to parse configuration value. Property: 'TimeSpanProperty' Reason: String was not recognized as a valid TimeSpan.")]

Просмотреть файл

@ -2,7 +2,7 @@
<Import Project="$(PropsRoot)\Test.props" />
<PropertyGroup>
<TargetFrameworks>net452;net46;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net452;net46;netcoreapp2.1;netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks Condition="$(OS) != 'Windows_NT'">netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>