public void MergeFeatureIntoMainlineWithMinorIncrement() { var config = new Config { VersioningMode = VersioningMode.Mainline, Branches = new Dictionary <string, BranchConfig>() { { "feature", new BranchConfig { Increment = IncrementStrategy.Minor } } }, Ignore = new IgnoreConfig() { ShAs = new List <string>() }, MergeMessageFormats = new Dictionary <string, string>() }; using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); fixture.ApplyTag("1.0.0"); fixture.AssertFullSemver("1.0.0", config); fixture.BranchTo("feature/foo"); fixture.MakeACommit(); fixture.AssertFullSemver("1.1.0-foo.1", config); fixture.ApplyTag("1.1.0-foo.1"); fixture.Checkout("master"); fixture.MergeNoFF("feature/foo"); fixture.AssertFullSemver("1.1.0", config); }
public void GitFlowHotfixBranch() { using (var fixture = new EmptyRepositoryFixture()) { fixture.SequenceDiagram.Participant("develop"); fixture.SequenceDiagram.Participant("master"); fixture.Repository.MakeACommit(); fixture.ApplyTag("1.2.0"); // Create hotfix branch fixture.Checkout("master"); fixture.BranchTo("hotfix/1.2.1", "hotfix"); fixture.SequenceDiagram.Activate("hotfix/1.2.1"); fixture.MakeACommit(); fixture.MakeACommit(); fixture.AssertFullSemver("1.2.1-beta.1+2"); // Apply beta.1 tag should be exact tag fixture.ApplyTag("1.2.1-beta.1"); fixture.AssertFullSemver("1.2.1-beta.1"); fixture.Checkout("master"); fixture.MergeNoFF("hotfix/1.2.1"); fixture.SequenceDiagram.Destroy("hotfix/1.2.1"); fixture.SequenceDiagram.NoteOver("Hotfix branches are deleted once merged", "hotfix/1.2.1"); fixture.ApplyTag("1.2.1"); } }
public void GitFlowMajorRelease() { using (var fixture = new EmptyRepositoryFixture()) { fixture.SequenceDiagram.Participant("master"); fixture.SequenceDiagram.Participant("develop"); fixture.Repository.MakeACommit(); fixture.ApplyTag("1.3.0"); // GitFlow setup fixture.BranchTo("develop"); fixture.MakeACommit(); // Create release branch fixture.BranchTo("release/2.0.0", "release"); fixture.SequenceDiagram.Activate("release/2.0.0"); fixture.AssertFullSemver("2.0.0-beta.1+0"); // Make another commit on develop fixture.Checkout("develop"); fixture.MakeACommit(); fixture.AssertFullSemver("2.1.0-alpha.1"); // Make a commit to release-2.0.0 fixture.Checkout("release/2.0.0"); fixture.MakeACommit(); fixture.AssertFullSemver("2.0.0-beta.1+1"); // Apply beta.1 tag should be exact tag fixture.ApplyTag("2.0.0-beta.1"); fixture.AssertFullSemver("2.0.0-beta.1"); // Make a commit after a tag should bump up the beta fixture.MakeACommit(); fixture.AssertFullSemver("2.0.0-beta.2+2"); // Complete release fixture.Checkout("master"); fixture.MergeNoFF("release/2.0.0"); fixture.Checkout("develop"); fixture.MergeNoFF("release/2.0.0"); fixture.SequenceDiagram.Destroy("release/2.0.0"); fixture.SequenceDiagram.NoteOver("Release branches are deleted once merged", "release/2.0.0"); fixture.Checkout("master"); fixture.AssertFullSemver("2.0.0+0"); fixture.ApplyTag("2.0.0"); fixture.AssertFullSemver("2.0.0"); // Not 0 for commit count as we can't know the increment rules of the merged branch fixture.Checkout("develop"); fixture.AssertFullSemver("2.1.0-alpha.4"); Console.WriteLine(fixture.SequenceDiagram.GetDiagram()); } }
public void GitFlowMinorRelease() { using (var fixture = new EmptyRepositoryFixture(new Config())) { fixture.Participant("master"); fixture.Participant("develop"); // GitFlow setup fixture.Repository.MakeACommit(); fixture.ApplyTag("1.2.1"); // GitFlow setup fixture.BranchTo("develop"); fixture.MakeACommit(); // Create release branch fixture.BranchTo("release/1.3.0", "release"); fixture.Activate("release/1.3.0"); fixture.AssertFullSemver("1.3.0-beta.1+0"); // Make another commit on develop fixture.Checkout("develop"); fixture.MakeACommit(); fixture.AssertFullSemver("1.3.0-unstable.2"); // Make a commit to release-1.3.0 fixture.Checkout("release/1.3.0"); fixture.MakeACommit(); fixture.AssertFullSemver("1.3.0-beta.1+1"); // Apply beta.1 tag should be exact tag fixture.ApplyTag("1.3.0-beta.1"); fixture.AssertFullSemver("1.3.0-beta.1"); // Make a commit after a tag should bump up the beta fixture.MakeACommit(); fixture.AssertFullSemver("1.3.0-beta.2+2"); // Complete release fixture.Checkout("master"); fixture.MergeNoFF("release/1.3.0"); fixture.Checkout("develop"); fixture.MergeNoFF("release/1.3.0"); fixture.Destroy("release/1.3.0"); fixture.NoteOver("Release branches are deleted once merged", "release/1.3.0"); fixture.Checkout("master"); fixture.ApplyTag("1.3.0"); fixture.AssertFullSemver("1.3.0"); // Not 0 for commit count as we can't know the increment rules of the merged branch fixture.Checkout("develop"); fixture.AssertFullSemver("1.4.0-unstable.2"); } }
public void GitFlowPullRequestBranch() { using (var fixture = new EmptyRepositoryFixture(new Config())) { fixture.Participant("master"); fixture.Participant("develop"); // GitFlow setup fixture.Repository.MakeACommit(); fixture.ApplyTag("1.2.0"); fixture.BranchTo("develop"); // Branch to develop fixture.MakeACommit(); fixture.AssertFullSemver("1.3.0-unstable.1"); // Open Pull Request fixture.BranchTo("pull/2/merge", "pr"); fixture.Activate("pull/2/merge"); fixture.AssertFullSemver("1.3.0-PullRequest.2+1"); fixture.MakeACommit(); fixture.AssertFullSemver("1.3.0-PullRequest.2+2"); // Merge into develop fixture.Checkout("develop"); fixture.MergeNoFF("pull/2/merge"); fixture.Destroy("pull/2/merge"); fixture.NoteOver("Feature branches/pr's should\r\n" + "be deleted once merged", "pull/2/merge"); fixture.AssertFullSemver("1.3.0-unstable.3"); } }
public void MergingFromDevelopToFeatureShouldNotCauseMinorPatchToChange() { var config = new Config { VersioningMode = VersioningMode.ContinuousDeployment }; using (var fixture = new EmptyRepositoryFixture()) { fixture.MakeACommit(); fixture.ApplyTag("1.1.0"); fixture.BranchTo("develop"); fixture.MakeACommit("commit in develop"); fixture.BranchTo("feature/featureA"); fixture.MakeACommit("commit in featureA"); fixture.MakeACommit("commit in featureA"); fixture.Checkout("develop"); fixture.MakeACommit("commit in develop"); fixture.MakeACommit("commit in develop"); fixture.Checkout("feature/featureA"); fixture.MergeNoFF("develop"); var expectedFullSemVer = "1.2.0-featureA.5"; fixture.AssertFullSemver(config, expectedFullSemVer); } }
public void GitFlowPullRequestBranch() { using (var fixture = new EmptyRepositoryFixture(new Config())) { fixture.Participant("master"); fixture.Participant("develop"); // GitFlow setup fixture.Repository.MakeACommit(); fixture.ApplyTag("1.2.0"); fixture.BranchTo("develop"); // Branch to develop fixture.MakeACommit(); fixture.AssertFullSemver("1.3.0-unstable.1"); // Open Pull Request fixture.BranchTo("pull/2/merge", "pr"); fixture.Activate("pull/2/merge"); fixture.AssertFullSemver("1.3.0-PullRequest.2+1"); fixture.MakeACommit(); fixture.AssertFullSemver("1.3.0-PullRequest.2+2"); // Merge into develop fixture.Checkout("develop"); fixture.MergeNoFF("pull/2/merge"); fixture.Destroy("pull/2/merge"); fixture.NoteOver("Feature branches/pr's should\r\n" + "be deleted once merged", "pull/2/merge"); fixture.AssertFullSemver("1.3.0-unstable.3"); } }
public void GitFlowFeatureBranch() { using (var fixture = new EmptyRepositoryFixture()) { fixture.SequenceDiagram.Participant("master"); fixture.SequenceDiagram.Participant("develop"); // GitFlow setup fixture.Repository.MakeACommit(); fixture.ApplyTag("1.2.0"); fixture.BranchTo("develop"); // Branch to develop fixture.MakeACommit(); fixture.AssertFullSemver("1.3.0-unstable.1"); // Open Pull Request fixture.BranchTo("feature/myfeature", "feature"); fixture.SequenceDiagram.Activate("feature/myfeature"); fixture.AssertFullSemver("1.3.0-myfeature.1+1"); fixture.MakeACommit(); fixture.AssertFullSemver("1.3.0-myfeature.1+2"); // Merge into develop fixture.Checkout("develop"); fixture.MergeNoFF("feature/myfeature"); fixture.SequenceDiagram.Destroy("feature/myfeature"); fixture.SequenceDiagram.NoteOver("Feature branches should\r\n" + "be deleted once merged", "feature/myfeature"); fixture.AssertFullSemver("1.3.0-unstable.3"); } }
public void GitHubFlowPullRequestBranch() { using var fixture = new EmptyRepositoryFixture(); fixture.SequenceDiagram.Participant(MainBranch); // GitFlow setup fixture.Repository.MakeACommit(); fixture.ApplyTag("1.2.0"); // Branch to develop fixture.MakeACommit(); fixture.AssertFullSemver("1.2.1+1"); // Open Pull Request fixture.BranchTo("pull/2/merge", "pr"); fixture.SequenceDiagram.Activate("pull/2/merge"); fixture.AssertFullSemver("1.2.1-PullRequest0002.1"); fixture.MakeACommit(); fixture.AssertFullSemver("1.2.1-PullRequest0002.2"); // Merge into main fixture.Checkout(MainBranch); fixture.MergeNoFF("pull/2/merge"); fixture.SequenceDiagram.Destroy("pull/2/merge"); fixture.SequenceDiagram.NoteOver("Feature branches/pr's should\r\n" + "be deleted once merged", "pull/2/merge"); fixture.AssertFullSemver("1.2.1+3"); }
public void GitFlowPullRequestBranch() { using (var fixture = new EmptyRepositoryFixture()) { fixture.SequenceDiagram.Participant("master"); fixture.SequenceDiagram.Participant("develop"); // GitFlow setup fixture.Repository.MakeACommit(); fixture.ApplyTag("1.2.0"); fixture.BranchTo("develop"); // Branch to develop fixture.MakeACommit(); fixture.AssertFullSemver("1.3.0-alpha.1"); // Open Pull Request fixture.BranchTo("pull/2/merge", "pr"); fixture.SequenceDiagram.Activate("pull/2/merge"); fixture.AssertFullSemver("1.3.0-PullRequest0002.1"); fixture.MakeACommit(); fixture.AssertFullSemver("1.3.0-PullRequest0002.2"); // Merge into develop fixture.Checkout("develop"); fixture.MergeNoFF("pull/2/merge"); fixture.SequenceDiagram.Destroy("pull/2/merge"); fixture.SequenceDiagram.NoteOver("Feature branches/pr's should\r\n" + "be deleted once merged", "pull/2/merge"); fixture.AssertFullSemver("1.3.0-alpha.3"); Console.WriteLine(fixture.SequenceDiagram.GetDiagram()); } }
public void GitHubFlowFeatureBranch() { using var fixture = new EmptyRepositoryFixture(); fixture.SequenceDiagram.Participant(MainBranch); // GitFlow setup fixture.Repository.MakeACommit(); fixture.ApplyTag("1.2.0"); // Branch to develop fixture.MakeACommit(); fixture.AssertFullSemver("1.2.1+1"); // Open Pull Request const string branchName = "feature/myFeature"; fixture.BranchTo(branchName, "feature"); fixture.SequenceDiagram.Activate(branchName); fixture.AssertFullSemver("1.2.1-myFeature.1+1"); fixture.MakeACommit(); fixture.AssertFullSemver("1.2.1-myFeature.1+2"); // Merge into main fixture.Checkout(MainBranch); fixture.MergeNoFF(branchName); fixture.SequenceDiagram.Destroy(branchName); fixture.SequenceDiagram.NoteOver("Feature branches should\r\nbe deleted once merged", branchName); fixture.AssertFullSemver("1.2.1+3"); }
public void GivenARepositoryWithTwoTagsAndADevelopBranch() { using var fixture = new EmptyRepositoryFixture(); const string firstVersion = "1.0"; const string hotfixVersion = "1.0.1"; fixture.MakeACommit($"init {TestBase.MainBranch}"); fixture.ApplyTag(firstVersion); fixture.MakeACommit("hotfix"); fixture.ApplyTag(hotfixVersion); fixture.BranchTo("develop"); fixture.MakeACommit("new feature"); fixture.Checkout(hotfixVersion); fixture.BranchTo("tags/1.0.1"); fixture.AssertFullSemver(hotfixVersion); }
// Copied from GitVersion, to attempt fixing this bug: https://travis-ci.org/GitTools/GitVersion/jobs/171288284#L2025 public void GitHubFlowMajorRelease() { using (var fixture = new EmptyRepositoryFixture()) { fixture.SequenceDiagram.Participant("master"); fixture.Repository.MakeACommit(); fixture.ApplyTag("1.3.0"); // Create release branch fixture.BranchTo("release/2.0.0", "release"); fixture.SequenceDiagram.Activate("release/2.0.0"); fixture.MakeACommit(); // fixture.AssertFullSemver("2.0.0-beta.1+1"); fixture.MakeACommit(); // fixture.AssertFullSemver("2.0.0-beta.1+2"); // Apply beta.1 tag should be exact tag fixture.ApplyTag("2.0.0-beta.1"); // fixture.AssertFullSemver("2.0.0-beta.1"); // test that the CommitsSinceVersionSource should still return commit count // var version = fixture.GetVersion(); // version.CommitsSinceVersionSource.ShouldBe("2"); // Make a commit after a tag should bump up the beta fixture.MakeACommit(); // fixture.AssertFullSemver("2.0.0-beta.2+3"); // Complete release fixture.Checkout("master"); fixture.MergeNoFF("release/2.0.0"); fixture.SequenceDiagram.Destroy("release/2.0.0"); fixture.SequenceDiagram.NoteOver("Release branches are deleted once merged", "release/2.0.0"); //fixture.AssertFullSemver("2.0.0+0"); fixture.ApplyTag("2.0.0"); // fixture.AssertFullSemver("2.0.0"); fixture.MakeACommit(); #if !NETCOREAPP1_1 fixture.Repository.DumpGraph(); #endif // fixture.AssertFullSemver("2.0.1+1"); } }
public void GitFlowMajorRelease() { using (var fixture = new EmptyRepositoryFixture(new Config())) { fixture.Participant("master"); fixture.Participant("develop"); fixture.Repository.MakeACommit(); fixture.ApplyTag("1.3.0"); // GitFlow setup fixture.BranchTo("develop"); fixture.MakeACommit(); // Create release branch fixture.BranchTo("release/2.0.0", "release"); fixture.Activate("release/2.0.0"); fixture.AssertFullSemver("2.0.0-beta.1+0"); // Make another commit on develop fixture.Checkout("develop"); fixture.MakeACommit(); fixture.AssertFullSemver("1.4.0-unstable.2"); // Make a commit to release-2.0.0 fixture.Checkout("release/2.0.0"); fixture.MakeACommit(); fixture.AssertFullSemver("2.0.0-beta.1+1"); // Apply beta.1 tag should be exact tag fixture.ApplyTag("2.0.0-beta.1"); fixture.AssertFullSemver("2.0.0-beta.1"); // Make a commit after a tag should bump up the beta fixture.MakeACommit(); fixture.AssertFullSemver("2.0.0-beta.2+2"); // Complete release fixture.Checkout("master"); fixture.MergeNoFF("release/2.0.0"); fixture.Checkout("develop"); fixture.MergeNoFF("release/2.0.0"); fixture.Destroy("release/2.0.0"); fixture.NoteOver("Release branches are deleted once merged", "release/2.0.0"); fixture.Checkout("master"); fixture.AssertFullSemver("2.0.0+0"); fixture.ApplyTag("2.0.0"); fixture.AssertFullSemver("2.0.0"); // Not 0 for commit count as we can't know the increment rules of the merged branch fixture.Checkout("develop"); fixture.AssertFullSemver("2.1.0-unstable.2"); } }
public void CommitsSinceVersionSourceShouldNotGoDownUponGitFlowReleaseFinish() { var config = new Config { VersioningMode = VersioningMode.ContinuousDeployment }; using (var fixture = new EmptyRepositoryFixture()) { fixture.MakeACommit(); fixture.ApplyTag("1.1.0"); fixture.BranchTo("develop"); fixture.MakeACommit("commit in develop - 1"); fixture.AssertFullSemver("1.2.0-alpha.1"); fixture.BranchTo("release/1.2.0"); fixture.AssertFullSemver("1.2.0-beta.1+0"); fixture.Checkout("develop"); fixture.MakeACommit("commit in develop - 2"); fixture.MakeACommit("commit in develop - 3"); fixture.MakeACommit("commit in develop - 4"); fixture.MakeACommit("commit in develop - 5"); fixture.AssertFullSemver("1.3.0-alpha.4"); fixture.Checkout("release/1.2.0"); fixture.MakeACommit("commit in release/1.2.0 - 1"); fixture.MakeACommit("commit in release/1.2.0 - 2"); fixture.MakeACommit("commit in release/1.2.0 - 3"); fixture.AssertFullSemver("1.2.0-beta.1+3"); fixture.Checkout("master"); fixture.MergeNoFF("release/1.2.0"); fixture.ApplyTag("1.2.0"); fixture.Checkout("develop"); fixture.MergeNoFF("release/1.2.0"); fixture.MakeACommit("commit in develop - 6"); fixture.AssertFullSemver("1.3.0-alpha.9"); fixture.SequenceDiagram.Destroy("release/1.2.0"); fixture.Repository.Branches.Remove("release/1.2.0"); var expectedFullSemVer = "1.3.0-alpha.9"; fixture.AssertFullSemver(config, expectedFullSemVer); } }
public void GitFlowSupportHotfixRelease() { using (var fixture = new EmptyRepositoryFixture(new Config())) { fixture.Participant("develop"); fixture.Participant("master"); fixture.Repository.MakeACommit(); fixture.ApplyTag("1.3.0"); // GitFlow setup fixture.Repository.MakeACommit(); fixture.BranchTo("develop"); fixture.NoteOver("Create 2.0.0 release and complete", "develop", "master"); fixture.Checkout("master"); fixture.ApplyTag("2.0.0"); // Create hotfix branch fixture.Checkout("1.3.0"); fixture.BranchToFromTag("support/1.x", "1.3.0", "master", "support"); fixture.MakeACommit(); fixture.AssertFullSemver("1.3.1+1"); fixture.BranchTo("hotfix/1.3.1", "hotfix2"); fixture.Activate("hotfix/1.3.1"); fixture.MakeACommit(); fixture.MakeACommit(); fixture.AssertFullSemver("1.3.1-beta.1+3"); // Apply beta.1 tag should be exact tag fixture.ApplyTag("1.3.1-beta.1"); fixture.AssertFullSemver("1.3.1-beta.1"); fixture.Checkout("support/1.x"); fixture.MergeNoFF("hotfix/1.3.1"); fixture.Destroy("hotfix/1.3.1"); fixture.NoteOver("Hotfix branches are deleted once merged", "hotfix/1.3.1"); fixture.AssertFullSemver("1.3.1+4"); fixture.ApplyTag("1.3.1"); fixture.AssertFullSemver("1.3.1"); } }
public void MergeFeatureIntoMainline() { var config = new Config { VersioningMode = VersioningMode.Mainline }; using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); fixture.ApplyTag("1.0.0"); fixture.AssertFullSemver("1.0.0", config); fixture.BranchTo("feature/foo"); fixture.MakeACommit(); fixture.AssertFullSemver("1.0.1-foo.1", config); fixture.ApplyTag("1.0.1-foo.1"); fixture.Checkout("master"); fixture.MergeNoFF("feature/foo"); fixture.AssertFullSemver("1.0.1", config); }
public void GitHubFlowMajorRelease() { using (var fixture = new EmptyRepositoryFixture(new Config())) { fixture.Participant("master"); fixture.Repository.MakeACommit(); fixture.ApplyTag("1.3.0"); // Create release branch fixture.BranchTo("release/2.0.0", "release"); fixture.Activate("release/2.0.0"); fixture.MakeACommit(); fixture.AssertFullSemver("2.0.0-beta.1+1"); fixture.MakeACommit(); fixture.AssertFullSemver("2.0.0-beta.1+2"); // Apply beta.1 tag should be exact tag fixture.ApplyTag("2.0.0-beta.1"); fixture.AssertFullSemver("2.0.0-beta.1"); // Make a commit after a tag should bump up the beta fixture.MakeACommit(); fixture.AssertFullSemver("2.0.0-beta.2+3"); // Complete release fixture.Checkout("master"); fixture.MergeNoFF("release/2.0.0"); fixture.Destroy("release/2.0.0"); fixture.NoteOver("Release branches are deleted once merged", "release/2.0.0"); fixture.AssertFullSemver("2.0.0+0"); fixture.ApplyTag("2.0.0"); fixture.AssertFullSemver("2.0.0"); fixture.MakeACommit(); fixture.Repository.DumpGraph(); fixture.AssertFullSemver("2.0.1+1"); } }
public void CommitsSinceVersionSourceGoesDownWhenDeletingAReleaseBranch() { var config = new Config { VersioningMode = VersioningMode.ContinuousDeployment }; using (var fixture = new EmptyRepositoryFixture()) { fixture.MakeACommit(); fixture.ApplyTag("1.1.0"); fixture.BranchTo("develop"); fixture.MakeACommit("commit in develop"); fixture.BranchTo("feature/featureA"); fixture.MakeACommit("commit in featureA"); fixture.MakeACommit("commit in featureA"); fixture.Checkout("develop"); fixture.MakeACommit("commit in develop"); fixture.MakeACommit("commit in develop"); fixture.BranchTo("release/1.2.0"); fixture.MakeACommit("commit in release/1.2.0"); fixture.Checkout("feature/featureA"); fixture.MergeNoFF("develop"); fixture.Checkout("develop"); fixture.MergeNoFF("feature/featureA"); fixture.Checkout("master"); fixture.MergeNoFF("release/1.2.0"); fixture.ApplyTag("1.2.0"); fixture.Checkout("develop"); fixture.MergeNoFF("release/1.2.0"); fixture.SequenceDiagram.Destroy("release/1.2.0"); fixture.Repository.Branches.Remove("release/1.2.0"); var expectedFullSemVer = "1.3.0-alpha.6"; fixture.AssertFullSemver(config, expectedFullSemVer); } }
public void CanUseCommitMessagesToBumpVersionBaseVersionTagIsAppliedToSameCommit() { using (var fixture = new EmptyRepositoryFixture()) { fixture.Repository.MakeACommit(); fixture.MakeATaggedCommit("1.0.0"); fixture.Repository.MakeACommit("+semver:minor"); fixture.AssertFullSemver("1.1.0+1"); fixture.ApplyTag("2.0.0"); fixture.Repository.MakeACommit("Hello"); // Default bump is patch fixture.AssertFullSemver("2.0.1+1"); } }
public void ShouldHaveAGreaterSemVerAfterDevelopIsMergedIntoFeature() { var config = new Config() { VersioningMode = VersioningMode.ContinuousDeployment, AssemblyVersioningScheme = AssemblyVersioningScheme.Major, AssemblyFileVersioningFormat = "{MajorMinorPatch}.{env:WeightedPreReleaseNumber ?? 0}", LegacySemVerPadding = 4, BuildMetaDataPadding = 4, CommitsSinceVersionSourcePadding = 4, CommitMessageIncrementing = CommitMessageIncrementMode.Disabled, Branches = new Dictionary <string, BranchConfig> { { "develop", new BranchConfig() { PreventIncrementOfMergedBranchVersion = true } }, { "feature", new BranchConfig() { Tag = "feat-{BranchName}" } } } }; using (var fixture = new EmptyRepositoryFixture()) { fixture.MakeACommit(); fixture.BranchTo("develop"); fixture.MakeACommit(); fixture.ApplyTag("16.23.0"); fixture.MakeACommit(); fixture.BranchTo("feature/featX"); fixture.MakeACommit(); fixture.Checkout("develop"); fixture.MakeACommit(); fixture.Checkout("feature/featX"); fixture.MergeNoFF("develop"); fixture.AssertFullSemver(config, "16.24.0-feat-featX.4"); } }
public void GitFlowMinorRelease() { using (var fixture = new EmptyRepositoryFixture()) { fixture.SequenceDiagram.Participant("master"); fixture.SequenceDiagram.Participant("develop"); // GitFlow setup fixture.Repository.MakeACommit(); fixture.ApplyTag("1.2.1"); // GitFlow setup fixture.BranchTo("develop"); fixture.MakeACommit(); // Create release branch fixture.BranchTo("release/1.3.0", "release"); fixture.SequenceDiagram.Activate("release/1.3.0"); fixture.AssertFullSemver("1.3.0-beta.1+0"); // Make another commit on develop fixture.Checkout("develop"); fixture.MakeACommit(); fixture.AssertFullSemver("1.4.0-alpha.1"); // Make a commit to release-1.3.0 fixture.Checkout("release/1.3.0"); fixture.MakeACommit(); fixture.AssertFullSemver("1.3.0-beta.1+1"); // Apply beta.1 tag should be exact tag fixture.ApplyTag("1.3.0-beta.1"); fixture.AssertFullSemver("1.3.0-beta.1"); // Make a commit after a tag should bump up the beta fixture.MakeACommit(); fixture.AssertFullSemver("1.3.0-beta.2+2"); // Complete release fixture.Checkout("master"); fixture.MergeNoFF("release/1.3.0"); fixture.Checkout("develop"); fixture.MergeNoFF("release/1.3.0"); fixture.SequenceDiagram.Destroy("release/1.3.0"); fixture.SequenceDiagram.NoteOver("Release branches are deleted once merged", "release/1.3.0"); fixture.Checkout("master"); fixture.ApplyTag("1.3.0"); fixture.AssertFullSemver("1.3.0"); // Not 0 for commit count as we can't know the increment rules of the merged branch fixture.Checkout("develop"); fixture.AssertFullSemver("1.4.0-alpha.4"); Console.WriteLine(fixture.SequenceDiagram.GetDiagram()); } }
public void GitHubFlowMajorRelease() { using (var fixture = new EmptyRepositoryFixture()) { fixture.SequenceDiagram.Participant("master"); fixture.Repository.MakeACommit(); fixture.ApplyTag("1.3.0"); // Create release branch fixture.BranchTo("release/2.0.0", "release"); fixture.SequenceDiagram.Activate("release/2.0.0"); fixture.MakeACommit(); fixture.AssertFullSemver("2.0.0-beta.1+1"); fixture.MakeACommit(); fixture.AssertFullSemver("2.0.0-beta.1+2"); // Apply beta.1 tag should be exact tag fixture.ApplyTag("2.0.0-beta.1"); fixture.AssertFullSemver("2.0.0-beta.1"); // test that the CommitsSinceVersionSource should still return commit count var version = fixture.GetVersion(new Config()); version.CommitsSinceVersionSource.ShouldBe("2"); // Make a commit after a tag should bump up the beta fixture.MakeACommit(); fixture.AssertFullSemver("2.0.0-beta.2+3"); // Complete release fixture.Checkout("master"); fixture.MergeNoFF("release/2.0.0"); fixture.SequenceDiagram.Destroy("release/2.0.0"); fixture.SequenceDiagram.NoteOver("Release branches are deleted once merged", "release/2.0.0"); fixture.AssertFullSemver("2.0.0+0"); fixture.ApplyTag("2.0.0"); fixture.AssertFullSemver("2.0.0"); fixture.MakeACommit(); fixture.Repository.DumpGraph(); fixture.AssertFullSemver("2.0.1+1"); } }
public void GitFlowSupportMinorRelease() { using (var fixture = new EmptyRepositoryFixture()) { fixture.SequenceDiagram.Participant("develop"); fixture.SequenceDiagram.Participant("master"); fixture.Repository.MakeACommit(); fixture.ApplyTag("1.3.0"); // GitFlow setup fixture.Repository.MakeACommit(); fixture.BranchTo("develop"); fixture.SequenceDiagram.NoteOver("Create 2.0.0 release and complete", "develop", "master"); fixture.Checkout("master"); fixture.ApplyTag("2.0.0"); // Create hotfix branch fixture.Checkout("1.3.0"); fixture.BranchToFromTag("support/1.x", "1.3.0", "master", "support"); fixture.SequenceDiagram.NoteOver("Create 1.3.1 release and complete", "master", "support/1.x"); fixture.Repository.MakeACommit(); fixture.ApplyTag("1.3.1"); fixture.BranchTo("release/1.4.0", "supportRelease"); fixture.SequenceDiagram.Activate("release/1.4.0"); fixture.MakeACommit(); fixture.MakeACommit(); fixture.AssertFullSemver("1.4.0-beta.1+2"); // Apply beta.1 tag should be exact tag fixture.ApplyTag("1.4.0-beta.1"); fixture.AssertFullSemver("1.4.0-beta.1"); fixture.Checkout("support/1.x"); fixture.MergeNoFF("release/1.4.0"); fixture.SequenceDiagram.Destroy("release/1.4.0"); fixture.SequenceDiagram.NoteOver("Release branches are deleted once merged", "release/1.4.0"); fixture.AssertFullSemver("1.4.0+0"); fixture.ApplyTag("1.4.0"); fixture.AssertFullSemver("1.4.0"); } }
public void GitFlowSupportHotfixRelease() { using (var fixture = new EmptyRepositoryFixture(new Config())) { fixture.Participant("develop"); fixture.Participant("master"); fixture.Repository.MakeACommit(); fixture.ApplyTag("1.3.0"); // GitFlow setup fixture.Repository.MakeACommit(); fixture.BranchTo("develop"); fixture.NoteOver("Create 2.0.0 release and complete", "develop", "master"); fixture.Checkout("master"); fixture.ApplyTag("2.0.0"); // Create hotfix branch fixture.Checkout("1.3.0"); fixture.BranchToFromTag("support/1.x", "1.3.0", "master", "support"); fixture.MakeACommit(); fixture.AssertFullSemver("1.3.1+1"); fixture.BranchTo("hotfix/1.3.1", "hotfix2"); fixture.Activate("hotfix/1.3.1"); fixture.MakeACommit(); fixture.MakeACommit(); fixture.AssertFullSemver("1.3.1-beta.1+3"); // Apply beta.1 tag should be exact tag fixture.ApplyTag("1.3.1-beta.1"); fixture.AssertFullSemver("1.3.1-beta.1"); fixture.Checkout("support/1.x"); fixture.MergeNoFF("hotfix/1.3.1"); fixture.Destroy("hotfix/1.3.1"); fixture.NoteOver("Hotfix branches are deleted once merged", "hotfix/1.3.1"); fixture.AssertFullSemver("1.3.1+4"); fixture.ApplyTag("1.3.1"); fixture.AssertFullSemver("1.3.1"); } }
public void GitHubFlowMajorRelease() { using (var fixture = new EmptyRepositoryFixture(new Config())) { fixture.Participant("master"); fixture.Repository.MakeACommit(); fixture.ApplyTag("1.3.0"); // Create release branch fixture.BranchTo("release/2.0.0", "release"); fixture.Activate("release/2.0.0"); fixture.MakeACommit(); fixture.AssertFullSemver("2.0.0-beta.1+1"); fixture.MakeACommit(); fixture.AssertFullSemver("2.0.0-beta.1+2"); // Apply beta.1 tag should be exact tag fixture.ApplyTag("2.0.0-beta.1"); fixture.AssertFullSemver("2.0.0-beta.1"); // Make a commit after a tag should bump up the beta fixture.MakeACommit(); fixture.AssertFullSemver("2.0.0-beta.2+3"); // Complete release fixture.Checkout("master"); fixture.MergeNoFF("release/2.0.0"); fixture.Destroy("release/2.0.0"); fixture.NoteOver("Release branches are deleted once merged", "release/2.0.0"); fixture.AssertFullSemver("2.0.0+0"); fixture.ApplyTag("2.0.0"); fixture.AssertFullSemver("2.0.0"); fixture.MakeACommit(); fixture.Repository.DumpGraph(); fixture.AssertFullSemver("2.0.1+1"); } }