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

Support package.config-style projects #21

Merged
merged 34 commits into from
Aug 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
376b6b1
Add test case for NetFx - WIP
felix-b Jun 23, 2019
8ad4644
Revert bad accidental changes
felix-b Jun 25, 2019
99c3483
Fix Windows-specific patch whitespace issue in tests
felix-b Jun 28, 2019
ffc8483
Add all test case projects
felix-b Aug 3, 2019
a46fc34
Add NetFx test case packages to AppVeyor build
felix-b Aug 6, 2019
4093a27
Fix AppVeyor build script
felix-b Aug 6, 2019
1ae1b98
Fix AppVeyor build script (2)
felix-b Aug 6, 2019
b3bc686
Fix AppVeyor build script (3)
felix-b Aug 6, 2019
ac869a9
Introduce AcceptanceTestTarget to discriminate NetCore/NetFx in accep…
felix-b Aug 7, 2019
5b59c4f
Remove prerelease suffix from acceptance test package versions
felix-b Aug 7, 2019
c0cea6c
Extract all NetCore/NetFx differences in acceptance tests into Accept…
felix-b Aug 7, 2019
6e6f28b
Add missing NuGet.config for running tests on local dev box
felix-b Aug 8, 2019
2a48c92
Add nunit3-console runner package to NetFx test case
felix-b Aug 8, 2019
556d997
Extract path differences in NetCore/NetFx acceptance tests into Accep…
felix-b Aug 10, 2019
95ff858
Parameterize acceptance tests with NetCore/NetFx target
felix-b Aug 11, 2019
e700785
Add NetFx suffix to all folders and files of NetFx test case
felix-b Aug 11, 2019
28f3dde
Fix NetFx test case projects
felix-b Aug 12, 2019
50873a1
Implement NetFxTestTarget
felix-b Aug 13, 2019
e85ccb7
Fix NetFxTestTarget
felix-b Aug 13, 2019
42f4322
Add package solution restore step to AcceptanceTestBase
felix-b Aug 13, 2019
158f56d
Append missing NetFx suffix to package ID in acceptance tests
felix-b Aug 13, 2019
8d2b082
Wrap SymbolicLink with additional diagnostics
felix-b Aug 14, 2019
3a95075
RDP to VS2017 build agent
felix-b Aug 14, 2019
094cc33
Fix acceptance test base for Windows target
felix-b Aug 14, 2019
1e1e8e7
Make PackageReferenceLoader polymorphic for NetCore/NetFx - WIP
felix-b Aug 15, 2019
19fabd2
Refactor project styles
felix-b Aug 17, 2019
907edc9
Implement OldProjectStyle
felix-b Aug 17, 2019
13bf5bd
Fix OldProjectStyle
felix-b Aug 18, 2019
71c532a
Temporarily add diagnostics to acceptance test verifications
felix-b Aug 19, 2019
167f6be
Add more conditional diagnostics in acceptance tests
felix-b Aug 19, 2019
cde07c9
Fix acceptance tests verification
felix-b Aug 19, 2019
b5d7c58
Fix acceptance tests verification (2)
felix-b Aug 19, 2019
54037f6
Fix acceptance tests verification (3)
felix-b Aug 19, 2019
22a08cb
Add NetFx test cases to acceptance test patch
felix-b Aug 19, 2019
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
36 changes: 31 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ for:

dotnet build -c Release

appveyor PushArtifact bin/Release/NuLink.TestCase.FirstPackage.0.1.0-beta1.nupkg
appveyor PushArtifact bin/Release/NuLink.TestCase.FirstPackage.0.1.0.nupkg

cd $APPVEYOR_BUILD_FOLDER/demos/NuLink.TestCase.SecondPackage/NuLink.TestCase.SecondPackage

dotnet build -c Release

