Skip to content

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

Merged

Conversation

JakeGinnivan
Copy link
Contributor

Taking a run at fixing a bunch of the failing tests. All of these tests are mainly failing because of commit counting strategies.

I have simplified this a great deal (in my mind). GitVersion now uses this basic rule:

Count commits from the source of the base version, if a base version doesn't have a source (say NextVersion from Config) it will use the source from the next base version.

For example, if the base version comes from a tag then it will be counted from that tag. If it is from a version in a branch name then it will be number of commits since that branch was created. If it comes a merge message it will count from when that merge was done.

The current commit counting confuses me. Would love a decent review of the commit counts in this @andreasohlund @SimonCropp @gep13 @nulltoken if possible :)

@@ -17,7 +17,7 @@ public void ShouldNotUseNumberInFeatureBranchAsPreReleaseNumber()
fixture.Repository.Checkout("feature/JIRA-123");
fixture.Repository.MakeCommits(5);

fixture.AssertFullSemver("1.1.0-JIRA-123+5");
fixture.AssertFullSemver("1.1.0-JIRA-123.1+5");
Copy link
Contributor Author

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.

@JakeGinnivan
Copy link
Contributor Author

image

Also got tests showing that PR's off develop bump minor but PR's off master bump patch (PR's inherit the incrementing config from the branch they were branched from

// @SimonCropp @andreasohlund @gep13 @yannisgu a review of this would be grand.

fixture.Repository.Reset(ResetMode.Hard, "HEAD~1");
fixture.Repository.Checkout("pull/2/merge");

fixture.DumpGraph();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this only for debug purpose?
Or is it intentional logging? Then it should probably be added to all tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has no side effects but could probably be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed test is wrong. Should be PullRequest.2

@JakeGinnivan
Copy link
Contributor Author

Anyone have any issues with the general commit counting changes in this.

There is still work to be done on the main branch to get all tests green but don't want to do any more on this.

Otherwise I can just merge and continue until I get green then you can take it for a spin and review the final changes?

@andreasohlund
Copy link
Contributor

The logic of the new commit counting seems sound to me. +1 for proceeding

JakeGinnivan added a commit that referenced this pull request Feb 11, 2015
@JakeGinnivan JakeGinnivan merged commit 7af3377 into GitTools:BranchSpecificConfiguration Feb 11, 2015
@JakeGinnivan JakeGinnivan deleted the FixingTests branch February 11, 2015 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants