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

Remove testing on no-longer supported .net frameworks #3377

Merged
merged 9 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions e2e/test/E2ETests.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net6.0;net5.0;netcoreapp3.1;netcoreapp2.1.30;net472;net451</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0;net5.0;netcoreapp3.1;netcoreapp2.1.30</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net6.0;net7.0;net472;net451</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0;net7.0</TargetFrameworks>
<!-- By setting this as not a test project for other frameworks, we can run "dotnet test" for a specific framework from the root directory without dotnet throwing if any test project in the solution doesn't support that framework -->
<IsTestProject Condition="'$(OS)' != 'Windows_NT' And '$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net5.0' And '$(TargetFramework)' != 'netcoreapp3.1' And '$(TargetFramework)' != 'netcoreapp2.1.30'">False</IsTestProject>
<IsTestProject Condition="'$(OS)' != 'Windows_NT' And '$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net7.0'">False</IsTestProject>
<LangVersion>9.0</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IsPackable>false</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net6.0;net5.0;netcoreapp3.1;netcoreapp2.1.30;net472;net451</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0;net5.0;netcoreapp3.1;netcoreapp2.1.30</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net6.0;net7.0;net472;net451</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0;net7.0</TargetFrameworks>
<!-- By setting this as not a test project for other frameworks, we can run "dotnet test" for a specific framework from the root directory without dotnet throwing if any test project in the solution doesn't support that framework -->
<IsTestProject Condition="'$(OS)' != 'Windows_NT' And '$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net5.0' And '$(TargetFramework)' != 'netcoreapp3.1' And '$(TargetFramework)' != 'netcoreapp2.1.30'">False</IsTestProject>
<IsTestProject Condition="'$(OS)' != 'Windows_NT' And '$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net7.0'">False</IsTestProject>

