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 Standard 2.1 support #3530

Merged
merged 29 commits into from
Apr 2, 2019
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
<Compile Include="$(PaketTestsSourcesDir)\PackSpecs.fs" />
<Compile Include="$(PaketTestsSourcesDir)\InstallSpecs.fs" />
<Compile Include="$(PaketTestsSourcesDir)\RestoreSpecs.fs" />
<Compile Include="$(PaketTestsSourcesDir)\AutoRestoreSpec.fs" />
<Compile Include="$(PaketTestsSourcesDir)\FrameworkRestrictionsSpecs.fs" />
<Compile Include="$(PaketTestsSourcesDir)\HttpSpecs.fs" />
<Compile Include="$(PaketTestsSourcesDir)\PaketCoreSpecs.fs" />
Expand Down
30 changes: 0 additions & 30 deletions integrationtests/Paket.IntegrationTests/AutoRestoreSpec.fs

This file was deleted.

14 changes: 0 additions & 14 deletions integrationtests/Paket.IntegrationTests/BasicResolverSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,6 @@ let ``#1189 should allow # in path``() =
lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "FAKE"].Version
|> shouldBeGreaterThan (SemVer.Parse "4.7.2")


[<Test>]
let ``#1247 shouldn't load lockfile in full update``() =
updateEx true "i001247-lockfile-error" |> ignore

[<Test>]
let ``#1247 should report lockfile in parse errror``() =
Copy link
Member

Choose a reason for hiding this comment

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

This should still fail and we should still report a good error message, correct?

try
paket "update --keep-minor" "i001247-lockfile-error" |> ignore

failwith "error was expected"
with
| exn when exn.Message.Contains "paket.lock" -> ()

[<Test>]
let ``#1254 should install unlisted transitive dependencies``() =
let lockFile = update "i001254-unlisted"
Expand Down
33 changes: 0 additions & 33 deletions integrationtests/Paket.IntegrationTests/InstallSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -354,21 +354,6 @@ let ``#1458 should not install conflicting deps from different groups``() =
with
| exn when exn.Message.Contains "Package Nancy is referenced in different versions" -> ()

[<Test;Flaky>]
let ``#2335 should install deps from different groups when using conditions``() =
Copy link
Member

Choose a reason for hiding this comment

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

This is also a very interesting scenario we probably don't have covered in another test

let scenario = "i002335-razorengine"
install scenario |> ignore
let newFile = Path.Combine(scenarioTempPath scenario,"MyClassLibrary","MyClassLibrary","MyClassLibrary.csproj")
let oldFile = Path.Combine(originalScenarioPath scenario,"MyClassLibrary","MyClassLibrary","MyClassLibrary.csprojtemplate")
if updateBaselines then
File.Copy (newFile, oldFile, overwrite=true)
let s1 = File.ReadAllText oldFile |> normalizeLineEndings
let s2 = File.ReadAllText newFile |> normalizeLineEndings
s2 |> shouldEqual s1

//lots of downloaded files => big disk size, better cleanup if test pass
System.IO.Directory.Delete(scenarioTempPath scenario, true)

[<Test>]
let ``#1442 should not warn on SonarLint``() =
let result = paket "install" "i001442-dont-warn"
Expand Down Expand Up @@ -463,17 +448,6 @@ let ``#1746 hard should be softer``() =
let s2 = File.ReadAllText newFile |> normalizeLineEndings
s2 |> shouldEqual s1

[<Test>]
let ``#1333 should install framework refs only once``() =
install "i001333-dup-refs" |> ignore
let newFile = Path.Combine(scenarioTempPath "i001333-dup-refs","ConsoleApplication1","ConsoleApplication1.fsproj")
let oldFile = Path.Combine(originalScenarioPath "i001333-dup-refs","ConsoleApplication1","ConsoleApplication1.fsprojtemplate")
if updateBaselines then
File.Copy (newFile, oldFile, overwrite=true)
let s1 = File.ReadAllText oldFile |> normalizeLineEndings
let s2 = File.ReadAllText newFile |> normalizeLineEndings
s2 |> shouldEqual s1

[<Test>]
let ``#1779 net20 only in net461``() =
install "i001779-net20-only-in-net461" |> ignore
Expand Down Expand Up @@ -518,13 +492,6 @@ let ``#3062 install should use external lock file``() =
newLockFile.Groups.[GroupName "main"].Resolution.ContainsKey (PackageName "FAKE") |> shouldEqual true
newLockFile.Groups.[GroupName "main"].Resolution.[PackageName "Machine.Specifications"].Version |> shouldEqual (SemVer.Parse "0.12")

