diff --git a/src/GitVersion.App.Tests/TagCheckoutInBuildAgentTests.cs b/src/GitVersion.App.Tests/TagCheckoutInBuildAgentTests.cs index 6a1dbb9fca..ba9e2c6ace 100644 --- a/src/GitVersion.App.Tests/TagCheckoutInBuildAgentTests.cs +++ b/src/GitVersion.App.Tests/TagCheckoutInBuildAgentTests.cs @@ -14,6 +14,18 @@ namespace GitVersion.App.Tests [TestFixture] public class TagCheckoutInBuildAgentTests { + [Test] + public async Task VerifyTagCheckoutOnAzurePipelines() + { + var env = new Dictionary + { + { AzurePipelines.EnvironmentVariableName, "true" }, + { "BUILD_SOURCEBRANCH", "refs/tags/0.2.0" }, + }; + + await VerifyTagCheckoutVersionIsCalculatedProperly(env); + } + [Test] public async Task VerifyTagCheckoutOnGitHubActions() { @@ -23,6 +35,11 @@ public async Task VerifyTagCheckoutOnGitHubActions() { "GITHUB_REF", "ref/tags/0.2.0" }, }; + await VerifyTagCheckoutVersionIsCalculatedProperly(env); + } + + private static async Task VerifyTagCheckoutVersionIsCalculatedProperly(Dictionary env) + { using var fixture = new EmptyRepositoryFixture(); var remoteRepositoryPath = PathHelper.GetTempPath(); RepositoryFixtureBase.Init(remoteRepositoryPath);