Skip to content

Commit 27505b6

Browse files
committed
running/saving scenario test runs
1 parent a3fc9e7 commit 27505b6

24 files changed

+695890
-18205
lines changed

src/Resources/Resources.Test/ScenarioTests/DeploymentStackTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ public void TestNewResourceGroupDeploymentStackDenySettings()
5656
[Trait(Category.AcceptanceType, Category.CheckIn)]
5757
public void TestSetResourceGroupDeploymentStack()
5858
{
59-
TestRunner.RunTestScript("Test-NewResourceGroupDeploymentStack");
59+
TestRunner.RunTestScript("Test-SetResourceGroupDeploymentStack");
6060
}
6161

6262
[Fact()]
6363
[Trait(Category.AcceptanceType, Category.CheckIn)]
6464
public void TestSetResourceGroupDeploymentStackUnmanageActions()
6565
{
66-
TestRunner.RunTestScript("Test-NewResourceGroupDeploymentStackUnmanageActions");
66+
TestRunner.RunTestScript("Test-SetResourceGroupDeploymentStackUnmanageActions");
6767
}
6868

6969
[Fact()]
@@ -133,14 +133,14 @@ public void TestNewSubscriptionDeploymentStackDenySettings()
133133
[Trait(Category.AcceptanceType, Category.CheckIn)]
134134
public void TestSetSubscriptionDeploymentStack()
135135
{
136-
TestRunner.RunTestScript("Test-NewSubscriptionDeploymentStack");
136+
TestRunner.RunTestScript("Test-SetSubscriptionDeploymentStack");
137137
}
138138

139139
[Fact()]
140140
[Trait(Category.AcceptanceType, Category.CheckIn)]
141141
public void TestSetSubscriptionDeploymentStackUnmanageActions()
142142
{
143-
TestRunner.RunTestScript("Test-NewSubscriptionDeploymentStackUnmanageActions");
143+
TestRunner.RunTestScript("Test-SetSubscriptionDeploymentStackUnmanageActions");
144144
}
145145

146146
[Fact()]
@@ -152,9 +152,9 @@ public void TestSetSubscriptionDeploymentStackDenySettings()
152152

153153
[Fact()]
154154
[Trait(Category.AcceptanceType, Category.CheckIn)]
155-
public void TestNewAndSetSubscriptionDeploymentStackWithTemplateSpec()
155+
public void TestNewAndSetAndExportSubscriptionDeploymentStackWithTemplateSpec()
156156
{
157-
TestRunner.RunTestScript("Test-NewAndSetSubscriptionDeploymentStackWithTemplateSpec");
157+
TestRunner.RunTestScript("Test-NewAndSetAndExportSubscriptionDeploymentStackWithTemplateSpec");
158158
}
159159

160160
[Fact()]

src/Resources/Resources.Test/ScenarioTests/DeploymentStackTests.ps1

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ function Test-SetResourceGroupDeploymentStack
228228

229229
# Test - Failure - template file not found
230230
$missingFile = "missingFile142.json"
231-
$exceptionMessage = "The provided file '$missingFile' doesn't exist"
231+
$exceptionMessage = "The provided file $missingFile doesn't exist"
232232
Assert-Throws { Set-AzResourceGroupDeploymentStack -Name $rname -Description "A Stack" -ResourceGroup $rgname -TemplateFile $missingFile -Force } $exceptionMessage
233233

234234
# Test - Failure - RG does not exist
@@ -245,7 +245,7 @@ function Test-SetResourceGroupDeploymentStack
245245
# Test - Failure - template parameter file not found
246246
$missingFile = "missingFile145.json"
247247
# TODO: File does not exist error messages should be the same.
248-
$exceptionMessage = "The provided file '$missingFile' doesn't exist"
248+
$exceptionMessage = "The provided file $missingFile doesn't exist"
249249
$partialExceptionMessage = "does not exist"
250250
Assert-ThrowsContains { Set-AzResourceGroupDeploymentStack -Name $rname -Description "A Stack" -ResourceGroup $rgname -TemplateFile StacksRGTemplate.json -TemplateParameterFile $missingFile -Force } $partialExceptionMessage
251251

@@ -353,11 +353,11 @@ function Test-NewAndSetResourceGroupDeploymentStackWithBicep
353353
New-AzResourceGroup -Name $rgname -Location $rglocation
354354

355355
# Test - NewByNameAndResourceGroupAndBicepTemplateFile
356-
$deployment = New-AzResourceGroupDeploymentStack -Name $rname -ResourceGroupName $rgname -TemplateFile sampleDeploymentBicepFile.bicep
356+
$deployment = New-AzResourceGroupDeploymentStack -Name $rname -ResourceGroupName $rgname -TemplateFile StacksRGTemplate.bicep -TemplateParameterFile StacksRGTemplateParams.json
357357
Assert-AreEqual "succeeded" $deployment.ProvisioningState
358358