<LangVersion>8.0</LangVersion>
<IsPackable>false</IsPackable>
Expand Down
6 changes: 3 additions & 3 deletions iothub/service/tests/Microsoft.Azure.Devices.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net6.0;net5.0;netcoreapp3.1;netcoreapp2.1.30;net472;net451</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0;net5.0;netcoreapp3.1;netcoreapp2.1.30</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net6.0;net7.0;net472;net451</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0;net7.0</TargetFrameworks>
<!-- By setting this as not a test project for other frameworks, we can run "dotnet test" for a specific framework from the root directory without dotnet throwing if any test project in the solution doesn't support that framework -->
<IsTestProject Condition="'$(OS)' != 'Windows_NT' And '$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net5.0' And '$(TargetFramework)' != 'netcoreapp3.1' And '$(TargetFramework)' != 'netcoreapp2.1.30'">False</IsTestProject>
<IsTestProject Condition="'$(OS)' != 'Windows_NT' And '$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net7.0'">False</IsTestProject>
<LangVersion>8.0</LangVersion>
<IsPackable>false</IsPackable>
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;netcoreapp2.1.30</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<!-- By setting this as not a test project for other frameworks, we can run "dotnet test" for a specific framework from the root directory without dotnet throwing if any test project in the solution doesn't support that framework -->
<IsTestProject Condition="'$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net5.0' And '$(TargetFramework)' != 'netcoreapp3.1' And '$(TargetFramework)' != 'netcoreapp2.1.30'">False</IsTestProject>
<LangVersion>8.0</LangVersion>
<IsTestProject Condition="'$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net7.0'">False</IsTestProject> <LangVersion>8.0</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IsPackable>false</IsPackable>
<!-- Suppress framework end of life warnings as we have to keep supporting these frameworks for our customers -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;netcoreapp2.1.30</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<!-- By setting this as not a test project for other frameworks, we can run "dotnet test" for a specific framework from the root directory without dotnet throwing if any test project in the solution doesn't support that framework -->
<IsTestProject Condition="'$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net5.0' And '$(TargetFramework)' != 'netcoreapp3.1' And '$(TargetFramework)' != 'netcoreapp2.1.30'">False</IsTestProject>
<LangVersion>8.0</LangVersion>
<IsTestProject Condition="'$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net7.0'">False</IsTestProject> <LangVersion>8.0</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IsPackable>false</IsPackable>
<!-- Suppress framework end of life warnings as we have to keep supporting these frameworks for our customers -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;netcoreapp2.1.30</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<!-- By setting this as not a test project for other frameworks, we can run "dotnet test" for a specific framework from the root directory without dotnet throwing if any test project in the solution doesn't support that framework -->
<IsTestProject Condition="'$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net5.0' And '$(TargetFramework)' != 'netcoreapp3.1' And '$(TargetFramework)' != 'netcoreapp2.1.30'">False</IsTestProject>
<IsTestProject Condition="'$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net7.0'">False</IsTestProject>
<LangVersion>8.0</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IsPackable>false</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;netcoreapp2.1.30</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<!-- By setting this as not a test project for other frameworks, we can run "dotnet test" for a specific framework from the root directory without dotnet throwing if any test project in the solution doesn't support that framework -->
<IsTestProject Condition="'$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net5.0' And '$(TargetFramework)' != 'netcoreapp3.1' And '$(TargetFramework)' != 'netcoreapp2.1.30'">False</IsTestProject>
<LangVersion>8.0</LangVersion>
<IsTestProject Condition="'$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net7.0'">False</IsTestProject> <LangVersion>8.0</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IsPackable>false</IsPackable>
<!-- Suppress framework end of life warnings as we have to keep supporting these frameworks for our customers -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;netcoreapp2.1.30</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<!-- By setting this as not a test project for other frameworks, we can run "dotnet test" for a specific framework from the root directory without dotnet throwing if any test project in the solution doesn't support that framework -->
<IsTestProject Condition="'$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net5.0' And '$(TargetFramework)' != 'netcoreapp3.1' And '$(TargetFramework)' != 'netcoreapp2.1.30'">False</IsTestProject>
<LangVersion>8.0</LangVersion>
<IsTestProject Condition="'$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net7.0'">False</IsTestProject> <LangVersion>8.0</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IsPackable>false</IsPackable>
<!-- Suppress framework end of life warnings as we have to keep supporting these frameworks for our customers -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net6.0;net5.0;netcoreapp3.1;netcoreapp2.1.30;net472</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0;net5.0;netcoreapp3.1;netcoreapp2.1.30</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net6.0;net7.0;net472</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0;net7.0</TargetFrameworks>
<!-- By setting this as not a test project for other frameworks, we can run "dotnet test" for a specific framework from the root directory without dotnet throwing if any test project in the solution doesn't support that framework -->
<IsTestProject Condition="'$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net5.0' And '$(TargetFramework)' != 'netcoreapp3.1' And '$(TargetFramework)' != 'netcoreapp2.1.30'">False</IsTestProject>
<LangVersion>8.0</LangVersion>
<IsTestProject Condition="'$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net7.0'">False</IsTestProject> <LangVersion>8.0</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IsPackable>false</IsPackable>
<!-- Suppress framework end of life warnings as we have to keep supporting these frameworks for our customers -->
Expand Down
6 changes: 3 additions & 3 deletions shared/tests/Microsoft.Azure.Devices.Shared.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>Microsoft.Azure.Devices.Shared.Tests</RootNamespace>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net6.0;net5.0;netcoreapp3.1;netcoreapp2.1.30;net472;net451</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0;net5.0;netcoreapp3.1;netcoreapp2.1.30</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net6.0;net7.0;net472;net451</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0;net7.0</TargetFrameworks>
<!-- By setting this as not a test project for other frameworks, we can run "dotnet test" for a specific framework from the root directory without dotnet throwing if any test project in the solution doesn't support that framework -->
<IsTestProject Condition="'$(OS)' != 'Windows_NT' And '$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net5.0' And '$(TargetFramework)' != 'netcoreapp3.1' And '$(TargetFramework)' != 'netcoreapp2.1.30'">False</IsTestProject>
<IsTestProject Condition="'$(OS)' != 'Windows_NT' And '$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net7.0'">False</IsTestProject>

<LangVersion>8.0</LangVersion>
<IsPackable>false</IsPackable>
Expand Down
19 changes: 0 additions & 19 deletions shared/tests/TlsVersionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,6 @@ public void SetMinimumTlsVersions_CanSetToTls12()
tlsVersions.Preferred.Should().Be(expected);
}

