From 39a0e1d670e17996021cc87f2366eb86e6d3f1e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96rjan=20Sj=C3=B6holm?= Date: Thu, 18 Dec 2014 22:09:24 +0100 Subject: [PATCH] Failing test case for feature branch name with a number This is just a test to reproduce my issue with feature branches based on the jira key e.g. feature/JIRA-123-a-description. --- .../GitVersionCore.Tests.csproj | 1 + .../GitFlow/FeatureBranchTests.cs | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 GitVersionCore.Tests/IntegrationTests/GitFlow/FeatureBranchTests.cs diff --git a/GitVersionCore.Tests/GitVersionCore.Tests.csproj b/GitVersionCore.Tests/GitVersionCore.Tests.csproj index 3ac0dd7621..364b1aa318 100644 --- a/GitVersionCore.Tests/GitVersionCore.Tests.csproj +++ b/GitVersionCore.Tests/GitVersionCore.Tests.csproj @@ -74,6 +74,7 @@ + diff --git a/GitVersionCore.Tests/IntegrationTests/GitFlow/FeatureBranchTests.cs b/GitVersionCore.Tests/IntegrationTests/GitFlow/FeatureBranchTests.cs new file mode 100644 index 0000000000..4cfe622ae9 --- /dev/null +++ b/GitVersionCore.Tests/IntegrationTests/GitFlow/FeatureBranchTests.cs @@ -0,0 +1,32 @@ +using GitVersion; +using LibGit2Sharp; +using NUnit.Framework; + +[TestFixture] +public class FeatureBranchTests +{ + [Test] + public void ShouldNotUseNumberInFeatureBranchAsPreReleaseNumber() + { + using (var fixture = new EmptyRepositoryFixture(new Config())) + { + fixture.Repository.MakeATaggedCommit("1.0.0"); + fixture.Repository.CreateBranch("develop"); + fixture.Repository.Checkout("develop"); + fixture.Repository.CreateBranch("feature/JIRA-123"); + fixture.Repository.Checkout("feature/JIRA-123"); + fixture.Repository.MakeCommits(5); + + // Current output 1.1.0-JIRA-.123+5 + + // A valid assert from my point of view + fixture.AssertFullSemver("1.1.0-JIRA-123.5"); + + // Or possible, but I'll guess it depends on wheter we're using a CD och CI flow? + // fixture.AssertFullSemver("1.1.0-JIRA-123+5"); + + // Or depending on how we treat the build number meta data + // fixture.AssertFullSemver("1.1.0-JIRA-123.5+5"); + } + } +} \ No newline at end of file