Skip to content

Commit

Permalink
Engine316 2 (#1061)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
OsirisTerje authored Feb 25, 2023
1 parent 82660ca commit f8a1836
Show file tree
Hide file tree
Showing 40 changed files with 181 additions and 188 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/NUnit3TestAdapter.Cake.CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ jobs:
- uses: actions/setup-dotnet@v2
with:
dotnet-version: |
2.1.x
3.1.x
5.0.x
6.0.x
7.0.x
- name: Build with cake
run: .\build.ps1 -t CI
shell: pwsh
File renamed without changes.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

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

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 3 additions & 8 deletions NUnit3TestAdapter.sln
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NUnit.TestAdapter.Tests", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NUnit3AdapterExternalTests", "src\NUnit3AdapterExternalTests\NUnit3AdapterExternalTests.csproj", "{A4EA819A-D77D-46D3-B2B7-2C754DBD2BC7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "net35", "net35", "{D41249E3-C080-4B66-8CBD-99CE4D309A10}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "net462", "net462", "{D41249E3-C080-4B66-8CBD-99CE4D309A10}"
ProjectSection(SolutionItems) = preProject
nuget\net35\NUnit3TestAdapter.props = nuget\net35\NUnit3TestAdapter.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "netcoreapp2.1", "netcoreapp2.1", "{A9584E41-6ECE-44B4-A504-41795A65DA5F}"
ProjectSection(SolutionItems) = preProject
nuget\netcoreapp2.1\NUnit3TestAdapter.props = nuget\netcoreapp2.1\NUnit3TestAdapter.props
nuget\net462\NUnit3TestAdapter.props = nuget\net462\NUnit3TestAdapter.props
EndProjectSection
EndProject
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}"
Expand All @@ -54,6 +49,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github", "github", "{062B17
ProjectSection(SolutionItems) = preProject
.github\dependabot.yml = .github\dependabot.yml
.github\ISSUE_TEMPLATE.md = .github\ISSUE_TEMPLATE.md
.github\workflows\sonarbuild.yml.UnderWork = .github\workflows\sonarbuild.yml.UnderWork
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{7D708804-B2F1-4A31-A9FB-85A0C7433200}"
Expand Down Expand Up @@ -102,7 +98,6 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{D41249E3-C080-4B66-8CBD-99CE4D309A10} = {DE347D88-F6ED-4031-AFC2-318F63E39BC9}
{A9584E41-6ECE-44B4-A504-41795A65DA5F} = {DE347D88-F6ED-4031-AFC2-318F63E39BC9}
{062B1763-73C8-4B5A-92DF-C66A36C43CE1} = {7CE30108-5D81-4850-BE6B-C8BCA35D3592}
{7D708804-B2F1-4A31-A9FB-85A0C7433200} = {062B1763-73C8-4B5A-92DF-C66A36C43CE1}
{2F940513-5B8F-45A5-A188-7C5D03D1B50D} = {DE347D88-F6ED-4031-AFC2-318F63E39BC9}
Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 3.11.{build}
image: Visual Studio 2019
image: Visual Studio 2022

build_script:
- ps: .\build.ps1 -Target "Appveyor"
Expand All @@ -9,7 +9,6 @@ test: off

artifacts:
- path: package\*.nupkg
- path: package\*.vsix
- path: package\*.zip

deploy:
Expand Down
30 changes: 21 additions & 9 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,23 @@ jobs:
vmImage: 'windows-latest'
steps:
- task: UseDotNet@2
displayName: Install .NET Core 2.1 runtime
displayName: Install .NET Core 5.0 runtime
inputs:
packageType: runtime
version: 5.x
- task: UseDotNet@2
displayName: Install .NET Core 6.0 sdk
inputs:
version: 6.x
- task: UseDotNet@2
displayName: Install .NET Core 7.0 sdk
inputs:
version: 7.x
- task: UseDotNet@2
displayName: Install .NET Core 3.1 runtime
inputs:
packageType: runtime
version: 2.1.x
version: 3.1.x
- powershell: .\build.ps1 --target=CI --configuration=$(BuildConfiguration)
displayName: Build, package, and test

Expand All @@ -25,7 +38,12 @@ jobs:
displayName: Install .NET Core 6.0 sdk
inputs:
version: 6.x


- task: UseDotNet@2
displayName: Install .NET Core 7.0 sdk
inputs:
version: 7.x

- task: UseDotNet@2
displayName: Install .NET Core 5.0 runtime
inputs:
Expand All @@ -38,11 +56,5 @@ jobs:
packageType: runtime
version: 3.1.x

- task: UseDotNet@2
displayName: Install .NET Core 2.1 runtime
inputs:
packageType: runtime
version: 2.1.x

- powershell: .\build.ps1 --target=Acceptance --configuration=$(BuildConfiguration)
displayName: Build and test
42 changes: 22 additions & 20 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#tool vswhere&version=2.8.4
#tool Microsoft.TestPlatform&version=17.0.0
#tool vswhere&version=3.1.1
#tool Microsoft.TestPlatform&version=17.4.0

//////////////////////////////////////////////////////////////////////
// ARGUMENTS
Expand All @@ -12,8 +12,8 @@ var configuration = Argument("configuration", "Release");
// SET PACKAGE VERSION
//////////////////////////////////////////////////////////////////////

var version = "4.3.1";
var modifier = "";
var version = "4.4.0";
var modifier = "-beta.1";


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

var NETCOREAPP_TFM = "netcoreapp3.1";

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

var BIN_DIRS = new [] {
Expand Down Expand Up @@ -171,7 +171,7 @@ string GetTestAssemblyPath(string framework)
}

foreach (var (framework, vstestFramework, adapterDir) in new[] {
("net46", "Framework45", ADAPTER_BIN_DIR_NET35),
("net462", "Framework45", ADAPTER_BIN_DIR_NET462),
(NETCOREAPP_TFM, NETCOREAPP_TFM, ADAPTER_BIN_DIR_NETCOREAPP)
})
{
Expand Down Expand Up @@ -247,20 +247,20 @@ Task("CreateWorkingImage")
CopyFileToDirectory("LICENSE", PACKAGE_IMAGE_DIR);
// dotnet publish doesn't work for .NET 3.5
var net35Files = new FilePath[]
var net462Files = new FilePath[]
{
ADAPTER_BIN_DIR_NET35 + "NUnit3.TestAdapter.dll",
ADAPTER_BIN_DIR_NET35 + "NUnit3.TestAdapter.pdb",
ADAPTER_BIN_DIR_NET35 + "nunit.engine.dll",
ADAPTER_BIN_DIR_NET35 + "nunit.engine.api.dll",
ADAPTER_BIN_DIR_NET35 + "nunit.engine.core.dll",
ADAPTER_BIN_DIR_NET35 + "testcentric.engine.metadata.dll"
ADAPTER_BIN_DIR_NET462 + "NUnit3.TestAdapter.dll",
ADAPTER_BIN_DIR_NET462 + "NUnit3.TestAdapter.pdb",
ADAPTER_BIN_DIR_NET462 + "nunit.engine.dll",
ADAPTER_BIN_DIR_NET462 + "nunit.engine.api.dll",
ADAPTER_BIN_DIR_NET462 + "nunit.engine.core.dll",
ADAPTER_BIN_DIR_NET462 + "testcentric.engine.metadata.dll"
};
var net35Dir = PACKAGE_IMAGE_DIR + "build/net35";
CreateDirectory(net35Dir);
CopyFiles(net35Files, net35Dir);
CopyFileToDirectory("nuget/net35/NUnit3TestAdapter.props", net35Dir);
var net462Dir = PACKAGE_IMAGE_DIR + "build/net462";
CreateDirectory(net462Dir);
CopyFiles(net462Files, net462Dir);
CopyFileToDirectory("nuget/net462/NUnit3TestAdapter.props", net462Dir);
var netcoreDir = PACKAGE_IMAGE_DIR + "build/" + NETCOREAPP_TFM;
DotNetCorePublish(ADAPTER_PROJECT, new DotNetCorePublishSettings
Expand Down Expand Up @@ -300,9 +300,9 @@ Task("Rebuild")
.IsDependentOn("Build");

Task("Test")
.IsDependentOn("VSTest-net46")
.IsDependentOn("VSTest-net462")
.IsDependentOn("VSTest-" + NETCOREAPP_TFM)
.IsDependentOn("DotnetTest-net46")
.IsDependentOn("DotnetTest-net462")
.IsDependentOn("DotnetTest-" + NETCOREAPP_TFM);

Task("Package")
Expand All @@ -327,7 +327,9 @@ Task("Acceptance")
.Description("Ensures that known project configurations can use the produced NuGet package to restore, build, and run tests.")
.Does(() =>
{
var testAssembly = SRC_DIR + $"NUnit.TestAdapter.Tests.Acceptance/bin/{configuration}/net472/NUnit.VisualStudio.TestAdapter.Tests.Acceptance.dll";
// Target framework specified here should be exactly the same as the one in the acceptance project file.
var targetframework = "net48";
var testAssembly = SRC_DIR + $"NUnit.TestAdapter.Tests.Acceptance/bin/{configuration}/{targetframework}/NUnit.VisualStudio.TestAdapter.Tests.Acceptance.dll";
var keepWorkspaces = Argument<bool?>("keep-workspaces", false) ?? true;
Expand Down
5 changes: 3 additions & 2 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<!--<add key="Local" value="C:\nuget" />-->
<add key="nuget" value="https://api.nuget.org/v3/index.json"/>
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<!--<add key="Local" value="c:\nuget" />-->
</packageSources>
</configuration>
18 changes: 10 additions & 8 deletions nuget/NUnit3TestAdapter.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@
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.)
</description>
<releaseNotes>See https://docs.nunit.org/articles/vs-test-adapter/Adapter-Release-Notes.html </releaseNotes>
<copyright>Copyright (c) 2011-2021 Charlie Poole, 2014-2022 Terje Sandstrom</copyright>
<copyright>Copyright (c) 2011-2021 Charlie Poole, 2014-2023 Terje Sandstrom</copyright>
<language>en-US</language>
<tags>test visualstudio testadapter nunit nunit3 dotnet</tags>

<developmentDependency>false</developmentDependency>
</metadata>
<files>
<file src="build\net35\NUnit3.TestAdapter.dll" target="build\net35\NUnit3.TestAdapter.dll" />
<file src="build\net35\NUnit3.TestAdapter.pdb" target="build\net35\NUnit3.TestAdapter.pdb" />
<file src="build\net35\nunit.engine.dll" target="build\net35\nunit.engine.dll" />
<file src="build\net35\nunit.engine.api.dll" target="build\net35\nunit.engine.api.dll" />
<file src="build\net35\nunit.engine.core.dll" target="build\net35\nunit.engine.core.dll" />
<file src="build\net35\testcentric.engine.metadata.dll" target="build\net35\testcentric.engine.metadata.dll"/>
<file src="build\net35\NUnit3TestAdapter.props" target="build\net35\NUnit3TestAdapter.props" />
<file src="build\net462\NUnit3.TestAdapter.dll" target="build\net462\NUnit3.TestAdapter.dll" />
<file src="build\net462\NUnit3.TestAdapter.pdb" target="build\net462\NUnit3.TestAdapter.pdb" />
<file src="build\net462\nunit.engine.dll" target="build\net462\nunit.engine.dll" />
<file src="build\net462\nunit.engine.api.dll" target="build\net462\nunit.engine.api.dll" />
<file src="build\net462\nunit.engine.core.dll" target="build\net462\nunit.engine.core.dll" />
<file src="build\net462\testcentric.engine.metadata.dll" target="build\net462\testcentric.engine.metadata.dll"/>
<file src="build\net462\NUnit3TestAdapter.props" target="build\net462\NUnit3TestAdapter.props" />

<file src="build\netcoreapp3.1\NUnit3.TestAdapter.dll" target="build\netcoreapp3.1\NUnit3.TestAdapter.dll" />
<file src="build\netcoreapp3.1\NUnit3.TestAdapter.pdb" target="build\netcoreapp3.1\NUnit3.TestAdapter.pdb" />
Expand All @@ -40,5 +40,7 @@
<file src="build\netcoreapp3.1\nunit.engine.core.dll" target="build\netcoreapp3.1\nunit.engine.core.dll" />
<file src="build\netcoreapp3.1\testcentric.engine.metadata.dll" target="build\netcoreapp3.1\testcentric.engine.metadata.dll"/>
<file src="build\netcoreapp3.1\NUnit3TestAdapter.props" target="build\netcoreapp3.1\NUnit3TestAdapter.props" />
<file src="build\netcoreapp3.1\Microsoft.Extensions.DependencyModel.dll" target="build\netcoreapp3.1\Microsoft.Extensions.DependencyModel.dll" />

</files>
</package>
File renamed without changes.
35 changes: 0 additions & 35 deletions nuget/netcoreapp2.1/NUnit3TestAdapter.props

This file was deleted.

5 changes: 5 additions & 0 deletions nuget/netcoreapp3.1/NUnit3TestAdapter.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</None>
<None Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.DependencyModel.dll">
<Link>Microsoft.Extensions.DependencyModel.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</None>
</ItemGroup>
</Project>
3 changes: 1 addition & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" />
<PackageReference Include="jnm2.ReferenceAssemblies.net35" Version="1.0.1" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" />
</ItemGroup>

<Target Name="RemoveReferencesToEmbeddedAssembles" AfterTargets="ResolveAssemblyReferences">
Expand Down
6 changes: 2 additions & 4 deletions src/NUnit.TestAdapter.Tests.Acceptance/AcceptanceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace NUnit.VisualStudio.TestAdapter.Tests.Acceptance
public class Frameworks
{
public const string NetCoreApp31 = "netcoreapp3.1";
public const string NetCoreApp21 = "netcoreapp2.1";
public const string Net50 = "net5.0";
public const string Net60 = "net6.0";
public const string Net70 = "net7.0";
Expand All @@ -26,8 +25,8 @@ public abstract class AcceptanceTests

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

public const string LowestNetfxTarget = "net35";
public const string LegacyProjectTargetFrameworkVersion = "v3.5";
public const string LowestNetfxTarget = "net462";
public const string LegacyProjectTargetFrameworkVersion = "v4.6.2";

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

public static IEnumerable<string> DotNetCliTargetFrameworks => new[]
{
// Frameworks.NetCoreApp21, // Doesnt seem to be supported by VS 2022 anymore
Frameworks.NetCoreApp31,
Frameworks.Net50,
Frameworks.Net60,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<ItemGroup>
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.4.0-beta.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,10 @@ private static void AddPackagesConfig(IsolatedWorkspace workspace)
workspace.AddFile("packages.config", $@"
<?xml version='1.0' encoding='utf-8'?>
<packages>
<package id='Microsoft.CodeCoverage' version='15.9.0' targetFramework='net45' />
<package id='Microsoft.NET.Test.Sdk' version='15.9.0' targetFramework='net45' />
<package id='NUnit' version='3.11.0' targetFramework='net45' />
<package id='NUnit3TestAdapter' version='{NuGetPackageVersion}' targetFramework='net45' />
<package id='Microsoft.CodeCoverage' version='15.9.0' targetFramework='net462' />
<package id='Microsoft.NET.Test.Sdk' version='15.9.0' targetFramework='net462' />
<package id='NUnit' version='3.11.0' targetFramework='net462' />
<package id='NUnit3TestAdapter' version='{NuGetPackageVersion}' targetFramework='net462' />
</packages>");
}

Expand All @@ -446,7 +446,7 @@ public static void Legacy_csproj_with_packages_config()
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Test</RootNamespace>
<AssemblyName>Test</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
Expand Down Expand Up @@ -537,7 +537,7 @@ public static void Legacy_vbproj_with_packages_config()
<AssemblyName>Test</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
Expand Down
Loading

0 comments on commit f8a1836

Please sign in to comment.