[TestMethod]
[DataRow(SslProtocols.Tls)]
[DataRow(SslProtocols.Tls11)]
[DataRow(SslProtocols.Tls | SslProtocols.Tls11)]
[DataRow(SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12)]
public void SetMinimumTlsVersions_CanSetToOlderTls(SslProtocols protocol)
{
// arrange
var tlsVersions = new TlsVersions();
SslProtocols expected = protocol | SslProtocols.Tls12;

// act
tlsVersions.SetMinimumTlsVersions(protocol);

// assert
tlsVersions.MinimumTlsVersions.Should().Be(expected);
tlsVersions.Preferred.Should().Be(expected);
}

#pragma warning disable 0618

[TestMethod]
Expand Down
13 changes: 6 additions & 7 deletions supported_platforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ This SDK is tested nightly on a mix of .NET implementations on both Windows 10 a
## Supported .NET versions

The NuGet packages provide support for the following .NET versions:
- .NET 5.0
- .NET 6.0
- .NET 7.0
- .NET Standard 2.1
- .NET Standard 2.0
- .NET Framework 4.7.2 (IoT Hub SDKs only)
Expand All @@ -22,9 +23,8 @@ Note that, while we only directly test on Windows 10, we do support other Window
Nightly test platform details:

.NET versions tested on
- .NET 5.0
- .NET Core 3.1
- .NET Core 2.1.30
- .NET 6.0
- .NET 7.0
- .NET Framework 4.7.2 (only IoT Hub SDKs tested)
- .NET Framework 4.5.1 (only IoT Hub SDKs tested)

Expand All @@ -40,9 +40,8 @@ Note that, while we only directly test on Ubuntu 20.04, we do generally support
Nightly test platform details:

.NET versions tested on:
- .NET 5.0
- .NET Core 3.1
- .NET Core 2.1.30
- .NET 6.0
- .NET 7.0

Default locale: en_US, platform encoding: UTF-8

Expand Down
85 changes: 18 additions & 67 deletions vsts/vsts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ parameters:
type: number
default: 120
- name: testTargets
displayName: The .NET test targets to build and run. 'all' and 'min-matrix' (net6.0, netcore3.1) are aggregates of the remaining values.
displayName: The .NET test targets to build and run. 'all' and 'min-matrix' (net6.0) are aggregates of the remaining values.
type: string
values:
- default
- all
- min-matrix
- net7.0
- net6.0
- net5.0
- netcore3.1
- netcore2.1
- net4.7.2
- net4.5.1
default: default
Expand All @@ -41,11 +39,9 @@ variables:

# The minimum matrix build/test targets.
testNet60: ${{ or(eq(variables['minMatrix'], 'True'), contains(parameters['testTargets'], 'net6.0')) }}
testNetcore31: ${{ or(eq(variables['minMatrix'], 'True'), contains(parameters['testTargets'], 'netcore3.1')) }}

# The remaining build/test targets.
testNet50: ${{ or(eq(variables['allTestTargets'], 'True'), contains(parameters['testTargets'], 'net5.0')) }}
testNetcore21: ${{ or(eq(variables['allTestTargets'], 'True'), contains(parameters['testTargets'], 'netcore2.1')) }}
testNet70: ${{ or(eq(variables['allTestTargets'], 'True'), contains(parameters['testTargets'], 'net7.0')) }}
testNet472: ${{ or(eq(variables['allTestTargets'], 'True'), contains(parameters['testTargets'], 'net4.7.2')) }}
testNet451: ${{ or(eq(variables['allTestTargets'], 'True'), contains(parameters['testTargets'], 'net4.5.1')) }}

Expand Down Expand Up @@ -78,15 +74,9 @@ jobs:
FRAMEWORK: net6.0
# Can't find a good way to skip matrix elements so for now we set an environment variable that the script will use to bail out.
SHOULD_RUN: ${{ eq(variables['testNet60'], 'True') }}
.NET 5.0:
FRAMEWORK: net5.0
SHOULD_RUN: ${{ eq(variables['testNet50'], 'True') }}
.NET CoreApp 3.1:
FRAMEWORK: netcoreapp3.1
SHOULD_RUN: ${{ eq(variables['testNetcore31'], 'True') }}
.NET CoreApp 2.1.30:
FRAMEWORK: netcoreapp2.1.30
SHOULD_RUN: ${{ eq(variables['testNetcore21'], 'True') }}
.NET 7.0:
FRAMEWORK: net7.0
SHOULD_RUN: ${{ eq(variables['testNet70'], 'True') }}
pool:
# If this is changed, don't forget to update supported_platforms.md in the root directory. That document outlines what OS we test on and should stay up to date.
vmImage: ubuntu-20.04
Expand All @@ -109,39 +99,21 @@ jobs:

