You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On branch master: add inner template test case for Outputs-Must-Be-Present-In-Template-Parameters (#535)
* On branch master: add unittest case for inner template built by bicep.
Signed-off-by: galiacheng <[email protected]>
Changes to be committed:
modified: arm-ttk/Test-AzTemplate.ps1
modified: arm-ttk/testcases/CreateUIDefinition/Outputs-Must-Be-Present-In-Template-Parameters.test.ps1
new file: unit-tests/Outputs-Must-Be-Present-In-Template-Parameters/Pass/InnerTemplate/azuredeploy.json
new file: unit-tests/Outputs-Must-Be-Present-In-Template-Parameters/Pass/InnerTemplate/createUiDefinition.json
* On branch master: do not output the object info
Signed-off-by: galiacheng <[email protected]>
Changes to be committed:
modified: arm-ttk/Test-AzTemplate.ps1
Copy file name to clipboardexpand all lines: arm-ttk/testcases/CreateUIDefinition/Outputs-Must-Be-Present-In-Template-Parameters.test.ps1
+8-2
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
<#
1
+
<#
2
2
.Synopsis
3
3
Ensures that .outputs are present in the .parameters of CreateUIDefinition.json
4
4
.Description
@@ -35,7 +35,13 @@ foreach ($output in $parameterInfo.outputs.psobject.properties) { # Then walk th
35
35
$outputName-eq'managedresourcegroupid') { # If the output was one of the outputs used for Managed Apps and only found in the generated template, skip the test
36
36
continue
37
37
}
38
-
# If the output name was not declared in the TemplateObject,
38
+
39
+
# If the TemplateObject is inner template of MainTemplate, skip the test
40
+
if ($TemplateObject.IsInnerTemplate){
41
+
continue
42
+
}
43
+
44
+
# If the output name was not declared in the TemplateObject
39
45
if (-not$TemplateObject.parameters.$outputName) {
40
46
# write an error
41
47
Write-Error"output $outputName does not exist in template.parameters"-ErrorId CreateUIDefinition.Output.Missing.From.MainTemplate -TargetObject $parameterInfo.outputs
0 commit comments