-
Notifications
You must be signed in to change notification settings - Fork 652
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3585 from AntonMTolmachev/cache-tags-in-increment…
…-strategy-finder Improve performance on repositories with a lot of tags
- Loading branch information
Showing
2 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/GitVersion.Core.Tests/IntegrationTests/PerformanceScenarios.cs
This file contains 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,29 @@ | ||
using GitVersion.Configuration; | ||
using GitVersion.Core.Tests.Helpers; | ||
|
||
namespace GitVersion.Core.Tests.IntegrationTests; | ||
|
||
public class PerformanceScenarios : TestBase | ||
{ | ||
[Test] | ||
public void RepositoryWithALotOfTags() | ||
{ | ||
var configuration = GitFlowConfigurationBuilder.New.Build(); | ||
|
||
using var fixture = new EmptyRepositoryFixture(); | ||
|
||
const int maxCommits = 500; | ||
for (int i = 0; i < maxCommits; i++) | ||
{ | ||
fixture.MakeATaggedCommit($"1.0.{i}"); | ||
} | ||
|
||
fixture.BranchTo("feature"); | ||
fixture.MakeACommit(); | ||
|
||
var sw = Stopwatch.StartNew(); | ||
|
||
fixture.AssertFullSemver($"1.0.{maxCommits}-feature.1+1", configuration); | ||
sw.ElapsedMilliseconds.ShouldBeLessThan(5000); | ||
} | ||
} |
This file contains 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