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 NET 5.0 testing #16947

Merged
merged 30 commits into from
Nov 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b73da0c
Add 5.0 testing
pakrym Nov 13, 2020
b825633
tests
pakrym Nov 13, 2020
f92c652
install dotnet
pakrym Nov 13, 2020
d289b44
builds
pakrym Nov 13, 2020
f521405
unit case
pakrym Nov 13, 2020
0402dfc
performMultiLevelLookup
pakrym Nov 13, 2020
455b5cc
DOTNET_MULTILEVEL_LOOKUP
pakrym Nov 13, 2020
1555356
install step
pakrym Nov 13, 2020
8c6481c
try moving comment arround
pakrym Nov 13, 2020
f18db1d
try moving comment arround
pakrym Nov 13, 2020
2681215
2.1.x
pakrym Nov 13, 2020
011abd2
fix recording path
pakrym Nov 13, 2020
7f18c9d
GetDeclaredProperty
pakrym Nov 13, 2020
02e6f45
fix more tests
pakrym Nov 13, 2020
4b65da3
fix/disable System.Object[] autorest
pakrym Nov 13, 2020
77ed34f
fix more tests
pakrym Nov 14, 2020
af8f31e
fix a few more
pakrym Nov 14, 2020
e050087
feedbacl
pakrym Nov 16, 2020
23527f9
5.0
pakrym Nov 16, 2020
4d9be9c
Merge remote-tracking branch 'azure/master' into pakrym/Add-5-0-testing
pakrym Nov 20, 2020
549235e
Let's see if devops has 5.0
pakrym Nov 20, 2020
8056354
Let's see if devops has 5.0
pakrym Nov 20, 2020
290a129
fix syntax
pakrym Nov 20, 2020
f820645
fix some targets
pakrym Nov 20, 2020
b4cfe26
fix a new test
pakrym Nov 20, 2020
f391ef6
Merge remote-tracking branch 'azure/master' into pakrym/Add-5-0-testing
pakrym Nov 23, 2020
52acc7a
fix identity build
pakrym Nov 23, 2020
5dd7fbc
Disable more warnings
pakrym Nov 23, 2020
f58d9e0
Merge remote-tracking branch 'azure/master' into pakrym/Add-5-0-testing
pakrym Nov 23, 2020
1695493
disable InheritDoc
pakrym Nov 23, 2020
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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- Install VS 2019 (Community or higher) and make sure you have the latest updates (https://www.visualstudio.com/).
- Need at least .NET Framework 4.6.1 and 4.7 development tools
- Install the **.NET Core cross-platform development** workloads in VisualStudio
- 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)
- 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)
- Install the latest version of git (https://git-scm.com/downloads)
- Install [NodeJS](https://nodejs.org/en/) (14.x.x) if you plan to use [C# code generation](https://github.com/Azure/autorest.csharp).

Expand Down
6 changes: 3 additions & 3 deletions eng/Directory.Build.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<UpdateSourceOnBuild Condition="'$(UpdateSourceOnBuild)' == ''">$(AZURE_DEV_UPDATESOURCESONBUILD)</UpdateSourceOnBuild>
<PowerShellExe Condition="'$(PowerShellExe)' == ''">pwsh</PowerShellExe>
<CoverletOutputFormat Condition="'$(CoverletOutputFormat)' == '' and '$(CollectCoverage)' == 'true'">cobertura</CoverletOutputFormat>
<InheritDocEnabled>true</InheritDocEnabled>
<InheritDocEnabled>false</InheritDocEnabled>
</PropertyGroup>

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

<PropertyGroup Condition="'$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true' or '$(IsSamplesProject)' == 'true' or '$(IsPerfProject)' == 'true' or '$(IsStressProject)' == 'true'">
<IsPackable>false</IsPackable>
<RequiredTargetFrameworks>netcoreapp2.1</RequiredTargetFrameworks>
<RequiredTargetFrameworks Condition="'$(OS)' == 'Windows_NT'">netcoreapp2.1;net461</RequiredTargetFrameworks>
<RequiredTargetFrameworks>netcoreapp2.1;net5.0</RequiredTargetFrameworks>
<RequiredTargetFrameworks Condition="'$(OS)' == 'Windows_NT'">netcoreapp2.1;net5.0;net461</RequiredTargetFrameworks>
</PropertyGroup>

<Import Project="$(RepoRoot)/sdk/core/Azure.Core/src/Azure.Core.props" Condition="'$(IsMgmtClientLibrary)' == 'true'"/>
Expand Down
2 changes: 1 addition & 1 deletion eng/Directory.Build.Data.targets
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
<ItemGroup Condition="'$(IsMgmtClientLibrary)' == 'true' and '$(IsTestProject)' == 'true'">
<ProjectReference Include="$(AzureCoreTestFramework)" />
<PackageReference Include="Azure.Identity" />
<PackageReference Include="nunit" />
<PackageReference Include="NUnit" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package name is somehow case sensitive now.

<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
Expand Down
4 changes: 2 additions & 2 deletions eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Update="ApprovalTests" Version="3.0.22" />
<PackageReference Update="ApprovalUtilities" Version="3.0.22" />
<PackageReference Update="AutoRest.CSharp.V3" Version="1.0.0-alpha.20201028.2" />
<PackageReference Update="AutoRest.CSharp.V3" Version="1.0.0-alpha.20201113.1" />
<PackageReference Update="Azure.AI.FormRecognizer" Version="3.0.0" />
<PackageReference Update="Azure.AI.TextAnalytics" Version="5.0.0" />
<PackageReference Update="Azure.Data.AppConfiguration" Version="1.0.0" />
Expand Down Expand Up @@ -87,7 +87,7 @@
<PackageReference Update="MSTest.TestFramework" Version="1.3.2" />
<PackageReference Update="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Update="NSubstitute" Version="3.1.0" />
<PackageReference Update="nunit" Version="3.12.0" />
<PackageReference Update="NUnit" Version="3.12.0" />
<PackageReference Update="NUnit3TestAdapter" Version="3.13.0" />
<PackageReference Update="OpenTelemetry" Version="0.8.0-beta.1" />
<PackageReference Update="OpenTelemetry.Extensions.Hosting" Version="0.8.0-beta.1" />
Expand Down
11 changes: 7 additions & 4 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
displayName: 'Use Python 3.6'
inputs:
versionSpec: '3.6'
- template: /eng/pipelines/templates/steps/install-dotnet.yml
- script: >-
dotnet pack eng/service.proj -warnaserror
/p:ServiceDirectory=${{ parameters.ServiceDirectory }}
Expand All @@ -45,7 +46,6 @@ jobs:
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_MULTILEVEL_LOOKUP: 0
- template: ../steps/archetype-sdk-docs.yml
parameters:
ServiceDirectory: ${{parameters.ServiceDirectory}}
Expand Down Expand Up @@ -88,15 +88,15 @@ jobs:
inputs:
versionSpec: '14.x'
displayName: 'Install NodeJS'
- template: /eng/pipelines/templates/steps/install-dotnet.yml
- task: PowerShell@2
displayName: "Verify generated code"
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_MULTILEVEL_LOOKUP: 0
inputs:
filePath: "eng/scripts/CodeChecks.ps1"
arguments: -ServiceDirectory ${{parameters.ServiceDirectory}}
arguments: -ServiceDirectory ${{parameters.ServiceToTest}}
pakrym marked this conversation as resolved.
Show resolved Hide resolved
pwsh: true
failOnStderr: false
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
Expand Down Expand Up @@ -133,13 +133,17 @@ jobs:
MacOs:
OSVmImage: "macOS-10.15"
TestTargetFramework: netcoreapp2.1
Windows_Net50:
OSVmImage: "windows-2019"
TestTargetFramework: net5.0
pool:
vmImage: "$(OSVmImage)"
steps:
- template: /eng/common/pipelines/templates/steps/verify-agent-os.yml
- ${{ each step in parameters.TestSetupSteps }}:
- ${{ each pair in step }}:
${{ pair.key }}: ${{ pair.value }}
- template: /eng/pipelines/templates/steps/install-dotnet.yml
- script: >-
dotnet test eng/service.proj --filter TestCategory!=Live --framework $(TestTargetFramework)
--logger "trx;LogFileName=$(TestTargetFramework).trx" --logger:"console;verbosity=normal"
Expand All @@ -150,7 +154,6 @@ jobs:
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_MULTILEVEL_LOOKUP: 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let dotnet host reuse existing frameworks on the machine.

- task: PublishTestResults@2
condition: always()
displayName: "Publish Results ($(TestTargetFramework))"
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/templates/jobs/archetype-sdk-mgmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ jobs:
vmImage: windows-2019
steps:
#- script: "echo $(system.pullrequest.pullrequestnumber), https://github.com/$(build.repository.id), https://github.com/$(build.repository.ID)"
- template: /eng/pipelines/templates/steps/install-dotnet.yml
- script: |
if "$(BuildConfiguration)" == "Release" (set SkipTests=true) else (set SkipTests=false)
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)"
displayName: "Build & Package"
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_MULTILEVEL_LOOKUP: 0
- task: PublishBuildArtifacts@1
condition: succeededOrFailed()
inputs:
Expand Down Expand Up @@ -46,12 +46,12 @@ jobs:
steps:
- template: /eng/common/pipelines/templates/steps/verify-agent-os.yml
- script: "echo $(system.pullrequest.pullrequestnumber), http://github.com/$(build.repository.id), http://github.com/$(build.repository.ID)"
- template: /eng/pipelines/templates/steps/install-dotnet.yml
- script: "dotnet msbuild mgmt.proj /v:n /t:RunTests /p:Scope=${{parameters.Scope}} /p:ForPublishing=$(ShouldPublish) /clp:ShowtimeStamp $(RPScopeArgs)"
displayName: "Build & Run Tests"
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_MULTILEVEL_LOOKUP: 0
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
Expand Down
3 changes: 1 addition & 2 deletions eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
Write-Host "##vso[task.setvariable variable=TestMode]Record"
}
displayName: Set Test Mode

