diff --git a/build.cake b/build.cake index 910d565713..11a0e67171 100644 --- a/build.cake +++ b/build.cake @@ -66,40 +66,47 @@ Setup(context => Teardown((context, parameters) => { - Information("Starting Teardown..."); + try + { + Information("Starting Teardown..."); - Information("Repository info : IsMainRepo {0}, IsMainBranch {1}, IsTagged: {2}, IsPullRequest: {3}", - parameters.IsMainRepo, - parameters.IsMainBranch, - parameters.IsTagged, - parameters.IsPullRequest); + Information("Repository info : IsMainRepo {0}, IsMainBranch {1}, IsTagged: {2}, IsPullRequest: {3}", + parameters.IsMainRepo, + parameters.IsMainBranch, + parameters.IsTagged, + parameters.IsPullRequest); - if(context.Successful) + if(context.Successful) + { + // if(parameters.ShouldPublish) + // { + // if(parameters.CanPostToGitter) + // { + // var message = "@/all Version " + parameters.Version.SemVersion + " of the GitVersion has just been released, https://www.nuget.org/packages/GitVersion."; + + // var postMessageResult = Gitter.Chat.PostMessage( + // message: message, + // messageSettings: new GitterChatMessageSettings { Token = parameters.Gitter.Token, RoomId = parameters.Gitter.RoomId} + // ); + + // if (postMessageResult.Ok) + // { + // Information("Message {0} succcessfully sent", postMessageResult.TimeStamp); + // } + // else + // { + // Error("Failed to send message: {0}", postMessageResult.Error); + // } + // } + // } + } + + Information("Finished running tasks."); + } + catch (Exception exception) { - // if(parameters.ShouldPublish) - // { - // if(parameters.CanPostToGitter) - // { - // var message = "@/all Version " + parameters.Version.SemVersion + " of the GitVersion has just been released, https://www.nuget.org/packages/GitVersion."; - - // var postMessageResult = Gitter.Chat.PostMessage( - // message: message, - // messageSettings: new GitterChatMessageSettings { Token = parameters.Gitter.Token, RoomId = parameters.Gitter.RoomId} - // ); - - // if (postMessageResult.Ok) - // { - // Information("Message {0} succcessfully sent", postMessageResult.TimeStamp); - // } - // else - // { - // Error("Failed to send message: {0}", postMessageResult.Error); - // } - // } - // } - } - - Information("Finished running tasks."); + Error(exception.Dump()); + } }); ////////////////////////////////////////////////////////////////////// diff --git a/src/GitVersionCore.Tests/AssemblyInfoFileUpdaterTests.cs b/src/GitVersionCore.Tests/AssemblyInfoFileUpdaterTests.cs index 6a64b01123..14b65df11a 100644 --- a/src/GitVersionCore.Tests/AssemblyInfoFileUpdaterTests.cs +++ b/src/GitVersionCore.Tests/AssemblyInfoFileUpdaterTests.cs @@ -9,7 +9,8 @@ using Shouldly; [TestFixture] -public class AssemblyInfoFileUpdaterTests : TestBase +[Parallelizable(ParallelScope.None)] +public class AssemblyInfoFileUpdaterTests { [SetUp] public void Setup() diff --git a/src/GitVersionCore.Tests/AssemblyParallelizable.cs b/src/GitVersionCore.Tests/AssemblyParallelizable.cs new file mode 100644 index 0000000000..9f6f4f451f --- /dev/null +++ b/src/GitVersionCore.Tests/AssemblyParallelizable.cs @@ -0,0 +1,3 @@ +using NUnit.Framework; + +[assembly: Parallelizable(ParallelScope.Fixtures)] \ No newline at end of file diff --git a/src/GitVersionCore.Tests/ExecuteCoreTests.cs b/src/GitVersionCore.Tests/ExecuteCoreTests.cs index 8dec68ef86..376d00776f 100644 --- a/src/GitVersionCore.Tests/ExecuteCoreTests.cs +++ b/src/GitVersionCore.Tests/ExecuteCoreTests.cs @@ -9,6 +9,7 @@ using System.Text; [TestFixture] +[Parallelizable(ParallelScope.None)] public class ExecuteCoreTests : TestBase { IFileSystem fileSystem; diff --git a/src/GitVersionCore.Tests/GitVersionInformationGeneratorTests.cs b/src/GitVersionCore.Tests/GitVersionInformationGeneratorTests.cs index a534e0b0c6..90a592932b 100644 --- a/src/GitVersionCore.Tests/GitVersionInformationGeneratorTests.cs +++ b/src/GitVersionCore.Tests/GitVersionInformationGeneratorTests.cs @@ -7,7 +7,8 @@ namespace GitVersionCore.Tests { [TestFixture] - public class GitVersionInformationGeneratorTests : TestBase + [Parallelizable(ParallelScope.None)] + public class GitVersionInformationGeneratorTests { [SetUp] public void Setup() diff --git a/src/GitVersionCore/Logger.cs b/src/GitVersionCore/Logger.cs index 3b4a99843e..89cd78cae1 100644 --- a/src/GitVersionCore/Logger.cs +++ b/src/GitVersionCore/Logger.cs @@ -26,7 +26,8 @@ public static IDisposable IndentLog(string operationDescription) indent = indent + " "; return new ActionDisposable(() => { - indent = indent.Substring(0, indent.Length - 2); + var length = indent.Length - 2; + indent = length > 0 ? indent.Substring(0, length) : indent; WriteInfo(string.Format(CultureInfo.InvariantCulture, "End: {0} (Took: {1:N}ms)", operationDescription, DateTime.Now.Subtract(start).TotalMilliseconds)); }); } diff --git a/src/GitVersionExe.Tests/AssemblyParallelizable.cs b/src/GitVersionExe.Tests/AssemblyParallelizable.cs new file mode 100644 index 0000000000..9f6f4f451f --- /dev/null +++ b/src/GitVersionExe.Tests/AssemblyParallelizable.cs @@ -0,0 +1,3 @@ +using NUnit.Framework; + +[assembly: Parallelizable(ParallelScope.Fixtures)] \ No newline at end of file diff --git a/src/GitVersionExe.Tests/ExecCmdLineArgumentTest.cs b/src/GitVersionExe.Tests/ExecCmdLineArgumentTest.cs index 28f2f33fc7..8632329336 100644 --- a/src/GitVersionExe.Tests/ExecCmdLineArgumentTest.cs +++ b/src/GitVersionExe.Tests/ExecCmdLineArgumentTest.cs @@ -8,6 +8,7 @@ using Shouldly; [TestFixture] +[Parallelizable(ParallelScope.None)] public class ExecCmdLineArgumentTest { [Test] diff --git a/src/GitVersionTask.Tests/AssemblyParallelizable.cs b/src/GitVersionTask.Tests/AssemblyParallelizable.cs new file mode 100644 index 0000000000..9f6f4f451f --- /dev/null +++ b/src/GitVersionTask.Tests/AssemblyParallelizable.cs @@ -0,0 +1,3 @@ +using NUnit.Framework; + +[assembly: Parallelizable(ParallelScope.Fixtures)] \ No newline at end of file