Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 10 commits into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions BASE/.vsts/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ strategy:
framework: netcoreapp2.1
netcoreapp3_1:
framework: netcoreapp3.1
net5_0:
framework: net5.0
maxParallel: 2

steps:
Expand All @@ -20,6 +22,11 @@ steps:
displayName: install dotnet core 3.1
inputs:
version: 3.1.x

- task: UseDotNet@2
cijothomas marked this conversation as resolved.
Show resolved Hide resolved
displayName: install dotnet 5.0
inputs:
version: '5.0.x'

- task: DotNetCoreCLI@2
displayName: DotNetCoreCLI - Restore Solution
Expand All @@ -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
Expand All @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,12 @@ public async Task SendAsyncHandleResponseForPartialContentResponse()
// 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
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void ParameterlessConstructorInitializesRequiredFields()
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ public void LoadInstanceSetsInstancePropertiesOfTimeSpanTypeFromChildElementValu
}

[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.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down