Skip to content

Commit a9c3f4e

Browse files
Add performance test using linear commit history and 500 commits
1 parent 015a957 commit a9c3f4e

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using GitVersion.Configuration;
2+
using GitVersion.Core.Tests.Helpers;
3+
4+
namespace GitVersion.Core.Tests.IntegrationTests;
5+
6+
public class PerformanceScenarios : TestBase
7+
{
8+
[Test]
9+
public void RepositoryWithALotOfTags()
10+
{
11+
var configuration = GitFlowConfigurationBuilder.New.Build();
12+
13+
using var fixture = new EmptyRepositoryFixture();
14+
15+
const int maxCommits = 500;
16+
for (int i = 0; i < maxCommits; i++)
17+
{
18+
fixture.MakeATaggedCommit($"1.0.{i}");
19+
}
20+
21+
fixture.BranchTo("feature");
22+
fixture.MakeACommit();
23+
24+
var sw = Stopwatch.StartNew();
25+
26+
fixture.AssertFullSemver($"1.0.{maxCommits}-feature.1+1", configuration);
27+
sw.ElapsedMilliseconds.ShouldBeLessThan(5000);
28+
}
29+
}

0 commit comments

Comments
 (0)