-
Notifications
You must be signed in to change notification settings - Fork 654
Fixing tests #355
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
Fixing tests #355
Changes from all commits
e9382e1
86e5b1a
917ef91
e0bf106
07085ab
be87141
a611c65
2c2019f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,13 +13,13 @@ public void PatchLatestReleaseExample() | |
// create hotfix | ||
fixture.Repository.CreateBranch("hotfix-1.2.1").Checkout(); | ||
|
||
fixture.AssertFullSemver("1.2.1-beta.1+1"); | ||
fixture.AssertFullSemver("1.2.1-beta.1+0"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good example of new commit counting. We have not commited to the new branch, so why was it 1? |
||
fixture.Repository.MakeACommit(); | ||
fixture.AssertFullSemver("1.2.1-beta.1+2"); | ||
fixture.AssertFullSemver("1.2.1-beta.1+1"); | ||
fixture.Repository.ApplyTag("1.2.1-beta.1"); | ||
fixture.AssertFullSemver("1.2.1-beta.1+2"); | ||
fixture.AssertFullSemver("1.2.1-beta.1+0"); | ||
fixture.Repository.MakeACommit(); | ||
fixture.AssertFullSemver("1.2.1-beta.2+3"); | ||
fixture.AssertFullSemver("1.2.1-beta.2+1"); | ||
|
||
// Merge hotfix branch to master | ||
fixture.Repository.Checkout("master"); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,9 @@ public void CanTakeVersionFromReleaseBranch() | |
fixture.Repository.CreateBranch("release-2.0.0"); | ||
fixture.Repository.Checkout("release-2.0.0"); | ||
|
||
fixture.AssertFullSemver("2.0.0-beta.1+5"); | ||
fixture.AssertFullSemver("2.0.0-beta.1+0"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, haven't commited to the release branch yet, so commit count is 0 |
||
fixture.Repository.MakeCommits(2); | ||
fixture.AssertFullSemver("2.0.0-beta.1+2"); | ||
} | ||
} | ||
|
||
|
@@ -33,26 +35,9 @@ public void CanTakeVersionFromReleaseBranchWithTagOverriden() | |
fixture.Repository.CreateBranch("release-2.0.0"); | ||
fixture.Repository.Checkout("release-2.0.0"); | ||
|
||
fixture.AssertFullSemver("2.0.0-rc.1+5"); | ||
} | ||
} | ||
|
||
[Test] | ||
public void CanHandleContinuousDeployment() | ||
{ | ||
var config = new Config | ||
{ | ||
VersioningMode = VersioningMode.ContinuousDeployment | ||
}; | ||
using (var fixture = new EmptyRepositoryFixture(config)) | ||
{ | ||
fixture.Repository.MakeATaggedCommit("1.0.3"); | ||
fixture.Repository.CreateBranch("develop"); | ||
fixture.Repository.MakeCommits(5); | ||
fixture.Repository.CreateBranch("release-2.0.0"); | ||
fixture.Repository.Checkout("release-2.0.0"); | ||
|
||
fixture.AssertFullSemver("2.0.0-beta.5+5"); | ||
fixture.AssertFullSemver("2.0.0-rc.1+0"); | ||
fixture.Repository.MakeCommits(2); | ||
fixture.AssertFullSemver("2.0.0-rc.1+2"); | ||
} | ||
} | ||
|
||
|
@@ -67,7 +52,9 @@ public void CanHandleReleaseBranchWithStability() | |
fixture.Repository.CreateBranch("release-2.0.0-Final"); | ||
fixture.Repository.Checkout("release-2.0.0-Final"); | ||
|
||
fixture.AssertFullSemver("2.0.0-beta.1+5"); | ||
fixture.AssertFullSemver("2.0.0-beta.1+0"); | ||
fixture.Repository.MakeCommits(2); | ||
fixture.AssertFullSemver("2.0.0-beta.1+2"); | ||
} | ||
} | ||
|
||
|
@@ -85,13 +72,13 @@ public void WhenReleaseBranchIsMergedIntoMasterVersionIsTakenWithIt() | |
fixture.Repository.Checkout("master"); | ||
fixture.Repository.MergeNoFF("release-2.0.0", Constants.SignatureNow()); | ||
|
||
// TODO For GitHubFlow this is 2.0.0+6, why is it different | ||
fixture.AssertFullSemver("2.0.0"); | ||
fixture.AssertFullSemver("2.0.0+0"); | ||
fixture.Repository.MakeCommits(2); | ||
fixture.AssertFullSemver("2.0.0+2"); | ||
} | ||
} | ||
|
||
// TODO This test fails for GitFlow, it needs to be fixed (although in reality a support branch should be used) | ||
[Test, Ignore] | ||
[Test] | ||
public void WhenReleaseBranchIsMergedIntoMasterHighestVersionIsTakenWithIt() | ||
{ | ||
using (var fixture = new EmptyRepositoryFixture(new Config())) | ||
|
@@ -116,7 +103,7 @@ public void WhenReleaseBranchIsMergedIntoMasterHighestVersionIsTakenWithIt() | |
fixture.Repository.Checkout("develop"); | ||
fixture.Repository.MergeNoFF("release-1.0.0", Constants.SignatureNow()); | ||
|
||
fixture.AssertFullSemver("2.0.0+11"); | ||
fixture.AssertFullSemver("2.0.0-unstable.1+5"); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,9 @@ public void CanTakeVersionFromReleaseBranch() | |
fixture.Repository.CreateBranch("release-2.0.0"); | ||
fixture.Repository.Checkout("release-2.0.0"); | ||
|
||
fixture.AssertFullSemver("2.0.0-beta.1+5"); | ||
fixture.AssertFullSemver("2.0.0-beta.1+0"); | ||
fixture.Repository.MakeCommits(2); | ||
fixture.AssertFullSemver("2.0.0-beta.1+2"); | ||
} | ||
} | ||
|
||
|
@@ -31,7 +33,9 @@ public void CanTakeVersionFromReleaseBranchWithTagOverriden() | |
fixture.Repository.CreateBranch("release-2.0.0"); | ||
fixture.Repository.Checkout("release-2.0.0"); | ||
|
||
fixture.AssertFullSemver("2.0.0-rc.1+5"); | ||
fixture.AssertFullSemver("2.0.0-rc.1+0"); | ||
fixture.Repository.MakeCommits(2); | ||
fixture.AssertFullSemver("2.0.0-rc.1+2"); | ||
} | ||
} | ||
|
||
|
@@ -48,7 +52,7 @@ public void WhenReleaseBranchIsMergedIntoMasterVersionIsTakenWithIt() | |
fixture.Repository.Checkout("master"); | ||
fixture.Repository.MergeNoFF("release-2.0.0", Constants.SignatureNow()); | ||
|
||
fixture.AssertFullSemver("2.0.0+6"); | ||
fixture.AssertFullSemver("2.0.0+0"); | ||
} | ||
} | ||
[Test] | ||
|
@@ -71,7 +75,7 @@ public void WhenReleaseBranchIsMergedIntoMasterHighestVersionIsTakenWithIt() | |
fixture.Repository.Checkout("master"); | ||
fixture.Repository.MergeNoFF("release-1.0.0", Constants.SignatureNow()); | ||
|
||
fixture.AssertFullSemver("2.0.0+11"); | ||
fixture.AssertFullSemver("2.0.0+5"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume this is because we are not as smart with commit counting. It is counting commits along the branch, not including the commits which were merged in. Is this an issue? |
||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this new behaviour is correct. the .1 is the same as we put on -beta, -unstable etc.