Skip to content

Commit

Permalink
add Net5.0 to Test Infra and Bask SDK Tests (#2272)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyMothra committed May 21, 2021
1 parent b273a48 commit 39add8f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 19 deletions.
26 changes: 10 additions & 16 deletions BASE/.vsts/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
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

0 comments on commit 39add8f

Please sign in to comment.