appveyor PushArtifact bin/Release/NuLink.TestCase.SecondPackage.0.2.0-beta2.nupkg
appveyor PushArtifact bin/Release/NuLink.TestCase.SecondPackage.0.2.0.nupkg

dotnet tool install -g NuLink --version $APPVEYOR_BUILD_VERSION --add-source https://ci.appveyor.com/nuget/nulink-3672eibylf8q

Expand Down Expand Up @@ -92,27 +92,53 @@ for:

dotnet --info


cd %APPVEYOR_BUILD_FOLDER%\demos\NuLink.TestCase.FirstPackage\NuLink.TestCase.FirstPackage

dotnet build -c Release

appveyor PushArtifact bin\Release\NuLink.TestCase.FirstPackage.0.1.0-beta1.nupkg
appveyor PushArtifact bin\Release\NuLink.TestCase.FirstPackage.0.1.0.nupkg


cd %APPVEYOR_BUILD_FOLDER%\demos\NuLink.TestCase.SecondPackage\NuLink.TestCase.SecondPackage

dotnet build -c Release

appveyor PushArtifact bin\Release\NuLink.TestCase.SecondPackage.0.2.0-beta2.nupkg
appveyor PushArtifact bin\Release\NuLink.TestCase.SecondPackage.0.2.0.nupkg


cd %APPVEYOR_BUILD_FOLDER%\demos\NetFx\NuLink.TestCase.FirstPackage.NetFx\NuLink.TestCase.FirstPackage.NetFx

msbuild ..\NuLink.TestCase.FirstPackage.NetFx.sln /p:Configuration=Release

nuget pack NuLink.TestCase.FirstPackage.NetFx.nuspec

appveyor PushArtifact NuLink.TestCase.FirstPackage.NetFx.0.1.0.nupkg


cd %APPVEYOR_BUILD_FOLDER%\demos\NetFx\NuLink.TestCase.SecondPackage.NetFx\NuLink.TestCase.SecondPackage.NetFx

nuget restore -SolutionDirectory ..

msbuild ..\NuLink.TestCase.SecondPackage.NetFx.sln /p:Configuration=Release

nuget pack NuLink.TestCase.SecondPackage.NetFx.nuspec

appveyor PushArtifact NuLink.TestCase.SecondPackage.NetFx.0.2.0.nupkg

dotnet tool install -g NuLink --version %APPVEYOR_BUILD_VERSION% --add-source https://ci.appveyor.com/nuget/nulink-3672eibylf8q

nulink --version

set NULINK_TEST_USE_INSTALLED=YES

set NULINK_TEST_INCLUDE_DIAGNOSTICS=YES

test_script:
- cmd: >-
cd %APPVEYOR_BUILD_FOLDER%\source\NuLink.Tests

dotnet test -c Release --logger:Appveyor


