Skip to content

Failing test case for feature branch name with a number #327

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions GitVersionCore.Tests/GitVersionCore.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<Compile Include="GitDirFinderTests.cs" />
<Compile Include="Fixtures\BaseGitFlowRepositoryFixture.cs" />
<Compile Include="IntegrationTests\GitFlow\DevelopScenarios.cs" />
<Compile Include="IntegrationTests\GitFlow\FeatureBranchTests.cs" />
<Compile Include="IntegrationTests\GitFlow\SupportBranchScenarios.cs" />
<Compile Include="IntegrationTests\GitFlow\MetaDataByCommitScenarios.cs" />
<Compile Include="IntegrationTests\GitFlow\PatchScenarios.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -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");
}
}
}