Skip to content

Commit

Permalink
Consider pre-release tags only when they matching with the label name…
Browse files Browse the repository at this point in the history
… on branch
  • Loading branch information
HHobeck committed Mar 15, 2023
1 parent 0d83d66 commit 0cc0f4c
Show file tree
Hide file tree
Showing 23 changed files with 976 additions and 168 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public void WhenDevelopHasMultipleCommitsSpecifyNonExistingCommitId()
public void WhenDevelopBranchedFromTaggedCommitOnMainVersionDoesNotChange()
{
using var fixture = new EmptyRepositoryFixture();
fixture.Repository.MakeATaggedCommit("1.0.0");
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
fixture.MakeATaggedCommit("1.0.0");
fixture.BranchTo("develop");
fixture.AssertFullSemver("1.0.0");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void GitFlowMinorRelease()

// Make a commit after a tag should bump up the beta
fixture.MakeACommit();
fixture.AssertFullSemver("1.3.0-beta.2+2");
fixture.AssertFullSemver("1.3.0-beta.2+1");

// Complete release
fixture.Checkout(MainBranch);
Expand Down Expand Up @@ -191,7 +191,7 @@ public void GitFlowMajorRelease()

// Make a commit after a tag should bump up the beta
fixture.MakeACommit();
fixture.AssertFullSemver("2.0.0-beta.2+2");
fixture.AssertFullSemver("2.0.0-beta.2+1");

// Complete release
fixture.Checkout(MainBranch);
Expand Down Expand Up @@ -380,11 +380,11 @@ public void GitHubFlowMajorRelease()

// test that the CommitsSinceVersionSource should still return commit count
var version = fixture.GetVersion();
version.CommitsSinceVersionSource.ShouldBe("2");
version.CommitsSinceVersionSource.ShouldBe("0");

// Make a commit after a tag should bump up the beta
fixture.MakeACommit();
fixture.AssertFullSemver("2.0.0-beta.2+3");
fixture.AssertFullSemver("2.0.0-beta.2+1");

// Complete release
fixture.Checkout(MainBranch);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void PatchLatestReleaseExample()
fixture.Repository.ApplyTag("1.2.1-beta.1");
fixture.AssertFullSemver("1.2.1-beta.1");
fixture.Repository.MakeACommit();
fixture.AssertFullSemver("1.2.1-beta.2+3");
fixture.AssertFullSemver("1.2.1-beta.2+1");

// Merge hotfix branch to main
Commands.Checkout(fixture.Repository, MainBranch);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public void PreventDecrementationOfVersionsOnTheDevelopmentBranch()
fixture.MergeNoFF("develop");

// ✅ succeeds as expected
fixture.AssertFullSemver("1.0.0-beta.2+2", configurationBuilder.Build());
fixture.AssertFullSemver("1.0.0-beta.2+3", configurationBuilder.Build());

fixture.Checkout("develop");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public void ShouldNotGetVersionFromFeatureBranchIfNotMerged()
fixture.MakeATaggedCommit("1.0.1-feature.1");
fixture.Checkout(MainBranch);
fixture.BranchTo("develop");
fixture.Repository.MakeACommit();
fixture.MakeACommit();

fixture.AssertFullSemver("1.0.0-alpha.1", configuration);
fixture.AssertFullSemver("1.0.0-alpha.2", configuration);

fixture.Repository.DumpGraph();
}
Expand Down
Loading

0 comments on commit 0cc0f4c

Please sign in to comment.