[<Test;Flaky>]
let ``#3062 install should use external azure functions v1 lock file from http``() =
let newLockFile = install "i003062-azurefunctions"
newLockFile.Groups.[GroupName "main"].Resolution.ContainsKey (PackageName "FAKE") |> shouldEqual true
newLockFile.Groups.[GroupName "main"].Resolution.[PackageName "Newtonsoft.Json"].Version |> shouldEqual (SemVer.Parse "9.0.1")
newLockFile.Groups.[GroupName "main"].Resolution.[PackageName "Microsoft.Azure.WebJobs.Core"].Version |> shouldEqual (SemVer.Parse "2.2.0")


#if INTERACTIVE
;;
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,6 @@ let ``#2289 Paket 4.x install command takes hours to complete``() =
nunitVersion
|> shouldBeSmallerThan (SemVer.Parse "3.0")

[<Test; Flaky>]
let ``#2294 Cannot pin NETStandard.Library = 1.6.0``() =
Copy link
Member

Choose a reason for hiding this comment

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

I feel like both of these are good tests, we should somehow keep them or set them to ignore.
In fact I think if they fail this indicates a regression in the resolver unable to find a solution in the specified test-timeout.
So what looked like "flaky" might just be a perf regression here?

Copy link
Member

Choose a reason for hiding this comment

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

On the other hand, yes resolving this might have become harder with the release of new packages.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it was a regression - we fixed a resolver bug and it that made it slower. shit happens

Copy link
Member

Choose a reason for hiding this comment

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

we fixed a resolver bug and it that made it slower

Isn't that the definition of a perf regression ;)
Anyway I think getting the CI green again is more important than these tests, so fine by me.

Copy link
Member Author

Choose a reason for hiding this comment

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

no. it never was faster - it was just wrong

let lockFile = update "i002294-pin-netstd16"
lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "NETStandard.Library"].Version
|> shouldEqual (SemVer.Parse "1.6")

//lots of downloaded files => big disk size, better cleanup if test pass
System.IO.Directory.Delete(scenarioTempPath "i002294-pin-netstd16", true)

[<Test; Flaky>]
let ``#2294 pin NETStandard.Library = 1.6.0 Strategy Workaround``() =
let lockFile = update "i002294-withstrategy"
lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "NETStandard.Library"].Version
|> shouldEqual (SemVer.Parse "1.6")

//lots of downloaded files => big disk size, better cleanup if test pass
System.IO.Directory.Delete(scenarioTempPath "i002294-withstrategy", true)

[<Test>]
let ``#2922 paket can jump out of loop of doom``() =
try
Expand Down
67 changes: 0 additions & 67 deletions integrationtests/Paket.IntegrationTests/RestoreSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,73 +18,6 @@ let ``#2496 Paket fails on projects that target multiple frameworks``() =
directDotnet true (sprintf "restore %s.csproj" project) wd
|> ignore

[<Test>]
#if FAKE_NETSTANDARD_API
[<Ignore("use an api of FakeLib (net40) unsupported on .net core")>]
#endif
let ``#2812 Lowercase package names in package cache: old csproj, packages folder enabled``() =
let scenario = "i002812-old-csproj-storage-default"
let projectName = "project"
let packageName = "AutoMapper"
let packageNameLowercase = packageName.ToLower()
let workingDir = scenarioTempPath scenario
let csprojFile = workingDir @@ projectName @@ sprintf "%s.csproj" projectName
let packagesDir = workingDir @@ "packages"

[ packageName; packageNameLowercase ] |> Seq.iter clearPackage

prepareSdk scenario
directPaket "restore" scenario |> ignore
isPackageCachedWithOnlyLowercaseNames packageName |> shouldEqual true
packagesDir
|> Directory.GetDirectories
|> Array.map Path.GetFileName
|> shouldEqual [| packageName |]

Fake.MSBuildHelper.MSBuildLoggers <- [] //There is a fsharp.core binding redirect issue on the FakeLib.dll logger
MSBuildRelease workingDir "Build" [ csprojFile ] |> ignore

[<Test>]
let ``#2812 Lowercase package names in package cache: new csproj, packages folder enabled``() =
let scenario = "i002812-new-csproj-storage-default"
let projectName = "project"
let packageName = "AutoMapper"
let packageNameLowercase = packageName.ToLower()
let workingDir = scenarioTempPath scenario
let projectDir = workingDir @@ projectName
let emptyFeedPath = workingDir @@ "emptyFeed"
let packagesDir = workingDir @@ "packages"

