File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed
src/Common/Commands.ScenarioTest/Resources/ServiceManagement Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -89,3 +89,35 @@ function Cleanup-Storage
89
89
}
90
90
}
91
91
92
+ <#
93
+ . SYNOPSIS
94
+ Gets test mode - 'Record' or 'Playback'
95
+ #>
96
+ function Get-ComputeTestMode
97
+ {
98
+ $oldErrorActionPreferenceValue = $ErrorActionPreference ;
99
+ $ErrorActionPreference = " SilentlyContinue" ;
100
+
101
+ try
102
+ {
103
+ $testMode = [Microsoft.Azure.Test.HttpRecorder.HttpMockServer ]::Mode;
104
+ $testMode = $testMode.ToString ();
105
+ }
106
+ catch
107
+ {
108
+ if (($Error.Count -gt 0 ) -and ($Error [0 ].Exception.Message -like ' *Unable to find type*' ))
109
+ {
110
+ $testMode = ' Record' ;
111
+ }
112
+ else
113
+ {
114
+ throw ;
115
+ }
116
+ }
117
+ finally
118
+ {
119
+ $ErrorActionPreference = $oldErrorActionPreferenceValue ;
120
+ }
121
+
122
+ return $testMode ;
123
+ }
Original file line number Diff line number Diff line change @@ -395,8 +395,17 @@ function Run-AutoGeneratedServiceExtensionCmdletTests
395
395
Assert-NotNull $st.RequestId ;
396
396
397
397
# New-AzureDeployment (in Azure.psd1)
398
- $cspkg = ' .\Resources\ServiceManagement\Files\OneWebOneWorker.cspkg' ;
398
+ $testMode = Get-ComputeTestMode ;
399
+ if ($testMode.ToLower () -ne ' playback' )
400
+ {
401
+ $cspkg = ' .\Resources\ServiceManagement\Files\OneWebOneWorker.cspkg' ;
402
+ }
403
+ else
404
+ {
405
+ $cspkg = " https://${storageName} .blob.azure.windows.net/blob/OneWebOneWorker.cspkg" ;
406
+ }
399
407
$cscfg = ' .\Resources\ServiceManagement\Files\OneWebOneWorker.cscfg' ;
408
+
400
409
$st = New-AzureDeployment - ServiceName $svcName - Package $cspkg - Configuration $cscfg - Label $svcName - Slot Production;
401
410
402
411
$deployment = Get-AzureDeployment - ServiceName $svcName - Slot Production;
You can’t perform that action at this time.
0 commit comments