359359
# Test - Set-AzResourceGroupDeploymentStacks
360-
$deployment = Set-AzResourceGroupDeploymentStack -Name $rname -ResourceGroupName $rgname -TemplateFile sampleDeploymentBicepFile2.bicep
360+
$deployment = Set-AzResourceGroupDeploymentStack -Name $rname -ResourceGroupName $rgname -TemplateFile StacksRGTemplate.bicep -TemplateParameterFile StacksRGTemplateParams.json
361361
Assert-AreEqual "succeeded" $deployment.ProvisioningState
362362
}
363363

@@ -629,7 +629,7 @@ function Test-NewSubscriptionDeploymentStack
629629
# --- ParameterObjectTemplateFileParameterSetName ---
630630

631631
# Test - Success
632-
$deployment = New-AzSubscriptionDeploymentStack -Name $rname -Description "A Stack" -TemplateFile StacksSubTemplate.json -TemplateParameterObject @{location = $location} -Location $location -Force
632+
$deployment = New-AzSubscriptionDeploymentStack -Name $rname -Description "A Stack" -TemplateFile StacksSubTemplate.json -TemplateParameterObject @{location = "westus"} -Location $location -Force
633633
Assert-AreEqual "succeeded" $deployment.ProvisioningState
634634
}
635635

@@ -713,7 +713,7 @@ function Test-NewSubscriptionDeploymentStackDenySettings
713713
.SYNOPSIS
714714
Tests SET operation on deployment stacks at the Sub scope.
715715
#>
716-
function Test-SetResourceGroupDeploymentStack
716+
function Test-SetSubscriptionDeploymentStack
717717
{
718718
# Setup
719719
$rname = Get-ResourceName
@@ -730,7 +730,7 @@ function Test-SetResourceGroupDeploymentStack
730730

731731
# Test - Failure - template file not found
732732
$missingFile = "missingFile142.json"
733-
$exceptionMessage = "The provided file '$missingFile' doesn't exist"
733+
$exceptionMessage = "The provided file $missingFile doesn't exist"
734734
Assert-Throws { Set-AzSubscriptionDeploymentStack -Name $rname -Description "A Stack" -TemplateFile $missingFile -Location $location -Force } $exceptionMessage
735735

736736
# --- ParameterFileTemplateFileParameterSetName ---
@@ -742,14 +742,14 @@ function Test-SetResourceGroupDeploymentStack
742742
# Test - Failure - template parameter file not found
743743
$missingFile = "missingFile145.json"
744744
# TODO: Figure out if these two error messages should be the same.
745-
$exceptionMessage = "The provided file '$missingFile' doesn't exist"
745+
$exceptionMessage = "The provided file $missingFile doesn't exist"
746746
$partialExceptionMessage = "does not exist"
747747
Assert-ThrowsContains { Set-AzSubscriptionDeploymentStack -Name $rname -Description "A Stack" -TemplateFile StacksSubTemplate.json -TemplateParameterFile $missingFile -Location $location -Force } $partialExceptionMessage
748748

749749
# --- ParameterObjectTemplateFileParameterSetName ---
750750

751751
# Test - Success
752-
$deployment = Set-AzSubscriptionDeploymentStack -Name $rname -Description "A Stack" -TemplateFile StacksSubTemplate.json -TemplateParameterObject @{location = $location} -Force
752+
$deployment = Set-AzSubscriptionDeploymentStack -Name $rname -Description "A Stack" -TemplateFile StacksSubTemplate.json -Location $location -TemplateParameterObject @{location = "westus"} -Force
753753
Assert-AreEqual "succeeded" $deployment.ProvisioningState
754754
}
755755

@@ -837,15 +837,16 @@ function Test-NewAndSetSubscriptionDeploymentStackWithBicep
837837
{
838838
# Setup
839839
$rname = Get-ResourceName
840+
$location = "West US 2"
840841

841842
try
842843
{
843844
# Test - NewByNameAndResourceGroupAndBicepTemplateFile
844-
$deployment = New-AzSubscriptionDeploymentStack -Name $rname -TemplateFile sampleDeploymentBicepFile.bicep
845+
$deployment = New-AzSubscriptionDeploymentStack -Name $rname -TemplateFile StacksSubTemplate.bicep -TemplateParameterFile StacksSubTemplateParams.json -Location $location
845846
Assert-AreEqual "succeeded" $deployment.ProvisioningState
846847

847848
# Test - Set-AzSubscriptionDeploymentStacks
848-
$deployment = Set-AzSubscriptionDeploymentStack -Name $rname -TemplateFile sampleDeploymentBicepFile2.bicep
849+
$deployment = Set-AzSubscriptionDeploymentStack -Name $rname -TemplateFile StacksSubTemplate2.bicep -TemplateParameterFile StacksSubTemplateParams.json -Location $location
849850
Assert-AreEqual "succeeded" $deployment.ProvisioningState
850851
}
851852

0 commit comments

Comments
 (0)