Skip to content
Merged
27 changes: 25 additions & 2 deletions src/Batch/Batch.Test/ScenarioTests/BatchApplicationPackageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public BatchApplicationPackageTests(Xunit.Abstractions.ITestOutputHelper output)

}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Fact(Skip = "Successful re-recording, but fails in playback. See issue https://github.com/Azure/azure-powershell/issues/7512")]
[Trait(Category.AcceptanceType, Category.LiveOnly)]
public void TestUploadApplicationPackage()
{
string id = "newApplicationPackage";
Expand All @@ -51,6 +51,29 @@ public void TestUploadApplicationPackage()
);
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestUploadApplicationPackageActivateOnly()
{
string id = "newApplicationPackage";

BatchAccountContext context = null;
TestRunner.RunTestScript(
null,
mockContext =>
{
context = new ScenarioTestContext();
ScenarioTestHelpers.CreateApplicationPackage(this, context, id, version, filePath);
},
() =>
{
ScenarioTestHelpers.DeleteApplicationPackage(this, context, id, version);
ScenarioTestHelpers.DeleteApplication(this, context, id);
},
$"Test-UploadApplicationPackageActivateOnly '{id}' '{version}' '{filePath}'"
);
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestUpdateApplicationPackage()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,26 @@ function Test-UploadApplicationPackage
# Setup
$context = New-Object Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext

$addAppPack = New-AzBatchApplicationPackage -ResourceGroupName $context.ResourceGroupName -AccountName $context.AccountName -ApplicationName $applicationName -ApplicationVersion $applicationVersion -format "zip" -FilePath $filePath
$subId = $context.Subscription
$resourceGroup = $context.ResourceGroupName
$batchAccountName = $context.AccountName

Assert-AreEqual "/subscriptions/$subId/resourceGroups/$resourceGroup/providers/Microsoft.Batch/batchAccounts/$batchAccountName/applications/$applicationName/versions/$applicationVersion" $addAppPack.Id
Assert-AreEqual $applicationVersion $addAppPack.Name
}

<#
.SYNOPSIS
Tests uploading an application package.
#>
function Test-UploadApplicationPackageActivateOnly
{
param([string] $applicationName, [string] $applicationVersion, [string]$filePath)

# Setup
$context = New-Object Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext

$addAppPack = New-AzBatchApplicationPackage -ResourceGroupName $context.ResourceGroupName -AccountName $context.AccountName -ApplicationName $applicationName -ApplicationVersion $applicationVersion -format "zip" -ActivateOnly
$subId = $context.Subscription
$resourceGroup = $context.ResourceGroupName
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Loading