Skip to content

Commit baa3ac6

Browse files
pakrymannelo-msft
authored andcommitted
Add NET 5.0 testing (Azure#16947)
1 parent ecedc47 commit baa3ac6

File tree

115 files changed

+597
-546
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+597
-546
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- Install VS 2019 (Community or higher) and make sure you have the latest updates (https://www.visualstudio.com/).
1010
- Need at least .NET Framework 4.6.1 and 4.7 development tools
1111
- Install the **.NET Core cross-platform development** workloads in VisualStudio
12-
- Install **.NET Core 3.1.301 SDK** for your specific platform. (or a higher version within the 3.1.*** band) (https://dotnet.microsoft.com/download/dotnet-core/3.1)
12+
- Install **.NET Core 5.0.100 SDK** for your specific platform. (or a higher version within the 5.0.*** band) (https://dotnet.microsoft.com/download/dotnet-core/3.1)
1313
- Install the latest version of git (https://git-scm.com/downloads)
1414
- Install [NodeJS](https://nodejs.org/en/) (14.x.x) if you plan to use [C# code generation](https://github.com/Azure/autorest.csharp).
1515

eng/Directory.Build.Data.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<UpdateSourceOnBuild Condition="'$(UpdateSourceOnBuild)' == ''">$(AZURE_DEV_UPDATESOURCESONBUILD)</UpdateSourceOnBuild>
5353
<PowerShellExe Condition="'$(PowerShellExe)' == ''">pwsh</PowerShellExe>
5454
<CoverletOutputFormat Condition="'$(CoverletOutputFormat)' == '' and '$(CollectCoverage)' == 'true'">cobertura</CoverletOutputFormat>
55-
<InheritDocEnabled>true</InheritDocEnabled>
55+
<InheritDocEnabled>false</InheritDocEnabled>
5656
</PropertyGroup>
5757

5858
<PropertyGroup Condition="'$(IsShippingClientLibrary)' == 'true' and '$(TF_BUILD)' == 'true'">
@@ -92,8 +92,8 @@
9292

9393
<PropertyGroup Condition="'$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true' or '$(IsSamplesProject)' == 'true' or '$(IsPerfProject)' == 'true' or '$(IsStressProject)' == 'true'">
9494
<IsPackable>false</IsPackable>
95-
<RequiredTargetFrameworks>netcoreapp2.1</RequiredTargetFrameworks>
96-
<RequiredTargetFrameworks Condition="'$(OS)' == 'Windows_NT'">netcoreapp2.1;net461</RequiredTargetFrameworks>
95+
<RequiredTargetFrameworks>netcoreapp2.1;net5.0</RequiredTargetFrameworks>
96+
<RequiredTargetFrameworks Condition="'$(OS)' == 'Windows_NT'">netcoreapp2.1;net5.0;net461</RequiredTargetFrameworks>
9797
</PropertyGroup>
9898

9999
<Import Project="$(RepoRoot)/sdk/core/Azure.Core/src/Azure.Core.props" Condition="'$(IsMgmtClientLibrary)' == 'true'"/>

eng/Directory.Build.Data.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
<ItemGroup Condition="'$(IsMgmtClientLibrary)' == 'true' and '$(IsTestProject)' == 'true'">
156156
<ProjectReference Include="$(AzureCoreTestFramework)" />
157157
<PackageReference Include="Azure.Identity" />
158-
<PackageReference Include="nunit" />
158+
<PackageReference Include="NUnit" />
159159
<PackageReference Include="NUnit3TestAdapter" />
160160
<PackageReference Include="Microsoft.NET.Test.Sdk" />
161161
<PackageReference Include="Moq" />

eng/Packages.Data.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<ItemGroup>
1010
<PackageReference Update="ApprovalTests" Version="3.0.22" />
1111
<PackageReference Update="ApprovalUtilities" Version="3.0.22" />
12-
<PackageReference Update="AutoRest.CSharp.V3" Version="1.0.0-alpha.20201028.2" />
12+
<PackageReference Update="AutoRest.CSharp.V3" Version="1.0.0-alpha.20201113.1" />
1313
<PackageReference Update="Azure.AI.FormRecognizer" Version="3.0.0" />
1414
<PackageReference Update="Azure.AI.TextAnalytics" Version="5.0.0" />
1515
<PackageReference Update="Azure.Data.AppConfiguration" Version="1.0.0" />
@@ -87,7 +87,7 @@
8787
<PackageReference Update="MSTest.TestFramework" Version="1.3.2" />
8888
<PackageReference Update="Newtonsoft.Json" Version="10.0.3" />
8989
<PackageReference Update="NSubstitute" Version="3.1.0" />
90-
<PackageReference Update="nunit" Version="3.12.0" />
90+
<PackageReference Update="NUnit" Version="3.12.0" />
9191
<PackageReference Update="NUnit3TestAdapter" Version="3.13.0" />
9292
<PackageReference Update="OpenTelemetry" Version="0.8.0-beta.1" />
9393
<PackageReference Update="OpenTelemetry.Extensions.Hosting" Version="0.8.0-beta.1" />

eng/pipelines/templates/jobs/archetype-sdk-client.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
displayName: 'Use Python 3.6'
3434
inputs:
3535
versionSpec: '3.6'
36+
- template: /eng/pipelines/templates/steps/install-dotnet.yml
3637
- script: >-
3738
dotnet pack eng/service.proj -warnaserror
3839
/p:ServiceDirectory=${{ parameters.ServiceDirectory }}
@@ -45,7 +46,6 @@ jobs:
4546
env:
4647
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
4748
DOTNET_CLI_TELEMETRY_OPTOUT: 1
48-
DOTNET_MULTILEVEL_LOOKUP: 0
4949
- template: ../steps/archetype-sdk-docs.yml
5050
parameters:
5151
ServiceDirectory: ${{parameters.ServiceDirectory}}
@@ -88,15 +88,15 @@ jobs:
8888
inputs:
8989
versionSpec: '14.x'
9090
displayName: 'Install NodeJS'
91+
- template: /eng/pipelines/templates/steps/install-dotnet.yml
9192
- task: PowerShell@2
9293
displayName: "Verify generated code"
9394
env:
9495
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
9596
DOTNET_CLI_TELEMETRY_OPTOUT: 1
96-
DOTNET_MULTILEVEL_LOOKUP: 0
9797
inputs:
9898
filePath: "eng/scripts/CodeChecks.ps1"
99-
arguments: -ServiceDirectory ${{parameters.ServiceDirectory}}
99+
arguments: -ServiceDirectory ${{parameters.ServiceToTest}}
100100
pwsh: true
101101
failOnStderr: false
102102
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
@@ -133,13 +133,17 @@ jobs:
133133
MacOs:
134134
OSVmImage: "macOS-10.15"
135135
TestTargetFramework: netcoreapp2.1
136+
Windows_Net50:
137+
OSVmImage: "windows-2019"
138+
TestTargetFramework: net5.0
136139
pool:
137140
vmImage: "$(OSVmImage)"
138141
steps:
139142
- template: /eng/common/pipelines/templates/steps/verify-agent-os.yml
140143
- ${{ each step in parameters.TestSetupSteps }}:
141144
- ${{ each pair in step }}:
142145
${{ pair.key }}: ${{ pair.value }}
146+
- template: /eng/pipelines/templates/steps/install-dotnet.yml
143147
- script: >-
144148
dotnet test eng/service.proj --filter TestCategory!=Live --framework $(TestTargetFramework)
145149
--logger "trx;LogFileName=$(TestTargetFramework).trx" --logger:"console;verbosity=normal"
@@ -150,7 +154,6 @@ jobs:
150154
env:
151155
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
152156
DOTNET_CLI_TELEMETRY_OPTOUT: 1
153-
DOTNET_MULTILEVEL_LOOKUP: 0
154157
- task: PublishTestResults@2
155158
condition: always()
156159
displayName: "Publish Results ($(TestTargetFramework))"

eng/pipelines/templates/jobs/archetype-sdk-mgmt.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ jobs:
44
vmImage: windows-2019
55
steps:
66
#- script: "echo $(system.pullrequest.pullrequestnumber), https://github.com/$(build.repository.id), https://github.com/$(build.repository.ID)"
7+
- template: /eng/pipelines/templates/steps/install-dotnet.yml
78
- script: |
89
if "$(BuildConfiguration)" == "Release" (set SkipTests=true) else (set SkipTests=false)
910
dotnet msbuild mgmt.proj /v:m /t:CreateNugetPackage /p:Configuration=$(BuildConfiguration) /p:SkipTests=%SkipTests% /p:PackageOutputPath=$(Build.ArtifactStagingDirectory) /p:Scope=${{parameters.Scope}} /p:ForPublishing=$(ShouldPublish) $(loggingArgs) $(RPScopeArgs)"
1011
displayName: "Build & Package"
1112
env:
1213
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
1314
DOTNET_CLI_TELEMETRY_OPTOUT: 1
14-
DOTNET_MULTILEVEL_LOOKUP: 0
1515
- task: PublishBuildArtifacts@1
1616
condition: succeededOrFailed()
1717
inputs:
@@ -46,12 +46,12 @@ jobs:
4646
steps:
4747
- template: /eng/common/pipelines/templates/steps/verify-agent-os.yml
4848
- script: "echo $(system.pullrequest.pullrequestnumber), http://github.com/$(build.repository.id), http://github.com/$(build.repository.ID)"
49+
- template: /eng/pipelines/templates/steps/install-dotnet.yml
4950
- script: "dotnet msbuild mgmt.proj /v:n /t:RunTests /p:Scope=${{parameters.Scope}} /p:ForPublishing=$(ShouldPublish) /clp:ShowtimeStamp $(RPScopeArgs)"
5051
displayName: "Build & Run Tests"
5152
env:
5253
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
5354
DOTNET_CLI_TELEMETRY_OPTOUT: 1
54-
DOTNET_MULTILEVEL_LOOKUP: 0
5555
- task: PublishTestResults@2
5656
condition: succeededOrFailed()
5757
inputs:

eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
Write-Host "##vso[task.setvariable variable=TestMode]Record"
8686
}
8787
displayName: Set Test Mode
88-
88+
- template: /eng/pipelines/templates/steps/install-dotnet.yml
8989
- pwsh: >
9090
dotnet test eng/service.proj
9191
--framework $(TestTargetFramework)
@@ -101,7 +101,6 @@ jobs:
101101
env:
102102
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
103103
DOTNET_CLI_TELEMETRY_OPTOUT: 1
104-
DOTNET_MULTILEVEL_LOOKUP: 0
105104
AZURE_TEST_MODE: $(TestMode)
106105
${{ each var in parameters.EnvVars }}:
107106
${{ var.key }}: ${{ var.value }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
steps:
2+
- task: UseDotNet@2
3+
displayName: 'Use .NET Core SDK'
4+
inputs:
5+
useGlobalJson: true
6+
performMultiLevelLookup: true
7+
- task: UseDotNet@2
8+
condition: ne(variables['Agent.OS'], 'Windows_NT') # Windows supports MultiLevelLookup and doesn't need explicit framework installation
9+
displayName: 'Use .NET Core 2.1 runtime'
10+
inputs:
11+
packageType: runtime
12+
version: "2.1.x"

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"Microsoft.Build.Traversal": "1.0.45"
44
},
55
"sdk": {
6-
"version": "3.1.301",
6+
"version": "5.0.100",
77
"rollForward": "feature"
88
}
99
}

sdk/anomalydetector/Azure.AI.AnomalyDetector/tests/Azure.AI.AnomalyDetector.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</PropertyGroup>
55

66
<ItemGroup>
7-
<PackageReference Include="nunit" />
7+
<PackageReference Include="NUnit" />
88
<PackageReference Include="NUnit3TestAdapter" />
99
<PackageReference Include="Microsoft.NET.Test.Sdk" />
1010
<PackageReference Include="Moq" />

0 commit comments

Comments
 (0)