Skip to content

Commit 9885b9a

Browse files
author
Mark Rydstrom
committed
New failing tests around merging master to a feature branch and back
1 parent 727530e commit 9885b9a

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

src/GitVersionCore.Tests/IntegrationTests/MainlineDevelopmentMode.cs

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,88 @@ public void VerifySupportForwardMerge()
190190
fixture.AssertFullSemver(config, "1.0.4-foo.2"); // TODO This probably should be 1.0.5
191191
}
192192
}
193+
194+
[Test]
195+
public void VerifyMergingMasterToFeatureDoesNotCauseBranchCommitsToIncrementVersion()
196+
{
197+
using (var fixture = new EmptyRepositoryFixture())
198+
{
199+
fixture.MakeACommit("first in master");
200+
201+
fixture.BranchTo("feature/foo", "foo");
202+
fixture.MakeACommit("first in foo");
203+
204+
fixture.Checkout("master");
205+
fixture.MakeACommit("second in master");
206+
207+
fixture.Checkout("feature/foo");
208+
fixture.MergeNoFF("master");
209+
fixture.MakeACommit("second in foo");
210+
211+
fixture.Checkout("master");
212+
fixture.MakeATaggedCommit("1.0.0");
213+
214+
fixture.MergeNoFF("feature/foo");
215+
fixture.AssertFullSemver(config, "1.0.1");
216+
}
217+
}
218+
219+
[Test]
220+
public void VerifyMergingMasterToFeatureDoesNotStopMasterCommitsIncrementingVersion()
221+
{
222+
using (var fixture = new EmptyRepositoryFixture())
223+
{
224+
fixture.MakeACommit("first in master");
225+
226+
fixture.BranchTo("feature/foo", "foo");
227+
fixture.MakeACommit("first in foo");
228+
229+
fixture.Checkout("master");
230+
fixture.MakeATaggedCommit("1.0.0");
231+
fixture.MakeACommit("third in master");
232+
233+
fixture.Checkout("feature/foo");
234+
fixture.MergeNoFF("master");
235+
fixture.MakeACommit("second in foo");
236+
237+
fixture.Checkout("master");
238+
fixture.MergeNoFF("feature/foo");
239+
fixture.AssertFullSemver(config, "1.0.2");
240+
}
241+
}
242+
243+
[Test]
244+
public void VerifyMergingMasterIntoAFeatureBranchWorksWithMultipleBranches()
245+
{
246+
using (var fixture = new EmptyRepositoryFixture())
247+
{
248+
fixture.MakeACommit("first in master");
249+
250+
fixture.BranchTo("feature/foo", "foo");
251+
fixture.MakeACommit("first in foo");
252+
253+
fixture.BranchTo("feature/bar", "bar");
254+
fixture.MakeACommit("first in bar");
255+
256+
fixture.Checkout("master");
257+
fixture.MakeACommit("second in master");
258+
259+
fixture.Checkout("feature/foo");
260+
fixture.MergeNoFF("master");
261+
fixture.MakeACommit("second in foo");
262+
263+
fixture.Checkout("feature/bar");
264+
fixture.MergeNoFF("master");
265+
fixture.MakeACommit("second in bar");
266+
267+
fixture.Checkout("master");
268+
fixture.MakeATaggedCommit("1.0.0");
269+
270+
fixture.MergeNoFF("feature/foo");
271+
fixture.MergeNoFF("feature/bar");
272+
fixture.AssertFullSemver(config, "1.0.2");
273+
}
274+
}
193275
}
194276

195277
static class CommitExtensions

0 commit comments

Comments
 (0)