diff --git a/Directory.Packages.props b/Directory.Packages.props index 506f00f..03d8250 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,18 +5,21 @@ false + - + + + - + - + \ No newline at end of file diff --git a/Ionide.KeepAChangelog.sln b/Ionide.KeepAChangelog.sln index a63cfdc..3641f27 100644 --- a/Ionide.KeepAChangelog.sln +++ b/Ionide.KeepAChangelog.sln @@ -3,12 +3,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30114.105 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{31D4F8AF-532B-4DDF-BBA3-FD9B4C8FDA73}" -EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Ionide.KeepAChangelog.Tasks", "src\Ionide.KeepAChangelog.Tasks.fsproj", "{6CCAEBD2-9EE9-4540-AECF-02F0221B9C87}" -EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Ionide.KeepAChangelog.Tasks.Test", "tests\Ionide.KeepAChangelog.Tasks.Test.fsproj", "{6456526B-A0F6-4998-A57A-772A055DF8AD}" EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Ionide.KeepAChangelog.Tasks", "src\Ionide.KeepAChangelog.Tasks.fsproj", "{E2704404-A047-4BAE-8AF9-58DAAFF02952}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -18,16 +16,15 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6CCAEBD2-9EE9-4540-AECF-02F0221B9C87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6CCAEBD2-9EE9-4540-AECF-02F0221B9C87}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6CCAEBD2-9EE9-4540-AECF-02F0221B9C87}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6CCAEBD2-9EE9-4540-AECF-02F0221B9C87}.Release|Any CPU.Build.0 = Release|Any CPU {6456526B-A0F6-4998-A57A-772A055DF8AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6456526B-A0F6-4998-A57A-772A055DF8AD}.Debug|Any CPU.Build.0 = Debug|Any CPU {6456526B-A0F6-4998-A57A-772A055DF8AD}.Release|Any CPU.ActiveCfg = Release|Any CPU {6456526B-A0F6-4998-A57A-772A055DF8AD}.Release|Any CPU.Build.0 = Release|Any CPU + {E2704404-A047-4BAE-8AF9-58DAAFF02952}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E2704404-A047-4BAE-8AF9-58DAAFF02952}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E2704404-A047-4BAE-8AF9-58DAAFF02952}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E2704404-A047-4BAE-8AF9-58DAAFF02952}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution - {6CCAEBD2-9EE9-4540-AECF-02F0221B9C87} = {31D4F8AF-532B-4DDF-BBA3-FD9B4C8FDA73} EndGlobalSection EndGlobal diff --git a/src/Directory.Build.props b/src/Directory.Build.props index ad20c70..53b352e 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -9,4 +9,4 @@ - \ No newline at end of file + diff --git a/src/Library.fs b/src/Library.fs index 9169259..07c36a7 100644 --- a/src/Library.fs +++ b/src/Library.fs @@ -47,7 +47,7 @@ type ChangelogExtensions = static member Unwrapped(sections: ChangelogSectionCollection) = sections |> Seq.choose (fun section -> - match SemVersion.TryParse section.MarkdownVersion with + match SemVersion.TryParse(section.MarkdownVersion, SemVersionStyles.Any) with | false, _ -> None | true, version -> Some @@ -63,11 +63,14 @@ type ChangelogExtensions = |> Seq.fold (fun (builder: StringBuilder) subsection -> let state = builder.AppendLine $"### {subsection.Type}" + |> (fun x -> x.AppendLine "") subsection.ItemCollection - |> Seq.fold (fun (builder: StringBuilder) line -> builder.AppendLine line.MarkdownText) state) + |> Seq.fold (fun (builder: StringBuilder) line -> builder.AppendLine $"- {line.MarkdownText}") state + |> (fun x -> x.AppendLine "")) builder |> _.ToString() + |> _.Trim() type ParseChangeLogs() = inherit Task() diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 0000000..e4e5f3e --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1,2 @@ +test-package-cache +test-nupkgs diff --git a/tests/IntegrationTests.fs b/tests/IntegrationTests.fs index 6852950..f4fbdcf 100644 --- a/tests/IntegrationTests.fs +++ b/tests/IntegrationTests.fs @@ -1,27 +1,180 @@ module Tests.IntegrationTests -open Tests.Setup -open Moq -open Microsoft.Build.Framework -open Ionide.KeepAChangelog.Tasks -open Shouldly +open System.IO +open System.Runtime.CompilerServices +open System.Threading.Tasks +open Microsoft.VisualStudio.TestTools.UnitTesting +open BlackFox.CommandLine +open Faqt +open SimpleExec +open Workspace -// [] -// let ``works for 'ci' type with default config`` () = -// let buildEngine = Mock() -// let errors = ResizeArray() -// buildEngine -// .Setup(fun x -> x.LogErrorEvent(It.IsAny())) -// .Callback(fun args -> errors.Add(args)) -// |> ignore +module Utils = + let packAndGetPackageProperties projectName = + let packageCache = VirtualWorkspace.``test-package-cache``.``.`` + if Directory.Exists packageCache then + Directory.Delete(packageCache, true) + Directory.CreateDirectory packageCache |> ignore + Command.Run( + "dotnet", + CmdLine.empty + |> CmdLine.appendPrefix "restore" projectName + |> CmdLine.appendPrefix "--packages" VirtualWorkspace.``test-package-cache``.``.`` + |> CmdLine.toString, + workingDirectory = Workspace.fixtures.``.`` + ) + Command.ReadAsync( + "dotnet", + CmdLine.empty + |> CmdLine.appendPrefix "pack" projectName + |> CmdLine.appendPrefix "-c" "Release" + |> CmdLine.append "--no-restore" + |> CmdLine.appendRaw "--getProperty:Version" + |> CmdLine.appendRaw "--getProperty:PackageVersion" + |> CmdLine.appendRaw "--getProperty:PackageReleaseNotes" + |> CmdLine.toString, + workingDirectory = Workspace.fixtures.``.`` + ) -// let item = Mock() -// item.Setup(fun x -> x.GetMetadata("MaximeTest")).Returns("test") |> ignore +type StringHelper = + [] + static member ReplaceEscapedNewLines (s: string) = + s.ReplaceLineEndings().Replace("\\r\\n","\\n") -// let myTask = ParseChangelog(ChangelogFile = "MyChangelog.md") -// myTask.BuildEngine <- buildEngine.Object +[] +type IntegrationTests() = -// let success = myTask.Execute() + member val testPackageVersion = null with get, set -// success.ShouldBeTrue() + member this.AddPackageReference(projectName: string) = + let suffix = projectName.Replace(".fsproj", "") + + this.testPackageVersion <- $"0.0.1-test-{suffix}" + + + // Create a package to be used in the tests + // I didn't find a way to test the MSBuild tasks execution using MSBuild only + // So each fsproj, will use a package reference to the package created here + Command.Run( + "dotnet", + CmdLine.empty + |> CmdLine.appendPrefix "pack" "src" + |> CmdLine.appendPrefix "-c" "Release" + |> CmdLine.appendPrefix "-o" VirtualWorkspace.``test-nupkgs``.``.`` + |> CmdLine.appendRaw $"-p:PackageVersion=%s{this.testPackageVersion}" + |> CmdLine.toString, + workingDirectory = Workspace.``..``.``.`` + ) + + Command.Run( + "dotnet", + CmdLine.empty + |> CmdLine.appendPrefix "add" projectName + |> CmdLine.appendPrefix "package" "Ionide.KeepAChangelog.Tasks" + // |> CmdLine.appendPrefix "--source" VirtualWorkspace.``test-nupkgs``.``.`` + |> CmdLine.appendPrefix "--version" $"[{this.testPackageVersion}]" + |> CmdLine.toString, + workingDirectory = Workspace.fixtures.``.`` + ) + + + [] + member this.``works for absolute path with keep a changelog``() : Task = + task { + let projectName = "WorksForAbsolutePathWithKeepAChangelog.fsproj" + + this.AddPackageReference projectName + + let! struct (stdout, _) = Utils.packAndGetPackageProperties projectName + + stdout + .ReplaceEscapedNewLines() + .Should() + .Be( + """{ + "Properties": { + "Version": "0.1.0", + "PackageVersion": "0.1.0", + "PackageReleaseNotes": "### Added\n\n- Created the package\n- Added a second line\n\n### Changed\n\n- Updated the package" + } +} +""" + ) + |> ignore + } + + [] + member this.``works for relative path with keep a changelog``() : Task = + task { + let projectName = "WorksForRelativePathWithKeepAChangelog.fsproj" + + this.AddPackageReference projectName + + let! struct (stdout, _) = Utils.packAndGetPackageProperties projectName + + stdout + .ReplaceEscapedNewLines() + .Should() + .Be( + """{ + "Properties": { + "Version": "0.1.0", + "PackageVersion": "0.1.0", + "PackageReleaseNotes": "### Added\n\n- Created the package\n- Added a second line\n\n### Changed\n\n- Updated the package" + } +} +""" + ) + |> ignore + } + + [] + member this.``fails if no changelog is specified``() : Task = + task { + let projectName = "FailIfChangelogNotSpecified.fsproj" + + this.AddPackageReference projectName + + let! struct (stdout, _) = Utils.packAndGetPackageProperties projectName + + stdout + .ReplaceEscapedNewLines() + .Should() + .Be( + """{ + "Properties": { + "Version": "1.0.0", + "PackageVersion": "1.0.0", + "PackageReleaseNotes": "" + } +} +""" + ) + |> ignore + } + + [] + member this.``fails if changelog specified doesn't exist``() : Task = + task { + let projectName = "FailIfChangelogDoesNotExist.fsproj" + + this.AddPackageReference projectName + + let! struct (stdout, _) = Utils.packAndGetPackageProperties projectName + + stdout + .ReplaceEscapedNewLines() + .Should() + .Be( + """{ + "Properties": { + "Version": "1.0.0", + "PackageVersion": "1.0.0", + "PackageReleaseNotes": "" + } +} +""" + ) + |> ignore + } diff --git a/tests/Ionide.KeepAChangelog.Tasks.Test.fsproj b/tests/Ionide.KeepAChangelog.Tasks.Test.fsproj index 2e03bf3..311c781 100644 --- a/tests/Ionide.KeepAChangelog.Tasks.Test.fsproj +++ b/tests/Ionide.KeepAChangelog.Tasks.Test.fsproj @@ -7,20 +7,22 @@ - + - + - + + + + - @@ -28,4 +30,8 @@ + + + + diff --git a/tests/Setup.fs b/tests/Setup.fs deleted file mode 100644 index bb6f1b1..0000000 --- a/tests/Setup.fs +++ /dev/null @@ -1,27 +0,0 @@ -module Tests.Setup - -open Fixie -open System -open System.Collections.Generic -open System.Reflection - -[] -type TestAttribute() = - inherit Attribute() - -type TestModuleDiscovery() = - interface IDiscovery with - member _.TestClasses(concreteClasses: IEnumerable) = - concreteClasses - |> Seq.filter (fun cls -> - cls.GetMembers() |> Seq.exists (fun m -> m.Has()) - ) - - member _.TestMethods(publicMethods: IEnumerable) = - publicMethods |> Seq.filter (fun x -> x.Has() && x.IsStatic) - -type TestProject() = - interface ITestProject with - member _.Configure(configuration: TestConfiguration, environment: TestEnvironment) = - configuration.Conventions.Add() - \ No newline at end of file diff --git a/tests/UnitTests.fs b/tests/UnitTests.fs index 0bf664f..32b328f 100644 --- a/tests/UnitTests.fs +++ b/tests/UnitTests.fs @@ -1,10 +1,11 @@ module Tests.UnitTests -open Tests.Setup open Moq open Microsoft.Build.Framework open Ionide.KeepAChangelog.Tasks -open Shouldly +open Faqt +open Faqt.Operators +open Microsoft.VisualStudio.TestTools.UnitTesting open Workspace type TestContext = @@ -15,91 +16,103 @@ type TestContext = member this.PrintErrors() = this.Errors |> Seq.iter (fun error -> printfn "Error: %s" error.Message) +[] +type UnitTests() = -let private setupBuildEngine () = - let context = - { - BuildEngine = Mock() - Errors = ResizeArray() - } + member val context = Unchecked.defaultof with get, set + [] + member this.Initialize() = + this.context <- + { + BuildEngine = Mock() + Errors = ResizeArray() + } - context.BuildEngine - .Setup(fun engine -> engine.LogErrorEvent(It.IsAny())) - .Callback(fun (args: BuildErrorEventArgs) -> context.Errors.Add(args)) - |> ignore + this.context.BuildEngine + .Setup(fun engine -> engine.LogErrorEvent(It.IsAny())) + .Callback(fun (args: BuildErrorEventArgs) -> this.context.Errors.Add(args)) + |> ignore - context + [] + member this.``task fails when changelog file does not exist`` () = -[] -let ``task fails when changelog file does not exist`` () = - let context = setupBuildEngine () + let myTask = ParseChangeLogs(ChangelogFile = "ThisFileDoesNotExist.md") + myTask.BuildEngine <- this.context.BuildEngine.Object - let myTask = ParseChangeLogs(ChangelogFile = "ThisFileDoesNotExist.md") - myTask.BuildEngine <- context.BuildEngine.Object + let success = myTask.Execute() - let success = myTask.Execute() + %success.Should().BeFalse() + %this.context.Errors.Count.Should().Be(1) + %this.context.Errors.[0].Code.Should().Be("IKC0001") - success.ShouldBeFalse() - context.Errors.Count.ShouldBe(1) - context.Errors.[0].Code.ShouldBe("IKC0001") + [] + member this.``task succeeds when changelog file exists (relative path)`` () = + // When running tests, the working directory is where the dll is located + let myTask = ParseChangeLogs(ChangelogFile = "../../../changelogs/CHANGELOG.md") -[] -let ``task succeeds when changelog file exists (relative path)`` () = - let context = setupBuildEngine () + myTask.BuildEngine <- this.context.BuildEngine.Object - // When running tests, the working directory is where the dll is located - let myTask = ParseChangeLogs(ChangelogFile = "../../../fixtures/CHANGELOG.md") + let success = myTask.Execute() - myTask.BuildEngine <- context.BuildEngine.Object + this.context.PrintErrors() - let success = myTask.Execute() + %success.Should().BeTrue() + %this.context.Errors.Count.Should().Be(0) - context.PrintErrors() + [] + member this.``task succeeds when changelog file exists (absolute path)`` () = + let myTask = ParseChangeLogs(ChangelogFile = Workspace.changelogs.``CHANGELOG.md``) + myTask.BuildEngine <- this.context.BuildEngine.Object - success.ShouldBeTrue() - context.Errors.Count.ShouldBe(0) + let success = myTask.Execute() -[] -let ``task succeeds when changelog file exists (absolute path)`` () = - let context = setupBuildEngine () + %success.Should().BeTrue() + %this.context.Errors.Count.Should().Be(0) - let myTask = ParseChangeLogs(ChangelogFile = Workspace.fixtures.``CHANGELOG.md``) - myTask.BuildEngine <- context.BuildEngine.Object + [] + member this.``task fails when changelog file is invalid`` () = + let myTask = + ParseChangeLogs(ChangelogFile = Workspace.changelogs.``CHANGELOG_invalid.md``) - let success = myTask.Execute() + myTask.BuildEngine <- this.context.BuildEngine.Object - success.ShouldBeTrue() - context.Errors.Count.ShouldBe(0) + let success = myTask.Execute() -[] -let ``task fails when changelog file is invalid`` () = - let context = setupBuildEngine () + %success.Should().BeFalse() + %this.context.Errors.Count.Should().Be(1) + %this.context.Errors.[0].Code.Should().Be("IKC0002") - let myTask = - ParseChangeLogs(ChangelogFile = Workspace.fixtures.``CHANGELOG_invalid.md``) - myTask.BuildEngine <- context.BuildEngine.Object + [] + member this.``task correctly parses details from changelog file`` () = + let myTask = + ParseChangeLogs(ChangelogFile = Workspace.changelogs.``CHANGELOG_detailed.md``) - let success = myTask.Execute() + myTask.BuildEngine <- this.context.BuildEngine.Object - success.ShouldBeFalse() - context.Errors.Count.ShouldBe(1) - context.Errors.[0].Code.ShouldBe("IKC0002") + let success = myTask.Execute() + %success.Should().BeTrue "Should have successfully parsed the changelog data" + %myTask.AllReleasedChangelogs.Length.Should().Be(9, "Should have 9 versions") + %myTask.CurrentReleaseChangelog.ItemSpec.Should().Be("0.1.8", "Should have the most recent version") + %myTask.CurrentReleaseChangelog.GetMetadata("Date").Should().Be("2022-03-31", "Should have the most recent version's date") + %(myTask.CurrentReleaseChangelog.MetadataNames |> Seq.cast |> _.Should().Contain("Changed", "Should have changed metadata")) + %(myTask.CurrentReleaseChangelog.MetadataNames |> Seq.cast |> _.Should().Contain("Date", "Should have date metadata")) + [] + member this.``task produces expected markdown`` () = + let myTask = + ParseChangeLogs(ChangelogFile = Workspace.changelogs.``CHANGELOG.md``) -[] -let ``task correctly parses detailes from changelog file`` () = - let context = setupBuildEngine () - let myTask = - ParseChangeLogs(ChangelogFile = Workspace.fixtures.``CHANGELOG_detailed.md``) + myTask.BuildEngine <- this.context.BuildEngine.Object - myTask.BuildEngine <- context.BuildEngine.Object + let success = myTask.Execute() + %success.Should().BeTrue "Should have successfully parsed the changelog data" + %myTask.LatestReleaseNotes.Should().Be("""### Added - let success = myTask.Execute() - success.ShouldBeTrue "Should have successfully parsed the changelog data" - myTask.AllReleasedChangelogs.Length.ShouldBe(9, "Should have 9 versions") - myTask.CurrentReleaseChangelog.ItemSpec.ShouldBe("0.1.8", "Should have the most recent version") - myTask.CurrentReleaseChangelog.GetMetadata("Date").ShouldBe("2022-03-31", "Should have the most recent version's date") - myTask.CurrentReleaseChangelog.MetadataNames |> Seq.cast |> _.ShouldContain("Changed", "Should have changed metadata") - myTask.CurrentReleaseChangelog.MetadataNames |> Seq.cast |> _.ShouldContain("Date", "Should have date metadata") +- Created the package + +### Changed + +- Changed something in the package +- Updated the target framework""") diff --git a/tests/Workspace.fs b/tests/Workspace.fs index 111d882..af668b6 100644 --- a/tests/Workspace.fs +++ b/tests/Workspace.fs @@ -3,3 +3,12 @@ module Workspace open EasyBuild.FileSystemProvider type Workspace = RelativeFileSystem<"."> + +type VirtualWorkspace = + VirtualFileSystem< + ".", + """ +test-nupkgs/ +test-package-cache/ +""" + > diff --git a/tests/changelogs/CHANGELOG.md b/tests/changelogs/CHANGELOG.md new file mode 100644 index 0000000..9d447ad --- /dev/null +++ b/tests/changelogs/CHANGELOG.md @@ -0,0 +1,19 @@ +# Changelog + +## [Unreleased] + +### Removed + +- A test removal line +- And another removal + +## [0.1.0] - 2022-01-13 + +### Added + +- Created the package + +### Changed + +- Changed something in the package +- Updated the target framework diff --git a/tests/fixtures/CHANGELOG_detailed.md b/tests/changelogs/CHANGELOG_detailed.md similarity index 100% rename from tests/fixtures/CHANGELOG_detailed.md rename to tests/changelogs/CHANGELOG_detailed.md diff --git a/tests/fixtures/CHANGELOG_invalid.md b/tests/changelogs/CHANGELOG_invalid.md similarity index 100% rename from tests/fixtures/CHANGELOG_invalid.md rename to tests/changelogs/CHANGELOG_invalid.md diff --git a/tests/fixtures/CHANGELOG.md b/tests/fixtures/CHANGELOG.md index 417eb98..9d447ad 100644 --- a/tests/fixtures/CHANGELOG.md +++ b/tests/fixtures/CHANGELOG.md @@ -2,8 +2,18 @@ ## [Unreleased] +### Removed + +- A test removal line +- And another removal + ## [0.1.0] - 2022-01-13 ### Added - Created the package + +### Changed + +- Changed something in the package +- Updated the target framework diff --git a/tests/fixtures/CHANGELOG_KeepAChangelog.md b/tests/fixtures/CHANGELOG_KeepAChangelog.md new file mode 100644 index 0000000..5c2288c --- /dev/null +++ b/tests/fixtures/CHANGELOG_KeepAChangelog.md @@ -0,0 +1,14 @@ +# Changelog + +## [Unreleased] + +## [0.1.0] - 2022-01-13 + +### Added + +- Created the package +- Added a second line + +### Changed + +- Updated the package diff --git a/tests/fixtures/Directory.Build.props b/tests/fixtures/Directory.Build.props index 51207d2..324349b 100644 --- a/tests/fixtures/Directory.Build.props +++ b/tests/fixtures/Directory.Build.props @@ -1,3 +1,6 @@ - + + false + + \ No newline at end of file diff --git a/tests/fixtures/Directory.Packages.props b/tests/fixtures/Directory.Packages.props new file mode 100644 index 0000000..4862603 --- /dev/null +++ b/tests/fixtures/Directory.Packages.props @@ -0,0 +1,3 @@ + + + diff --git a/tests/fixtures/FailIfChangelogDoesNotExist.fsproj b/tests/fixtures/FailIfChangelogDoesNotExist.fsproj new file mode 100644 index 0000000..dd1973a --- /dev/null +++ b/tests/fixtures/FailIfChangelogDoesNotExist.fsproj @@ -0,0 +1,20 @@ + + + + + net6.0 + + + + $(MSBuildThisFileDirectory)CHANGELOG_NotHere.md + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + diff --git a/tests/fixtures/FailIfChangelogNotSpecified.fsproj b/tests/fixtures/FailIfChangelogNotSpecified.fsproj new file mode 100644 index 0000000..b9a3b85 --- /dev/null +++ b/tests/fixtures/FailIfChangelogNotSpecified.fsproj @@ -0,0 +1,16 @@ + + + + + net6.0 + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + diff --git a/tests/fixtures/NuGet.config b/tests/fixtures/NuGet.config new file mode 100644 index 0000000..f7113cd --- /dev/null +++ b/tests/fixtures/NuGet.config @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/tests/fixtures/WorksForAbsolutePathWithKeepAChangelog.fsproj b/tests/fixtures/WorksForAbsolutePathWithKeepAChangelog.fsproj new file mode 100644 index 0000000..41ff699 --- /dev/null +++ b/tests/fixtures/WorksForAbsolutePathWithKeepAChangelog.fsproj @@ -0,0 +1,20 @@ + + + + + net6.0 + + + + $(MSBuildThisFileDirectory)CHANGELOG_KeepAChangelog.md + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + diff --git a/tests/fixtures/WorksForRelativePathWithKeepAChangelog.fsproj b/tests/fixtures/WorksForRelativePathWithKeepAChangelog.fsproj new file mode 100644 index 0000000..7e033d0 --- /dev/null +++ b/tests/fixtures/WorksForRelativePathWithKeepAChangelog.fsproj @@ -0,0 +1,20 @@ + + + + + net6.0 + + + + CHANGELOG_KeepAChangelog.md + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + diff --git a/tests/fixtures/valid/Simple.fsproj b/tests/fixtures/valid/Simple.fsproj deleted file mode 100644 index 7d620c7..0000000 --- a/tests/fixtures/valid/Simple.fsproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - - - - - diff --git a/tests/fixtures/valid/packages.lock.json b/tests/fixtures/valid/packages.lock.json deleted file mode 100644 index e3c801d..0000000 --- a/tests/fixtures/valid/packages.lock.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": 2, - "dependencies": { - "net6.0": { - "Ionide.KeepAChangelog.Tasks": { - "type": "Direct", - "requested": "[1.0.0-test-002, )", - "resolved": "1.0.0-test-002", - "contentHash": "FOf+ufy7DdFURwhkS/d2c51C0CGtBk5zikGnyfoSf+tWvukJeD3xl2I5cXKeX8F1l/bzz8GA1y0FoGT+6pNMAg==" - } - } - } -} \ No newline at end of file diff --git a/tests/packages.lock.json b/tests/packages.lock.json index 6e34b1a..0dcf2b7 100644 --- a/tests/packages.lock.json +++ b/tests/packages.lock.json @@ -2,6 +2,15 @@ "version": 2, "dependencies": { "net8.0": { + "BlackFox.CommandLine": { + "type": "Direct", + "requested": "[1.0.0, )", + "resolved": "1.0.0", + "contentHash": "dSW7uLetl021HQXKcZd1xrXPjhsXgaJ5U4tFe64DLja1KZ2Ce6QeugHvZDvLfcPkEc1ZPRF7fWv5/T+X3ThWTA==", + "dependencies": { + "FSharp.Core": "4.2.3" + } + }, "DotNet.ReproducibleBuilds": { "type": "Direct", "requested": "[1.2.25, )", @@ -14,15 +23,16 @@ "resolved": "0.3.0", "contentHash": "gdVJpqcMDJm4IfmITy3MtpEn/lo9pH8PirVlENtXGX9Sdw3rCgoo9ch1TAthUseh28RcUGWwza9BmEWlrQX/Aw==" }, - "Fixie.TestAdapter": { + "Faqt": { "type": "Direct", - "requested": "[3.4.0, )", - "resolved": "3.4.0", - "contentHash": "KQBF/t82Ax/09CuF4GuYOCshfA72YGvMh3t8EGLeqsCLdZmWhR6Lz0IIsbDkS9DrECK7l03WTufHe0D7Mq6WBw==", + "requested": "[4.2.1, )", + "resolved": "4.2.1", + "contentHash": "kB0fWnhJO+rMwrgdBWanb0dipU9dvUa3agglUeP0dDr1LRr952HkaA7vgrJPVFmp5/XmgD0JMbyg028AFesG4A==", "dependencies": { - "Fixie": "[3.4.0]", - "Microsoft.NET.Test.Sdk": "17.8.0", - "Mono.Cecil": "0.11.5" + "FSharp.Core": "5.0.2", + "FSharp.SystemTextJson": "1.3.13", + "FracturedJson": "4.0.3", + "YamlDotNet": "16.1.3" } }, "FSharp.Core": { @@ -54,6 +64,16 @@ "System.Configuration.ConfigurationManager": "7.0.0" } }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.11.1, )", + "resolved": "17.11.1", + "contentHash": "U3Ty4BaGoEu+T2bwSko9tWqWUOU16WzSFkq6U8zve75oRBMSLTBdMAZrVNNz1Tq12aCdDom9fcOcM9QZaFHqFg==", + "dependencies": { + "Microsoft.CodeCoverage": "17.11.1", + "Microsoft.TestPlatform.TestHost": "17.11.1" + } + }, "Moq": { "type": "Direct", "requested": "[4.20.72, )", @@ -63,22 +83,28 @@ "Castle.Core": "5.1.1" } }, + "MSTest.TestAdapter": { + "type": "Direct", + "requested": "[3.6.1, )", + "resolved": "3.6.1", + "contentHash": "wgeZ8g4N75iksyrESdIGV46AxYqLvy1cRwyXCWfpA77huSPWCx89QsgZe3tg9k+OYx71v46aRVFZKT6gqCrarw==", + "dependencies": { + "Microsoft.Testing.Extensions.VSTestBridge": "1.4.1", + "Microsoft.Testing.Platform.MSBuild": "1.4.1" + } + }, + "MSTest.TestFramework": { + "type": "Direct", + "requested": "[3.6.1, )", + "resolved": "3.6.1", + "contentHash": "ugHS5Bz+hlLBd7FSS9JokRrzjmlmDQIx0Hxj6LTJztH/CRkuzNM+hK9Zoa53DR/B4BysEpu16ZXnm6KLH6Vrzg==" + }, "Semver": { "type": "Direct", "requested": "[2.3.0, )", "resolved": "2.3.0", "contentHash": "4vYo1zqn6pJ1YrhjuhuOSbIIm0CpM47grbpTJ5ABjOlfGt/EhMEM9ed4MRK5Jr6gVnntWDqOUzGeUJp68PZGjw==" }, - "Shouldly": { - "type": "Direct", - "requested": "[4.2.1, )", - "resolved": "4.2.1", - "contentHash": "dKAKiSuhLKqD2TXwLKtqNg1nwzJcIKOOMncZjk9LYe4W+h+SCftpWdxwR79YZUIHMH+3Vu9s0s0UHNrgICLwRQ==", - "dependencies": { - "DiffEngine": "11.3.0", - "EmptyFiles": "4.4.0" - } - }, "SimpleExec": { "type": "Direct", "requested": "[12.0.0, )", @@ -98,24 +124,30 @@ "resolved": "2.42.5", "contentHash": "Do9Q7Nyfx2G4HRt96aB6yoP5Z9ic3jqBHLrf35tULzsWlFoBlkQZT62aXCiv7UmVmF56OUR+a3JoSSs140hfHQ==" }, - "DiffEngine": { + "FracturedJson": { "type": "Transitive", - "resolved": "11.3.0", - "contentHash": "k0ZgZqd09jLZQjR8FyQbSQE86Q7QZnjEzq1LPHtj1R2AoWO8sjV5x+jlSisL7NZAbUOI4y+7Bog8gkr9WIRBGw==", + "resolved": "4.0.3", + "contentHash": "pemUqqLxxpcw8aWUmc+8j40CKMeVvne6M/44pRnRan5s2G/8VET41U0a4Fc9YAQrd0QwaTwdj/51RmUtzZwPzw==", "dependencies": { - "EmptyFiles": "4.4.0", - "System.Management": "6.0.1" + "System.Text.Json": "6.0.10" } }, - "EmptyFiles": { + "FSharp.SystemTextJson": { "type": "Transitive", - "resolved": "4.4.0", - "contentHash": "gwJEfIGS7FhykvtZoscwXj/XwW+mJY6UbAZk+qtLKFUGWC95kfKXnj8VkxsZQnWBxJemM/q664rGLN5nf+OHZw==" + "resolved": "1.3.13", + "contentHash": "znp8odpdkVGKVX0AvbhiXdmeMi0KJ+A4AyAQWSkfAEAe4Z4clRE+rVhrLnAGrFD1VEIUX2lsQ4o84ywpWZUSGw==", + "dependencies": { + "FSharp.Core": "4.7.0", + "System.Text.Json": "6.0.0" + } }, - "Fixie": { + "Microsoft.ApplicationInsights": { "type": "Transitive", - "resolved": "3.4.0", - "contentHash": "Rn+KhQIobYpMC8+S3Fk48wgpo8zljYsgT+M84q5csNJM5AzyVebcIIPAv5DXb+lJuKaOCG3ntpTdTEUPOJAHOA==" + "resolved": "2.22.0", + "contentHash": "3AOM9bZtku7RQwHyMEY3tQMrHIgjcfRDa6YQpd/QG2LDGvMydSlL9Di+8LLMt7J2RDdfJ7/2jdYv6yHcMJAnNw==", + "dependencies": { + "System.Diagnostics.DiagnosticSource": "5.0.0" + } }, "Microsoft.Build.Framework": { "type": "Transitive", @@ -124,38 +156,70 @@ }, "Microsoft.CodeCoverage": { "type": "Transitive", - "resolved": "17.8.0", - "contentHash": "KC8SXWbGIdoFVdlxKk9WHccm0llm9HypcHMLUUFabRiTS3SO2fQXNZfdiF3qkEdTJhbRrxhdRxjL4jbtwPq4Ew==" + "resolved": "17.11.1", + "contentHash": "nPJqrcA5iX+Y0kqoT3a+pD/8lrW/V7ayqnEJQsTonSoPz59J8bmoQhcSN4G8+UJ64Hkuf0zuxnfuj2lkHOq4cA==" }, "Microsoft.NET.StringTools": { "type": "Transitive", "resolved": "17.8.3", "contentHash": "y6DiuacjlIfXH3XVQG5htf+4oheinZAo7sHbITB3z7yCXQec48f9ZhGSXkr+xn1bfl73Yc3ZQEW2peJ5X68AvQ==" }, - "Microsoft.NET.Test.Sdk": { + "Microsoft.Testing.Extensions.Telemetry": { + "type": "Transitive", + "resolved": "1.4.1", + "contentHash": "Li2CRKPN8LExJRakkaUV9Xq/VeezAkTG1Vp+bcuonES6VoCIKufnc9f5GwxYX5I9DIWWxwgR0UeowlkpOIKxiA==", + "dependencies": { + "Microsoft.ApplicationInsights": "2.22.0", + "Microsoft.Testing.Platform": "1.4.1" + } + }, + "Microsoft.Testing.Extensions.TrxReport.Abstractions": { "type": "Transitive", - "resolved": "17.8.0", - "contentHash": "BmTYGbD/YuDHmApIENdoyN1jCk0Rj1fJB0+B/fVekyTdVidr91IlzhqzytiUgaEAzL1ZJcYCme0MeBMYvJVzvw==", + "resolved": "1.4.1", + "contentHash": "FJRIgh2cWPQmAmfWDkdROW94LjFCaRrcnBa6uX2xkcXL3SXqJN43RfbP5xMDCE7FyXXHBFBLyfKhIZ1L2lh9FA==", "dependencies": { - "Microsoft.CodeCoverage": "17.8.0", - "Microsoft.TestPlatform.TestHost": "17.8.0" + "Microsoft.Testing.Platform": "1.4.1" + } + }, + "Microsoft.Testing.Extensions.VSTestBridge": { + "type": "Transitive", + "resolved": "1.4.1", + "contentHash": "57U75DJEpN+JMJUfyEef57KlXfwtNMHuFd2j5+7VIiwli4oDCwGCZfSNLY/mQ1NcVPTdsLvW2awwMLdxiV7Ysg==", + "dependencies": { + "Microsoft.ApplicationInsights": "2.22.0", + "Microsoft.TestPlatform.ObjectModel": "17.11.1", + "Microsoft.Testing.Extensions.Telemetry": "1.4.1", + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.4.1", + "Microsoft.Testing.Platform": "1.4.1" + } + }, + "Microsoft.Testing.Platform": { + "type": "Transitive", + "resolved": "1.4.1", + "contentHash": "LT+DsDCtQL0x8tuClGk5mkBfeSdBuCgMX7UCE44H0JoayvOHhnbKCT5DElo2XNPclCbgm1PsPvePNPYQxV+X9w==" + }, + "Microsoft.Testing.Platform.MSBuild": { + "type": "Transitive", + "resolved": "1.4.1", + "contentHash": "2Vct6WOIUxJJy64srxB2uhZCe6ZxPVlA43VNdJJjvO8oSyy+vLCW4Vv37LNLnnj+XFq3QVo0KOOaVAtLgbnGGg==", + "dependencies": { + "Microsoft.Testing.Platform": "1.4.1" } }, "Microsoft.TestPlatform.ObjectModel": { "type": "Transitive", - "resolved": "17.8.0", - "contentHash": "AYy6vlpGMfz5kOFq99L93RGbqftW/8eQTqjT9iGXW6s9MRP3UdtY8idJ8rJcjeSja8A18IhIro5YnH3uv1nz4g==", + "resolved": "17.11.1", + "contentHash": "E2jZqAU6JeWEVsyOEOrSW1o1bpHLgb25ypvKNB/moBXPVsFYBPd/Jwi7OrYahG50J83LfHzezYI+GaEkpAotiA==", "dependencies": { - "NuGet.Frameworks": "6.5.0", "System.Reflection.Metadata": "1.6.0" } }, "Microsoft.TestPlatform.TestHost": { "type": "Transitive", - "resolved": "17.8.0", - "contentHash": "9ivcl/7SGRmOT0YYrHQGohWiT5YCpkmy/UEzldfVisLm6QxbLaK3FAJqZXI34rnRLmqqDCeMQxKINwmKwAPiDw==", + "resolved": "17.11.1", + "contentHash": "DnG+GOqJXO/CkoqlJWeDFTgPhqD/V6VqUIL3vINizCWZ3X+HshCtbbyDdSHQQEjrc2Sl/K3yaxX6s+5LFEdYuw==", "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.8.0", + "Microsoft.TestPlatform.ObjectModel": "17.11.1", "Newtonsoft.Json": "13.0.1" } }, @@ -169,31 +233,16 @@ "resolved": "7.0.0", "contentHash": "2nXPrhdAyAzir0gLl8Yy8S5Mnm/uBSQQA7jEsILOS1MTyS7DbmV1NgViMtvV1sfCD1ebITpNwb1NIinKeJgUVQ==" }, - "Mono.Cecil": { - "type": "Transitive", - "resolved": "0.11.5", - "contentHash": "fxfX+0JGTZ8YQeu1MYjbBiK2CYTSzDyEeIixt+yqKKTn7FW8rv7JMY70qevup4ZJfD7Kk/VG/jDzQQTpfch87g==" - }, "Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.1", "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" }, - "NuGet.Frameworks": { - "type": "Transitive", - "resolved": "6.5.0", - "contentHash": "QWINE2x3MbTODsWT1Gh71GaGb5icBz4chS8VYvTgsBnsi8esgN6wtHhydd7fvToWECYGq7T4cgBBDiKD/363fg==" - }, "Roslynator.Analyzers": { "type": "Transitive", "resolved": "4.12.4", "contentHash": "isl8hAh7yFNjyBEC4YlTSi+xGBblqBUC/2MCMmnBPwuXPewb7XYnMRzT3vXbP/gOGwT8hZUOy1g/aRH3lAF/NQ==" }, - "System.CodeDom": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "CPc6tWO1LAer3IzfZufDBRL+UZQcj5uS207NHALQzP84Vp/z6wF0Aa0YZImOQY8iStY0A2zI/e3ihKNPfUm8XA==" - }, "System.Collections.Immutable": { "type": "Transitive", "resolved": "7.0.0", @@ -209,6 +258,11 @@ "System.Security.Permissions": "7.0.0" } }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==" + }, "System.Diagnostics.EventLog": { "type": "Transitive", "resolved": "7.0.0", @@ -222,19 +276,16 @@ "Microsoft.Win32.SystemEvents": "7.0.0" } }, - "System.Management": { - "type": "Transitive", - "resolved": "6.0.1", - "contentHash": "10J1D0h/lioojphfJ4Fuh5ZUThT/xOVHdV9roGBittKKNP2PMjrvibEdbVTGZcPra1399Ja3tqIJLyQrc5Wmhg==", - "dependencies": { - "System.CodeDom": "6.0.0" - } - }, "System.Reflection.Metadata": { "type": "Transitive", "resolved": "1.6.0", "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, "System.Security.Cryptography.ProtectedData": { "type": "Transitive", "resolved": "7.0.0", @@ -248,6 +299,23 @@ "System.Windows.Extensions": "7.0.0" } }, + "System.Text.Encodings.Web": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Text.Json": { + "type": "Transitive", + "resolved": "6.0.10", + "contentHash": "NSB0kDipxn2ychp88NXWfFRFlmi1bst/xynOutbnpEfRCT9JZkZ7KOmF/I/hNKo2dILiMGnqblm+j1sggdLB9g==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "6.0.0" + } + }, "System.Windows.Extensions": { "type": "Transitive", "resolved": "7.0.0", @@ -256,6 +324,11 @@ "System.Drawing.Common": "7.0.0" } }, + "YamlDotNet": { + "type": "Transitive", + "resolved": "16.1.3", + "contentHash": "gtHGiDvU9VTtWte8f0thIM38cL1oowOjStKpeAEKKfA+Rc4AvekJzqFDZiiPcc4kw00ZiwR4OTJS56L16q98DQ==" + }, "ionide.keepachangelog.tasks": { "type": "Project" }