Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 636aff0

Browse files
committed
Added GitHubFlowMajorRelease test from GitVersion.
1 parent d3adbd4 commit 636aff0

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

src/GitTools.Core.Tests/Git/GitRepositoryHelperTests.cs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,5 +176,52 @@ public void CheckedOutShaShouldNotChanged()
176176
}
177177
}
178178
}
179+
180+
181+
[Test]
182+
// Copied from GitVersion, to attempt fixing this bug: https://travis-ci.org/GitTools/GitVersion/jobs/171288284#L2025
183+
public void GitHubFlowMajorRelease()
184+
{
185+
using (var fixture = new EmptyRepositoryFixture())
186+
{
187+
fixture.SequenceDiagram.Participant("master");
188+
189+
fixture.Repository.MakeACommit();
190+
fixture.ApplyTag("1.3.0");
191+
192+
// Create release branch
193+
fixture.BranchTo("release/2.0.0", "release");
194+
fixture.SequenceDiagram.Activate("release/2.0.0");
195+
fixture.MakeACommit();
196+
// fixture.AssertFullSemver("2.0.0-beta.1+1");
197+
fixture.MakeACommit();
198+
// fixture.AssertFullSemver("2.0.0-beta.1+2");
199+
200+
// Apply beta.1 tag should be exact tag
201+
fixture.ApplyTag("2.0.0-beta.1");
202+
// fixture.AssertFullSemver("2.0.0-beta.1");
203+
204+
// test that the CommitsSinceVersionSource should still return commit count
205+
// var version = fixture.GetVersion();
206+
// version.CommitsSinceVersionSource.ShouldBe("2");
207+
208+
// Make a commit after a tag should bump up the beta
209+
fixture.MakeACommit();
210+
// fixture.AssertFullSemver("2.0.0-beta.2+3");
211+
212+
// Complete release
213+
fixture.Checkout("master");
214+
fixture.MergeNoFF("release/2.0.0");
215+
fixture.SequenceDiagram.Destroy("release/2.0.0");
216+
fixture.SequenceDiagram.NoteOver("Release branches are deleted once merged", "release/2.0.0");
217+
218+
//fixture.AssertFullSemver("2.0.0+0");
219+
fixture.ApplyTag("2.0.0");
220+
// fixture.AssertFullSemver("2.0.0");
221+
fixture.MakeACommit();
222+
fixture.Repository.DumpGraph();
223+
// fixture.AssertFullSemver("2.0.1+1");
224+
}
225+
}
179226
}
180227
}

0 commit comments

Comments
 (0)