# https://docs.microsoft.com/azure/devops/pipelines/tasks/tool/dotnet-core-tool-installer?view=azure-devops

# Linux requires .NET 6.0 install for tests to run, no matter which framework target is being tested
# Linux requires .NET 7.0 install for tests to run, no matter which framework target is being tested
- task: UseDotNet@2
displayName: 'Use .NET SDK 6.0'
displayName: 'Use .NET SDK 7.0'
inputs:
packageType: sdk
version: 6.x
version: 7.x
performMultiLevelLookup: true
installationPath: $(Agent.ToolsDirectory)/dotnet

- ${{ if eq(variables['testNet50'], 'True') }}:
- task: UseDotNet@2
displayName: 'Use .NET SDK 5.0'
inputs:
packageType: sdk
version: 5.x
performMultiLevelLookup: true
installationPath: $(Agent.ToolsDirectory)/dotnet

- ${{ if eq(variables['testNetcore31'], 'True') }}:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 3.1'
inputs:
packageType: sdk
version: 3.1.x
performMultiLevelLookup: true
installationPath: $(Agent.ToolsDirectory)/dotnet

- ${{ if eq(variables['testNetcore21'], 'True') }}:
- ${{ if eq(variables['testNet60'], 'True') }}:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 2.1'
displayName: 'Use .NET SDK 6.0'
inputs:
packageType: sdk
version: 2.1.x
version: 6.x
performMultiLevelLookup: true
installationPath: $(Agent.ToolsDirectory)/dotnet

Expand Down Expand Up @@ -360,15 +332,9 @@ jobs:
.NET 6.0:
FRAMEWORK: net6.0
SHOULD_RUN: ${{ eq(variables['testNet60'], 'True') }}
.NET 5.0:
FRAMEWORK: net5.0
SHOULD_RUN: ${{ eq(variables['testNet50'], 'True') }}
.NET CoreApp 3.1:
FRAMEWORK: netcoreapp3.1
SHOULD_RUN: ${{ eq(variables['testNetcore31'], 'True') }}
.NET CoreApp 2.1.30:
FRAMEWORK: netcoreapp2.1.30
SHOULD_RUN: ${{ eq(variables['testNetcore21'], 'True') }}
.NET 7.0:
FRAMEWORK: net7.0
SHOULD_RUN: ${{ eq(variables['testNet70'], 'True') }}
.NET 4.7.2:
FRAMEWORK: net472
SHOULD_RUN: ${{ eq(variables['testNet472'], 'True') }}
Expand Down Expand Up @@ -405,30 +371,15 @@ jobs:
performMultiLevelLookup: true
installationPath: $(Agent.ToolsDirectory)/dotnet

- ${{ if eq(variables['testNet50'], 'True') }}:
- task: UseDotNet@2
displayName: 'Use .NET SDK 5.0'
inputs:
packageType: sdk
version: 5.x
performMultiLevelLookup: true
installationPath: $(Agent.ToolsDirectory)/dotnet

- ${{ if eq(variables['testNetcore31'], 'True') }}:
- ${{ if eq(variables['testNet70'], 'True') }}:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 3.1'
displayName: 'Use .NET SDK 7.0'
inputs:
packageType: sdk
version: 3.1.x
version: 7.x
performMultiLevelLookup: true
installationPath: $(Agent.ToolsDirectory)/dotnet

- ${{ if eq(variables['testNetcore21'], 'True') }}:
- task: CmdLine@2
displayName: 'Install .NET Core 2.1'
inputs:
script: 'choco install dotnetcore-2.1-sdk'

- ${{ if eq(variables['testNet472'], 'True') }}:
- task: CmdLine@2
displayName: 'Install .NET 4.7.2'
Expand Down