- template: /eng/pipelines/templates/steps/install-dotnet.yml
- pwsh: >
dotnet test eng/service.proj
--framework $(TestTargetFramework)
Expand All @@ -101,7 +101,6 @@ jobs:
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_MULTILEVEL_LOOKUP: 0
AZURE_TEST_MODE: $(TestMode)
${{ each var in parameters.EnvVars }}:
${{ var.key }}: ${{ var.value }}
Expand Down
12 changes: 12 additions & 0 deletions eng/pipelines/templates/steps/install-dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK'
inputs:
useGlobalJson: true
pakrym marked this conversation as resolved.
Show resolved Hide resolved
performMultiLevelLookup: true
- task: UseDotNet@2
condition: ne(variables['Agent.OS'], 'Windows_NT') # Windows supports MultiLevelLookup and doesn't need explicit framework installation
pakrym marked this conversation as resolved.
Show resolved Hide resolved
displayName: 'Use .NET Core 2.1 runtime'
inputs:
packageType: runtime
version: "2.1.x"
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Microsoft.Build.Traversal": "1.0.45"
},
"sdk": {
"version": "3.1.301",
"version": "5.0.100",
pakrym marked this conversation as resolved.
Show resolved Hide resolved
pakrym marked this conversation as resolved.
Show resolved Hide resolved
"rollForward": "feature"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="nunit" />
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="nunit" />
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
Expand Down
Loading