# on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
6 changes: 6 additions & 0 deletions demos/NetFx/NuLink.TestCase.Consumer/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="AppVeyor" value="https://ci.appveyor.com/nuget/nulink-3672eibylf8q" />
</packageSources>
</configuration>
28 changes: 28 additions & 0 deletions demos/NetFx/NuLink.TestCase.Consumer/NuLink.TestCase.Consumer.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.9
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuLink.TestCase.ConsumerLib", "NuLink.TestCase.ConsumerLib\NuLink.TestCase.ConsumerLib.csproj", "{291F145D-CACC-4263-9760-C866C55E2777}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuLink.TestCase.ConsumerLib.Tests", "NuLink.TestCase.ConsumerLib.Tests\NuLink.TestCase.ConsumerLib.Tests.csproj", "{0D60E2C5-44F1-46D4-9E04-1835D8A1950D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{291F145D-CACC-4263-9760-C866C55E2777}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{291F145D-CACC-4263-9760-C866C55E2777}.Debug|Any CPU.Build.0 = Debug|Any CPU
{291F145D-CACC-4263-9760-C866C55E2777}.Release|Any CPU.ActiveCfg = Release|Any CPU
{291F145D-CACC-4263-9760-C866C55E2777}.Release|Any CPU.Build.0 = Release|Any CPU
{0D60E2C5-44F1-46D4-9E04-1835D8A1950D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D60E2C5-44F1-46D4-9E04-1835D8A1950D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D60E2C5-44F1-46D4-9E04-1835D8A1950D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D60E2C5-44F1-46D4-9E04-1835D8A1950D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using NUnit.Framework;

namespace NuLink.TestCase.ConsumerLib.Tests
{
public class ConsumerClassOneTests
{
[Test]
public void ClassOneShouldUseLocallyLinkedPackage()
{
var consumer = new ConsumerClassOne();
var actualString = consumer.ConsumeStringFromFirstPackage();
var expectedString =
System.Environment.GetEnvironmentVariable($"TEST_{nameof(ClassOneShouldUseLocallyLinkedPackage)}")
?? "???";

Assert.AreEqual($"consumed-by-class-one:{expectedString}", actualString);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using NUnit.Framework;

namespace NuLink.TestCase.ConsumerLib.Tests
{
public class ConsumerClassTwoTests
{
[Test]
public void ClassTwoShouldUseLocallyLinkedPackage()
{
var consumer = new ConsumerClassTwo();
var actualString = consumer.ConsumeStringFromSecondPackage();
var expectedString =
System.Environment.GetEnvironmentVariable($"TEST_{nameof(ClassTwoShouldUseLocallyLinkedPackage)}")
?? "???";

Assert.AreEqual($"consumed-by-class-two:{expectedString}", actualString);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0D60E2C5-44F1-46D4-9E04-1835D8A1950D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NuLink.TestCase.ConsumerLib.Tests</RootNamespace>
<AssemblyName>NuLink.TestCase.ConsumerLib.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ConsumerClassOneTests.cs" />
<Compile Include="ConsumerClassTwoTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NuLink.TestCase.ConsumerLib\NuLink.TestCase.ConsumerLib.csproj">
<Project>{291f145d-cacc-4263-9760-c866c55e2777}</Project>
<Name>NuLink.TestCase.ConsumerLib</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.12.0\build\NUnit.props'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("NuLink.TestCase.ConsumerLib.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NuLink.TestCase.ConsumerLib.Tests")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0d60e2c5-44f1-46d4-9e04-1835d8a1950d")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="3.12.0" targetFramework="net452" />
<package id="NUnit.ConsoleRunner" version="3.10.0" targetFramework="net461" />
</packages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using NuLink.TestCase.FirstPackage;

namespace NuLink.TestCase.ConsumerLib
{
public class ConsumerClassOne
{
public string ConsumeStringFromFirstPackage()
{
var first = new FirstClass();
var firstString = first.GetString();
return $"consumed-by-class-one:{firstString}";
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using NuLink.TestCase.SecondPackage;

namespace NuLink.TestCase.ConsumerLib
{
public class ConsumerClassTwo
{
public string ConsumeStringFromSecondPackage()
{
var second = new SecondClass();
var secondString = second.GetSecondString();
return $"consumed-by-class-two:{secondString}";
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{291F145D-CACC-4263-9760-C866C55E2777}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NuLink.TestCase.ConsumerLib</RootNamespace>
<AssemblyName>NuLink.TestCase.ConsumerLib</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="NuLink.TestCase.FirstPackage.NetFx, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NuLink.TestCase.FirstPackage.NetFx.0.1.0\lib\net45\NuLink.TestCase.FirstPackage.NetFx.dll</HintPath>
</Reference>
<Reference Include="NuLink.TestCase.SecondPackage.NetFx, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NuLink.TestCase.SecondPackage.NetFx.0.2.0\lib\net45\NuLink.TestCase.SecondPackage.NetFx.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ConsumerClassOne.cs" />
<Compile Include="ConsumerClassTwo.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Loading