[ packageName; packageNameLowercase ] |> Seq.iter clearPackage

prepareSdk scenario
directPaket "restore" scenario |> ignore
isPackageCachedWithOnlyLowercaseNames packageName |> shouldEqual true
packagesDir
|> Directory.GetDirectories
|> Array.map Path.GetFileName
|> shouldEqual [| packageName |]
directDotnet false (sprintf "restore --source \"%s\"" emptyFeedPath) projectDir |> ignore
directDotnet false "build --no-restore" projectDir |> ignore

[<Test>]
let ``#2812 Lowercase package names in package cache: new csproj, packages folder disabled``() =
let scenario = "i002812-new-csproj-storage-default"
let projectName = "project"
let packageName = "AutoMapper"
let packageNameLowercase = packageName.ToLower()
let workingDir = scenarioTempPath scenario
let projectDir = workingDir @@ projectName
let emptyFeedPath = workingDir @@ "emptyFeed"

[ packageName; packageNameLowercase ] |> Seq.iter clearPackage

prepareSdk scenario
directPaket "restore" scenario |> ignore
isPackageCachedWithOnlyLowercaseNames packageName |> shouldEqual true
directDotnet false (sprintf "restore --source \"%s\"" emptyFeedPath) projectDir |> ignore
directDotnet false "build --no-restore" projectDir |> ignore


[<Test>]
let ``#3000-a dotnet restore``() =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7' Or $(TargetFrameworkVersion) == 'v4.7.1' Or $(TargetFrameworkVersion) == 'v4.7.2')">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7' Or $(TargetFrameworkVersion) == 'v4.7.1' Or $(TargetFrameworkVersion) == 'v4.7.2' Or $(TargetFrameworkVersion) == 'v4.8')">
<ItemGroup>
<Reference Include="Dapper">
<HintPath>..\..\packages\Dapper\lib\net45\Dapper.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7' Or $(TargetFrameworkVersion) == 'v4.7.1' Or $(TargetFrameworkVersion) == 'v4.7.2')">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7' Or $(TargetFrameworkVersion) == 'v4.7.1' Or $(TargetFrameworkVersion) == 'v4.7.2' Or $(TargetFrameworkVersion) == 'v4.8')">
<ItemGroup>
<Reference Include="Dapper">
<HintPath>..\..\packages\Dapper\lib\net45\Dapper.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7' Or $(TargetFrameworkVersion) == 'v4.7.1' Or $(TargetFrameworkVersion) == 'v4.7.2')">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7' Or $(TargetFrameworkVersion) == 'v4.7.1' Or $(TargetFrameworkVersion) == 'v4.7.2' Or $(TargetFrameworkVersion) == 'v4.8')">
<ItemGroup>
<Reference Include="Dapper">
<HintPath>..\..\packages\Dapper\lib\net45\Dapper.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7' Or $(TargetFrameworkVersion) == 'v4.7.1' Or $(TargetFrameworkVersion) == 'v4.7.2')">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7' Or $(TargetFrameworkVersion) == 'v4.7.1' Or $(TargetFrameworkVersion) == 'v4.7.2' Or $(TargetFrameworkVersion) == 'v4.8')">
<ItemGroup>
<Reference Include="Dapper">
<HintPath>..\..\packages\Dapper\lib\net45\Dapper.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7' Or $(TargetFrameworkVersion) == 'v4.7.1') Or $(TargetFrameworkVersion) == 'v4.7.2')">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7' Or $(TargetFrameworkVersion) == 'v4.7.1') Or $(TargetFrameworkVersion) == 'v4.7.2' Or $(TargetFrameworkVersion) == 'v4.8')">
<ItemGroup>
<Reference Include="Dapper">
<HintPath>..\..\packages\Dapper\lib\net45\Dapper.dll</HintPath>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7' Or $(TargetFrameworkVersion) == 'v4.7.1' Or $(TargetFrameworkVersion) == 'v4.7.2')">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7' Or $(TargetFrameworkVersion) == 'v4.7.1' Or $(TargetFrameworkVersion) == 'v4.7.2' Or $(TargetFrameworkVersion) == 'v4.8')">
<ItemGroup>
<Reference Include="System.Transactions">
<Paket>True</Paket>
Expand Down

This file was deleted.

This file was deleted.

Loading