-
Notifications
You must be signed in to change notification settings - Fork 657
Config file updates #302
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
JakeGinnivan
merged 17 commits into
GitTools:master
from
JakeGinnivan:ConfigFileUpdates
Nov 17, 2014
Merged
Config file updates #302
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c9a7112
Moved configuration files to Core
JakeGinnivan ade1b86
Put config files into namespaces
JakeGinnivan f8c8b38
Introduced ConfigurationProvider and added config parameter into GitV…
JakeGinnivan 42e470f
Fixed busted test
JakeGinnivan 08af262
Promoted config up in tests
JakeGinnivan 1389f81
Added tests for overriding develop tag via config and updated msbuild…
JakeGinnivan ba66f4e
Updated support for release branch tag name configuration
JakeGinnivan aa284e7
Moved test fixtures into their own folder
JakeGinnivan bb39373
Moved integration tests into a sub folder
JakeGinnivan 31d4208
Added tag-prefix configuration option
JakeGinnivan a0037a6
Added Tag prefix support to Task
JakeGinnivan e48ed59
Remove the [vV] stripping from the front of the Regex on the Semantic…
JakeGinnivan a28c18a
Fixed #242
JakeGinnivan 206ebe2
Fixed variable naming
JakeGinnivan 81779f7
Updated other places which required git tag prefix cleanup
JakeGinnivan b7e84be
Fixed remaining issue
JakeGinnivan 9264a60
PR feedback changes
JakeGinnivan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.IO; | ||
using GitVersion; | ||
using GitVersion.Configuration; | ||
using NUnit.Framework; | ||
using Shouldly; | ||
|
||
[TestFixture] | ||
public class ConfigReaderTests | ||
{ | ||
|
||
[Test] | ||
public void CanReadDocument() | ||
{ | ||
const string text = @" | ||
assemblyVersioningScheme: MajorMinor | ||
develop-branch-tag: alpha | ||
release-branch-tag: rc | ||
"; | ||
var config = ConfigReader.Read(new StringReader(text)); | ||
config.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinor); | ||
config.DevelopBranchTag.ShouldBe("alpha"); | ||
config.ReleaseBranchTag.ShouldBe("rc"); | ||
} | ||
|
||
[Test] | ||
public void CanReadDefaultDocument() | ||
{ | ||
const string text = ""; | ||
var config = ConfigReader.Read(new StringReader(text)); | ||
config.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinorPatch); | ||
config.DevelopBranchTag.ShouldBe("unstable"); | ||
config.ReleaseBranchTag.ShouldBe("beta"); | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
...s/GitFlow/BaseGitFlowRepositoryFixture.cs → .../Fixtures/BaseGitFlowRepositoryFixture.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...onCore.Tests/CommitCountingRepoFixture.cs → ...sts/Fixtures/CommitCountingRepoFixture.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...rsionCore.Tests/EmptyRepositoryFixture.cs → ....Tests/Fixtures/EmptyRepositoryFixture.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
GitVersionCore.Tests/IntegrationTests/GitFlow/DevelopScenarios.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using GitVersion.Configuration; | ||
using LibGit2Sharp; | ||
using NUnit.Framework; | ||
|
||
[TestFixture] | ||
public class DevelopScenarios | ||
{ | ||
[Test] | ||
public void WhenDevelopBranchedFromMaster_MinorIsIncreased() | ||
{ | ||
using (var fixture = new EmptyRepositoryFixture(new Config())) | ||
{ | ||
fixture.Repository.MakeATaggedCommit("1.0.0"); | ||
fixture.Repository.CreateBranch("develop").Checkout(); | ||
fixture.AssertFullSemver("1.1.0-unstable.0+0"); | ||
} | ||
} | ||
|
||
[Test] | ||
public void CanChangeDevelopTagViaConfig() | ||
{ | ||
using (var fixture = new EmptyRepositoryFixture(new Config | ||
{ | ||
DevelopBranchTag = "alpha" | ||
})) | ||
{ | ||
fixture.Repository.MakeATaggedCommit("1.0.0"); | ||
fixture.Repository.CreateBranch("develop").Checkout(); | ||
fixture.AssertFullSemver("1.1.0-alpha.0+0"); | ||
} | ||
} | ||
|
||
[Test] | ||
public void CanClearDevelopTagViaConfig() | ||
{ | ||
using (var fixture = new EmptyRepositoryFixture(new Config | ||
{ | ||
DevelopBranchTag = "" | ||
})) | ||
{ | ||
fixture.Repository.MakeATaggedCommit("1.0.0"); | ||
fixture.Repository.CreateBranch("develop").Checkout(); | ||
fixture.AssertFullSemver("1.1.0+0"); | ||
} | ||
} | ||
|
||
[Test] | ||
public void WhenDevelopBranchedFromMasterDetachedHead_MinorIsIncreased() | ||
{ | ||
using (var fixture = new EmptyRepositoryFixture(new Config())) | ||
{ | ||
fixture.Repository.MakeATaggedCommit("1.0.0"); | ||
fixture.Repository.CreateBranch("develop").Checkout(); | ||
fixture.Repository.MakeACommit(); | ||
var commit = fixture.Repository.Head.Tip; | ||
fixture.Repository.MakeACommit(); | ||
fixture.Repository.Checkout(commit); | ||
fixture.AssertFullSemver("1.1.0-unstable.1+1"); | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What are all these files that got added into the project?
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.
Allows nCrunch and other things to track the dependency. Can do it via config as well if we prefer
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.
Gotcha. No. that's fine, I was just curious as to what they are.
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.
ok so @gep13 is smarter than me
what do u mean by this?
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.
There was no smarts involved here. I have never used nCrunch, so I took it that Jake knew what he was talking about and I left it at that :-)
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.
nCrunch creates a temporary working directory. I can exclude this and then tell nCrunch to include these files via config instead. Don't mind which. but they are required for the tests to run
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.
can this be done with a
**/*.*
hidden node hack instead?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.
but this should not block the PR. i can hack it later
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 can switch to nCrunch config if you want? There are a few other things I need to cleanup, so will exclude and change to config.