Skip to content

Commit f8a1836

Browse files
authored
Engine316 2 (#1061)
* Update frameworks * Update to 3.16.2 * update 3.16.2 * 4.4.0-beta.1 release * remove local nuget source * updated windows build on azure devops to include netcore 3.1 * Changed tests from using net45 to net462 * update target framework to 4.6.2 * fix sdk version * updated lib statements to refer to existing libs * updating github actions with net6 * Adding net 7 support for github action * updating azure pipelines * Update azurepipeline typo
1 parent 82660ca commit f8a1836

40 files changed

+181
-188
lines changed

.github/workflows/NUnit3TestAdapter.Cake.CI.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ jobs:
1212
- uses: actions/setup-dotnet@v2
1313
with:
1414
dotnet-version: |
15-
2.1.x
1615
3.1.x
1716
5.0.x
17+
6.0.x
18+
7.0.x
1819
- name: Build with cake
1920
run: .\build.ps1 -t CI
2021
shell: pwsh

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2011-2020 Charlie Poole, 2014-2022 Terje Sandstrom
3+
Copyright (c) 2011-2020 Charlie Poole, 2014-2023 Terje Sandstrom
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

NUnit3TestAdapter.sln

+3-8
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NUnit.TestAdapter.Tests", "
3838
EndProject
3939
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NUnit3AdapterExternalTests", "src\NUnit3AdapterExternalTests\NUnit3AdapterExternalTests.csproj", "{A4EA819A-D77D-46D3-B2B7-2C754DBD2BC7}"
4040
EndProject
41-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "net35", "net35", "{D41249E3-C080-4B66-8CBD-99CE4D309A10}"
41+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "net462", "net462", "{D41249E3-C080-4B66-8CBD-99CE4D309A10}"
4242
ProjectSection(SolutionItems) = preProject
43-
nuget\net35\NUnit3TestAdapter.props = nuget\net35\NUnit3TestAdapter.props
44-
EndProjectSection
45-
EndProject
46-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "netcoreapp2.1", "netcoreapp2.1", "{A9584E41-6ECE-44B4-A504-41795A65DA5F}"
47-
ProjectSection(SolutionItems) = preProject
48-
nuget\netcoreapp2.1\NUnit3TestAdapter.props = nuget\netcoreapp2.1\NUnit3TestAdapter.props
43+
nuget\net462\NUnit3TestAdapter.props = nuget\net462\NUnit3TestAdapter.props
4944
EndProjectSection
5045
EndProject
5146
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NUnit.TestAdapter.Tests.Acceptance", "src\NUnit.TestAdapter.Tests.Acceptance\NUnit.TestAdapter.Tests.Acceptance.csproj", "{3FAC7EE0-664F-4B11-918B-8E0FF865EE4C}"
@@ -54,6 +49,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github", "github", "{062B17
5449
ProjectSection(SolutionItems) = preProject
5550
.github\dependabot.yml = .github\dependabot.yml
5651
.github\ISSUE_TEMPLATE.md = .github\ISSUE_TEMPLATE.md
52+
.github\workflows\sonarbuild.yml.UnderWork = .github\workflows\sonarbuild.yml.UnderWork
5753
EndProjectSection
5854
EndProject
5955
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{7D708804-B2F1-4A31-A9FB-85A0C7433200}"
@@ -102,7 +98,6 @@ Global
10298
EndGlobalSection
10399
GlobalSection(NestedProjects) = preSolution
104100
{D41249E3-C080-4B66-8CBD-99CE4D309A10} = {DE347D88-F6ED-4031-AFC2-318F63E39BC9}
105-
{A9584E41-6ECE-44B4-A504-41795A65DA5F} = {DE347D88-F6ED-4031-AFC2-318F63E39BC9}
106101
{062B1763-73C8-4B5A-92DF-C66A36C43CE1} = {7CE30108-5D81-4850-BE6B-C8BCA35D3592}
107102
{7D708804-B2F1-4A31-A9FB-85A0C7433200} = {062B1763-73C8-4B5A-92DF-C66A36C43CE1}
108103
{2F940513-5B8F-45A5-A188-7C5D03D1B50D} = {DE347D88-F6ED-4031-AFC2-318F63E39BC9}

appveyor.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: 3.11.{build}
2-
image: Visual Studio 2019
2+
image: Visual Studio 2022
33

44
build_script:
55
- ps: .\build.ps1 -Target "Appveyor"
@@ -9,7 +9,6 @@ test: off
99

1010
artifacts:
1111
- path: package\*.nupkg
12-
- path: package\*.vsix
1312
- path: package\*.zip
1413

1514
deploy:

azure-pipelines.yml

+21-9
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,23 @@ jobs:
99
vmImage: 'windows-latest'
1010
steps:
1111
- task: UseDotNet@2
12-
displayName: Install .NET Core 2.1 runtime
12+
displayName: Install .NET Core 5.0 runtime
13+
inputs:
14+
packageType: runtime
15+
version: 5.x
16+
- task: UseDotNet@2
17+
displayName: Install .NET Core 6.0 sdk
18+
inputs:
19+
version: 6.x
20+
- task: UseDotNet@2
21+
displayName: Install .NET Core 7.0 sdk
22+
inputs:
23+
version: 7.x
24+
- task: UseDotNet@2
25+
displayName: Install .NET Core 3.1 runtime
1326
inputs:
1427
packageType: runtime
15-
version: 2.1.x
28+
version: 3.1.x
1629
- powershell: .\build.ps1 --target=CI --configuration=$(BuildConfiguration)
1730
displayName: Build, package, and test
1831

@@ -25,7 +38,12 @@ jobs:
2538
displayName: Install .NET Core 6.0 sdk
2639
inputs:
2740
version: 6.x
28-
41+
42+
- task: UseDotNet@2
43+
displayName: Install .NET Core 7.0 sdk
44+
inputs:
45+
version: 7.x
46+
2947
- task: UseDotNet@2
3048
displayName: Install .NET Core 5.0 runtime
3149
inputs:
@@ -38,11 +56,5 @@ jobs:
3856
packageType: runtime
3957
version: 3.1.x
4058

41-
- task: UseDotNet@2
42-
displayName: Install .NET Core 2.1 runtime
43-
inputs:
44-
packageType: runtime
45-
version: 2.1.x
46-
4759
- powershell: .\build.ps1 --target=Acceptance --configuration=$(BuildConfiguration)
4860
displayName: Build and test

build.cake

+22-20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#tool vswhere&version=2.8.4
2-
#tool Microsoft.TestPlatform&version=17.0.0
1+
#tool vswhere&version=3.1.1
2+
#tool Microsoft.TestPlatform&version=17.4.0
33

44
//////////////////////////////////////////////////////////////////////
55
// ARGUMENTS
@@ -12,8 +12,8 @@ var configuration = Argument("configuration", "Release");
1212
// SET PACKAGE VERSION
1313
//////////////////////////////////////////////////////////////////////
1414

15-
var version = "4.3.1";
16-
var modifier = "";
15+
var version = "4.4.0";
16+
var modifier = "-beta.1";
1717

1818

1919
var dbgSuffix = configuration.ToLower() == "debug" ? "-dbg" : "";
@@ -74,7 +74,7 @@ var ADAPTER_PROJECT = SRC_DIR + "NUnitTestAdapter/NUnit.TestAdapter.csproj";
7474

7575
var NETCOREAPP_TFM = "netcoreapp3.1";
7676

77-
var ADAPTER_BIN_DIR_NET35 = SRC_DIR + $"NUnitTestAdapter/bin/{configuration}/net35/";
77+
var ADAPTER_BIN_DIR_NET462 = SRC_DIR + $"NUnitTestAdapter/bin/{configuration}/net462/";
7878
var ADAPTER_BIN_DIR_NETCOREAPP = SRC_DIR + $"NUnitTestAdapter/bin/{configuration}/{NETCOREAPP_TFM}/";
7979

8080
var BIN_DIRS = new [] {
@@ -171,7 +171,7 @@ string GetTestAssemblyPath(string framework)
171171
}
172172

173173
foreach (var (framework, vstestFramework, adapterDir) in new[] {
174-
("net46", "Framework45", ADAPTER_BIN_DIR_NET35),
174+
("net462", "Framework45", ADAPTER_BIN_DIR_NET462),
175175
(NETCOREAPP_TFM, NETCOREAPP_TFM, ADAPTER_BIN_DIR_NETCOREAPP)
176176
})
177177
{
@@ -247,20 +247,20 @@ Task("CreateWorkingImage")
247247
CopyFileToDirectory("LICENSE", PACKAGE_IMAGE_DIR);
248248

249249
// dotnet publish doesn't work for .NET 3.5
250-
var net35Files = new FilePath[]
250+
var net462Files = new FilePath[]
251251
{
252-
ADAPTER_BIN_DIR_NET35 + "NUnit3.TestAdapter.dll",
253-
ADAPTER_BIN_DIR_NET35 + "NUnit3.TestAdapter.pdb",
254-
ADAPTER_BIN_DIR_NET35 + "nunit.engine.dll",
255-
ADAPTER_BIN_DIR_NET35 + "nunit.engine.api.dll",
256-
ADAPTER_BIN_DIR_NET35 + "nunit.engine.core.dll",
257-
ADAPTER_BIN_DIR_NET35 + "testcentric.engine.metadata.dll"
252+
ADAPTER_BIN_DIR_NET462 + "NUnit3.TestAdapter.dll",
253+
ADAPTER_BIN_DIR_NET462 + "NUnit3.TestAdapter.pdb",
254+
ADAPTER_BIN_DIR_NET462 + "nunit.engine.dll",
255+
ADAPTER_BIN_DIR_NET462 + "nunit.engine.api.dll",
256+
ADAPTER_BIN_DIR_NET462 + "nunit.engine.core.dll",
257+
ADAPTER_BIN_DIR_NET462 + "testcentric.engine.metadata.dll"
258258
};
259259

260-
var net35Dir = PACKAGE_IMAGE_DIR + "build/net35";
261-
CreateDirectory(net35Dir);
262-
CopyFiles(net35Files, net35Dir);
263-
CopyFileToDirectory("nuget/net35/NUnit3TestAdapter.props", net35Dir);
260+
var net462Dir = PACKAGE_IMAGE_DIR + "build/net462";
261+
CreateDirectory(net462Dir);
262+
CopyFiles(net462Files, net462Dir);
263+
CopyFileToDirectory("nuget/net462/NUnit3TestAdapter.props", net462Dir);
264264

265265
var netcoreDir = PACKAGE_IMAGE_DIR + "build/" + NETCOREAPP_TFM;
266266
DotNetCorePublish(ADAPTER_PROJECT, new DotNetCorePublishSettings
@@ -300,9 +300,9 @@ Task("Rebuild")
300300
.IsDependentOn("Build");
301301

302302
Task("Test")
303-
.IsDependentOn("VSTest-net46")
303+
.IsDependentOn("VSTest-net462")
304304
.IsDependentOn("VSTest-" + NETCOREAPP_TFM)
305-
.IsDependentOn("DotnetTest-net46")
305+
.IsDependentOn("DotnetTest-net462")
306306
.IsDependentOn("DotnetTest-" + NETCOREAPP_TFM);
307307

308308
Task("Package")
@@ -327,7 +327,9 @@ Task("Acceptance")
327327
.Description("Ensures that known project configurations can use the produced NuGet package to restore, build, and run tests.")
328328
.Does(() =>
329329
{
330-
var testAssembly = SRC_DIR + $"NUnit.TestAdapter.Tests.Acceptance/bin/{configuration}/net472/NUnit.VisualStudio.TestAdapter.Tests.Acceptance.dll";
330+
// Target framework specified here should be exactly the same as the one in the acceptance project file.
331+
var targetframework = "net48";
332+
var testAssembly = SRC_DIR + $"NUnit.TestAdapter.Tests.Acceptance/bin/{configuration}/{targetframework}/NUnit.VisualStudio.TestAdapter.Tests.Acceptance.dll";
331333

332334
var keepWorkspaces = Argument<bool?>("keep-workspaces", false) ?? true;
333335

nuget.config

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
44
<clear />
55
<!--<add key="Local" value="C:\nuget" />-->
6-
<add key="nuget" value="https://api.nuget.org/v3/index.json"/>
6+
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
7+
<!--<add key="Local" value="c:\nuget" />-->
78
</packageSources>
89
</configuration>

nuget/NUnit3TestAdapter.nuspec

+10-8
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@
1818
For VS 2017 and forward, you should add this package to every test project in your solution. (Earlier versions only require a single adapter package per solution.)
1919
</description>
2020
<releaseNotes>See https://docs.nunit.org/articles/vs-test-adapter/Adapter-Release-Notes.html </releaseNotes>
21-
<copyright>Copyright (c) 2011-2021 Charlie Poole, 2014-2022 Terje Sandstrom</copyright>
21+
<copyright>Copyright (c) 2011-2021 Charlie Poole, 2014-2023 Terje Sandstrom</copyright>
2222
<language>en-US</language>
2323
<tags>test visualstudio testadapter nunit nunit3 dotnet</tags>
2424

2525
<developmentDependency>false</developmentDependency>
2626
</metadata>
2727
<files>
28-
<file src="build\net35\NUnit3.TestAdapter.dll" target="build\net35\NUnit3.TestAdapter.dll" />
29-
<file src="build\net35\NUnit3.TestAdapter.pdb" target="build\net35\NUnit3.TestAdapter.pdb" />
30-
<file src="build\net35\nunit.engine.dll" target="build\net35\nunit.engine.dll" />
31-
<file src="build\net35\nunit.engine.api.dll" target="build\net35\nunit.engine.api.dll" />
32-
<file src="build\net35\nunit.engine.core.dll" target="build\net35\nunit.engine.core.dll" />
33-
<file src="build\net35\testcentric.engine.metadata.dll" target="build\net35\testcentric.engine.metadata.dll"/>
34-
<file src="build\net35\NUnit3TestAdapter.props" target="build\net35\NUnit3TestAdapter.props" />
28+
<file src="build\net462\NUnit3.TestAdapter.dll" target="build\net462\NUnit3.TestAdapter.dll" />
29+
<file src="build\net462\NUnit3.TestAdapter.pdb" target="build\net462\NUnit3.TestAdapter.pdb" />
30+
<file src="build\net462\nunit.engine.dll" target="build\net462\nunit.engine.dll" />
31+
<file src="build\net462\nunit.engine.api.dll" target="build\net462\nunit.engine.api.dll" />
32+
<file src="build\net462\nunit.engine.core.dll" target="build\net462\nunit.engine.core.dll" />
33+
<file src="build\net462\testcentric.engine.metadata.dll" target="build\net462\testcentric.engine.metadata.dll"/>
34+
<file src="build\net462\NUnit3TestAdapter.props" target="build\net462\NUnit3TestAdapter.props" />
3535

3636
<file src="build\netcoreapp3.1\NUnit3.TestAdapter.dll" target="build\netcoreapp3.1\NUnit3.TestAdapter.dll" />
3737
<file src="build\netcoreapp3.1\NUnit3.TestAdapter.pdb" target="build\netcoreapp3.1\NUnit3.TestAdapter.pdb" />
@@ -40,5 +40,7 @@
4040
<file src="build\netcoreapp3.1\nunit.engine.core.dll" target="build\netcoreapp3.1\nunit.engine.core.dll" />
4141
<file src="build\netcoreapp3.1\testcentric.engine.metadata.dll" target="build\netcoreapp3.1\testcentric.engine.metadata.dll"/>
4242
<file src="build\netcoreapp3.1\NUnit3TestAdapter.props" target="build\netcoreapp3.1\NUnit3TestAdapter.props" />
43+
<file src="build\netcoreapp3.1\Microsoft.Extensions.DependencyModel.dll" target="build\netcoreapp3.1\Microsoft.Extensions.DependencyModel.dll" />
44+
4345
</files>
4446
</package>

nuget/netcoreapp2.1/NUnit3TestAdapter.props

-35
This file was deleted.

nuget/netcoreapp3.1/NUnit3TestAdapter.props

+5
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,10 @@
3131
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
3232
<Visible>False</Visible>
3333
</None>
34+
<None Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.DependencyModel.dll">
35+
<Link>Microsoft.Extensions.DependencyModel.dll</Link>
36+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
37+
<Visible>False</Visible>
38+
</None>
3439
</ItemGroup>
3540
</Project>

src/Directory.Build.props

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
</ItemGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" />
17-
<PackageReference Include="jnm2.ReferenceAssemblies.net35" Version="1.0.1" />
16+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" />
1817
</ItemGroup>
1918

2019
<Target Name="RemoveReferencesToEmbeddedAssembles" AfterTargets="ResolveAssemblyReferences">

src/NUnit.TestAdapter.Tests.Acceptance/AcceptanceTests.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace NUnit.VisualStudio.TestAdapter.Tests.Acceptance
1313
public class Frameworks
1414
{
1515
public const string NetCoreApp31 = "netcoreapp3.1";
16-
public const string NetCoreApp21 = "netcoreapp2.1";
1716
public const string Net50 = "net5.0";
1817
public const string Net60 = "net6.0";
1918
public const string Net70 = "net7.0";
@@ -26,8 +25,8 @@ public abstract class AcceptanceTests
2625

2726
public static string NuGetPackageVersion => Initialization.Value.NupkgVersion;
2827

29-
public const string LowestNetfxTarget = "net35";
30-
public const string LegacyProjectTargetFrameworkVersion = "v3.5";
28+
public const string LowestNetfxTarget = "net462";
29+
public const string LegacyProjectTargetFrameworkVersion = "v4.6.2";
3130

3231
public static IEnumerable<string> TargetFrameworks => new[]
3332
{
@@ -37,7 +36,6 @@ public abstract class AcceptanceTests
3736

3837
public static IEnumerable<string> DotNetCliTargetFrameworks => new[]
3938
{
40-
// Frameworks.NetCoreApp21, // Doesnt seem to be supported by VS 2022 anymore
4139
Frameworks.NetCoreApp31,
4240
Frameworks.Net50,
4341
Frameworks.Net60,

src/NUnit.TestAdapter.Tests.Acceptance/NUnit.TestAdapter.Tests.Acceptance.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="nunit" Version="3.13.3" />
14-
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
14+
<PackageReference Include="NUnit3TestAdapter" Version="4.4.0-beta.1" />
1515
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
1616
<PackageReference Include="NUnit.Analyzers" Version="3.5.0" />
1717
</ItemGroup>

src/NUnit.TestAdapter.Tests.Acceptance/SinglePassingTestResultTests.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -419,10 +419,10 @@ private static void AddPackagesConfig(IsolatedWorkspace workspace)
419419
workspace.AddFile("packages.config", $@"
420420
<?xml version='1.0' encoding='utf-8'?>
421421
<packages>
422-
<package id='Microsoft.CodeCoverage' version='15.9.0' targetFramework='net45' />
423-
<package id='Microsoft.NET.Test.Sdk' version='15.9.0' targetFramework='net45' />
424-
<package id='NUnit' version='3.11.0' targetFramework='net45' />
425-
<package id='NUnit3TestAdapter' version='{NuGetPackageVersion}' targetFramework='net45' />
422+
<package id='Microsoft.CodeCoverage' version='15.9.0' targetFramework='net462' />
423+
<package id='Microsoft.NET.Test.Sdk' version='15.9.0' targetFramework='net462' />
424+
<package id='NUnit' version='3.11.0' targetFramework='net462' />
425+
<package id='NUnit3TestAdapter' version='{NuGetPackageVersion}' targetFramework='net462' />
426426
</packages>");
427427
}
428428

@@ -446,7 +446,7 @@ public static void Legacy_csproj_with_packages_config()
446446
<AppDesignerFolder>Properties</AppDesignerFolder>
447447
<RootNamespace>Test</RootNamespace>
448448
<AssemblyName>Test</AssemblyName>
449-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
449+
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
450450
<FileAlignment>512</FileAlignment>
451451
<Deterministic>true</Deterministic>
452452
<NuGetPackageImportStamp>
@@ -537,7 +537,7 @@ public static void Legacy_vbproj_with_packages_config()
537537
<AssemblyName>Test</AssemblyName>
538538
<FileAlignment>512</FileAlignment>
539539
<MyType>Windows</MyType>
540-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
540+
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
541541
<Deterministic>true</Deterministic>
542542
<NuGetPackageImportStamp>
543543
</NuGetPackageImportStamp>

0 commit comments

Comments
 (0)