Skip to content

Commit 46ba3dd

Browse files
committed
Re-record tests
1 parent 409e5e4 commit 46ba3dd

File tree

42 files changed

+10693
-15280
lines changed

Some content is hidden

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

42 files changed

+10693
-15280
lines changed

src/Batch/Batch.Test/ScenarioTests/BatchApplicationPackageTests.ps1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ function Test-UploadApplicationPackage
2424
$context = New-Object Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext
2525

2626
$addAppPack = New-AzBatchApplicationPackage -ResourceGroupName $context.ResourceGroupName -AccountName $context.AccountName -ApplicationName $applicationName -ApplicationVersion $applicationVersion -format "zip" -ActivateOnly
27+
$subId = $context.Subscription
28+
$resourceGroup = $context.ResourceGroupName
29+
$batchAccountName = $context.AccountName
2730

28-
Assert-AreEqual $applicationName $addAppPack.Id
29-
Assert-AreEqual $applicationVersion $addAppPack.Version
31+
Assert-AreEqual "/subscriptions/$subId/resourceGroups/$resourceGroup/providers/Microsoft.Batch/batchAccounts/$batchAccountName/applications/$applicationName/versions/$applicationVersion" $addAppPack.Id
32+
Assert-AreEqual $applicationVersion $addAppPack.Name
3033
}
3134

3235
<#
@@ -71,7 +74,7 @@ function Test-CreatePoolWithApplicationPackage
7174
Assert-AreEqual $applicationVersion $addAppPack.Name
7275

7376
$apr1 = New-Object Microsoft.Azure.Commands.Batch.Models.PSApplicationPackageReference
74-
$apr1.ApplicationName = $applicationName
77+
$apr1.ApplicationId = $applicationName
7578
$apr1.Version = $applicationVersion
7679
$apr = [Microsoft.Azure.Commands.Batch.Models.PSApplicationPackageReference[]]$apr1
7780

@@ -108,7 +111,7 @@ function Test-UpdatePoolWithApplicationPackage
108111

109112
# update pool with application package references
110113
$apr1 = New-Object Microsoft.Azure.Commands.Batch.Models.PSApplicationPackageReference
111-
$apr1.ApplicationName = $applicationName
114+
$apr1.ApplicationId = $applicationName
112115
$apr1.Version = $applicationVersion
113116
$apr = [Microsoft.Azure.Commands.Batch.Models.PSApplicationPackageReference[]]$apr1
114117

src/Batch/Batch.Test/ScenarioTests/BatchController.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ namespace Microsoft.Azure.Commands.Batch.Test.ScenarioTests
3030
{
3131
public class BatchController
3232
{
33-
internal static string BatchAccount, BatchAccountKey, BatchAccountUrl, BatchResourceGroup;
33+
internal static string BatchAccount;
34+
internal static string BatchAccountKey;
35+
internal static string BatchAccountUrl;
36+
internal static string BatchResourceGroup;
37+
internal static string Subscription;
3438

3539
private readonly EnvironmentSetupHelper _helper;
3640

@@ -154,8 +158,10 @@ private BatchManagementClient GetBatchManagementClient(MockContext context)
154158
BatchResourceGroup = HttpMockServer.Variables[ScenarioTestHelpers.BatchAccountResourceGroup];
155159
}
156160
}
161+
var result = context.GetServiceClient<BatchManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
162+
Subscription = result.SubscriptionId;
157163

158-
return context.GetServiceClient<BatchManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
164+
return result;
159165
}
160166
}
161167
}

src/Batch/Batch.Test/ScenarioTests/ScenarioTestContext.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public ScenarioTestContext() : base(null)
2828
this.PrimaryAccountKey = BatchController.BatchAccountKey;
2929
this.TaskTenantUrl = BatchController.BatchAccountUrl;
3030
this.ResourceGroupName = BatchController.BatchResourceGroup;
31+
this.Subscription = BatchController.Subscription;
3132
}
3233

3334
protected override BatchServiceClient CreateBatchRestClient(string url, ServiceClientCredentials credentials, DelegatingHandler handler = default(DelegatingHandler))

src/Batch/Batch.Test/ScenarioTests/TaskTests.ps1

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,7 @@ function Test-CreateTaskCollection
100100
$file = New-AzBatchResourceFile -HttpUrl "https://testacct.blob.core.windows.net/" -FilePath "file1"
101101
$resourceFiles.Add($file)
102102

103-
$envSettings = New-Object System.Collections.Generic.List``1[Microsoft.Azure.Commands.Batch.Models.PSEnvironmentSetting]
104-
$env1 = New-Object Microsoft.Azure.Commands.Batch.Models.PSEnvironmentSetting("env1", "value1")
105-
$env2 = New-Object Microsoft.Azure.Commands.Batch.Models.PSEnvironmentSetting("env2", "value2")
106-
$envSettings.Add($env1)
107-
$envSettings.Add($env2)
108-
103+
$envSettings = @{ env1 = "value1"; env2 = "value2" }
109104
$numInstances = 3
110105
$multiInstanceSettings = New-Object Microsoft.Azure.Commands.Batch.Models.PSMultiInstanceSettings -ArgumentList @("cmd /c echo coordinating", $numInstances)
111106
$coordinationCommandLine = $multiInstanceSettings.CoordinationCommandLine

src/Batch/Batch.Test/SessionRecords/Microsoft.Azure.Commands.Batch.Test.ScenarioTests.BatchAccountTests/TestBatchAccountEndToEnd.json

Lines changed: 637 additions & 616 deletions
Large diffs are not rendered by default.

src/Batch/Batch.Test/SessionRecords/Microsoft.Azure.Commands.Batch.Test.ScenarioTests.BatchAccountTests/TestListNodeAgentSkus.json

Lines changed: 22 additions & 22 deletions
Large diffs are not rendered by default.

src/Batch/Batch.Test/SessionRecords/Microsoft.Azure.Commands.Batch.Test.ScenarioTests.BatchApplicationPackageTests/TestCreatePoolWithApplicationPackage.json

Lines changed: 202 additions & 184 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)