Skip to content

Commit ae9cec8

Browse files
committed
Implement when PreleaseLabel is empty, the PreleaseTag is generated correctly
1 parent 1cb9bb8 commit ae9cec8

File tree

55 files changed

+1814
-1005
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1814
-1005
lines changed

src/GitVersion.App.Tests/JsonOutputOnBuildServerTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void BeingOnBuildServerWithOutputJsonDoesNotFail()
3434
var result = GitVersionHelper.ExecuteIn(fixture.LocalRepositoryFixture.RepositoryPath, arguments: " /output json /output buildserver", environments: env);
3535

3636
result.ExitCode.ShouldBe(0);
37-
const string expectedVersion = "0.0.1+5";
37+
const string expectedVersion = "0.0.1-5";
3838
result.Output.ShouldContain($"##teamcity[buildNumber '{expectedVersion}']");
3939
result.OutputVariables.ShouldNotBeNull();
4040
result.OutputVariables.FullSemVer.ShouldBeEquivalentTo(expectedVersion);
@@ -53,7 +53,7 @@ public void BeingOnBuildServerWithOutputJsonAndOutputFileDoesNotFail(string outp
5353
var result = GitVersionHelper.ExecuteIn(fixture.LocalRepositoryFixture.RepositoryPath, arguments: $" /output json /output buildserver /output file /outputfile {outputFile}", environments: env);
5454

5555
result.ExitCode.ShouldBe(0);
56-
const string expectedVersion = "0.0.1+5";
56+
const string expectedVersion = "0.0.1-5";
5757
result.Output.ShouldContain($"##teamcity[buildNumber '{expectedVersion}']");
5858
result.OutputVariables.ShouldNotBeNull();
5959
result.OutputVariables.FullSemVer.ShouldBeEquivalentTo(expectedVersion);

src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ update-build-number: true
1212
semantic-version-format: Strict
1313
branches:
1414
develop:
15-
mode: ContinuousDeployment
1615
label: alpha
1716
increment: Minor
1817
prevent-increment-of-merged-branch-version: false
@@ -39,6 +38,7 @@ branches:
3938
is-mainline: true
4039
pre-release-weight: 55000
4140
release:
41+
mode: ContinuousDelivery
4242
label: beta
4343
increment: None
4444
prevent-increment-of-merged-branch-version: true
@@ -69,7 +69,7 @@ branches:
6969
is-source-branch-for: []
7070
pre-release-weight: 30000
7171
pull-request:
72-
mode: ContinuousDelivery
72+
mode: ContinuousDeployment
7373
label: PullRequest
7474
increment: Inherit
7575
label-number-pattern: '[/-](?<number>\d+)'
@@ -124,7 +124,7 @@ branches:
124124
is-source-branch-for: []
125125
ignore:
126126
sha: []
127-
mode: ContinuousDelivery
127+
mode: ContinuousDeployment
128128
label: '{BranchName}'
129129
increment: Inherit
130130
prevent-increment-of-merged-branch-version: false

src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using GitVersion.Extensions;
55
using GitVersion.Helpers;
66
using GitVersion.Logging;
7+
using GitVersion.VersionCalculation;
78
using Microsoft.Extensions.DependencyInjection;
89
using Microsoft.Extensions.Options;
910

@@ -33,21 +34,26 @@ public void Setup()
3334
[Test]
3435
public void OverwritesDefaultsWithProvidedConfig()
3536
{
36-
var defaultConfig = this.configurationProvider.ProvideForDirectory(this.repoPath);
37+
var defaultConfiguration = this.configurationProvider.ProvideForDirectory(this.repoPath);
3738
const string text = @"
3839
next-version: 2.0.0
3940
branches:
4041
develop:
41-
mode: ContinuousDeployment
42+
increment: Major
43+
mode: ContinuousDelivery
4244
label: dev";
4345
SetupConfigFileContent(text);
4446
var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath);
4547

4648
configuration.NextVersion.ShouldBe("2.0.0");
4749
configuration.Branches.ShouldNotBeNull();
48-
configuration.Branches["develop"].Increment.ShouldBe(defaultConfig.Branches["develop"].Increment);
49-
configuration.Branches["develop"].VersioningMode.ShouldBe(defaultConfig.Branches["develop"].VersioningMode);
50-
configuration.Branches["develop"].Label.ShouldBe("dev");
50+
51+
var developConfiguration = configuration.Branches["develop"];
52+
developConfiguration.Increment.ShouldBe(IncrementStrategy.Major);
53+
developConfiguration.Increment.ShouldNotBe(defaultConfiguration.Branches["develop"].Increment);
54+
developConfiguration.VersioningMode.ShouldBe(VersioningMode.ContinuousDelivery);
55+
developConfiguration.VersioningMode.ShouldNotBe(defaultConfiguration.Branches["develop"].VersioningMode);
56+
developConfiguration.Label.ShouldBe("dev");
5157
}
5258

5359
[Test]

src/GitVersion.Core.Tests/Core/DynamicRepositoryTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public void Cleanup()
4848

4949
// Note: use same name twice to see if changing commits works on same (cached) repository
5050
[NonParallelizable]
51-
[TestCase("GV_main", "https://github.com/GitTools/GitVersion", MainBranch, "efddf2f92c539a9c27f1904d952dcab8fb955f0e", "5.8.2+56")]
52-
[TestCase("GV_main", "https://github.com/GitTools/GitVersion", MainBranch, "2dc142a4a4df77db61a00d9fb7510b18b3c2c85a", "5.8.2+47")]
51+
[TestCase("GV_main", "https://github.com/GitTools/GitVersion", MainBranch, "efddf2f92c539a9c27f1904d952dcab8fb955f0e", "5.8.2-56")]
52+
[TestCase("GV_main", "https://github.com/GitTools/GitVersion", MainBranch, "2dc142a4a4df77db61a00d9fb7510b18b3c2c85a", "5.8.2-47")]
5353
public void FindsVersionInDynamicRepo(string name, string url, string targetBranch, string commitId, string expectedFullSemVer)
5454
{
5555
var root = PathHelper.Combine(this.workDirectory, name);

0 commit comments

Comments
 (0)