зеркало из https://github.com/Azure/vdc.git
Fix for file function with array added. (#136)
This commit is contained in:
Родитель
d66ef4a76e
Коммит
8e21dc67ec
|
@ -190,8 +190,8 @@ Class ConfigurationBuilder {
|
|||
|
||||
# Check for json objects before replacing it
|
||||
$isJson = `
|
||||
Test-Json `
|
||||
-Json $referencedFileContent `
|
||||
Test-JsonContent `
|
||||
-Content $referencedFileContent `
|
||||
-ErrorAction SilentlyContinue;
|
||||
|
||||
if(!$isJson) {
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"Subscriptions": "file(common/subscriptions.json)",
|
||||
"ToolkitComponents": "file(common/toolkit.json)",
|
||||
"ArchetypeOrchestration": "file(common/toolkit.json)",
|
||||
"ArchetypeParameters": "file(common/toolkit.json)",
|
||||
"Arrays": "file(./arrays.json)"
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
["demo1", "demo2"]
|
|
@ -55,4 +55,20 @@ Describe "Orchestration Instance Builder Unit Test Cases" {
|
|||
$archetypeInstance.Subscriptions | Should be $environmentValue;
|
||||
}
|
||||
}
|
||||
|
||||
Context "Build Archetype Instance using functions" {
|
||||
$ENV:FROMENVIRONMENTVARIABLE = "My value";
|
||||
$ENV:FROMANOTHERENVIRONMENTVARIABLE = "bar";
|
||||
It "Should build the archetype instance from definition file with file function" {
|
||||
$archetypeDefinitionFileAbsolutePath = Join-Path $rootPath -ChildPath ".." -AdditionalChildPath @("Tests", "Samples", "nested-file-functions", "paas", "archetype-definition-array-filefn.json");
|
||||
$ConfigurationBuilder = New-Object ConfigurationBuilder("shared-services", $archetypeDefinitionFileAbsolutePath);
|
||||
$archetypeInstance = $ConfigurationBuilder.BuildConfigurationInstance(${function:\Add-SubscriptionAndTenantIds});
|
||||
$archetypeInstance.Subscriptions | Should BeOfType [object];
|
||||
$archetypeInstance.Subscriptions.Toolkit.nested.fromEnvironmentVariable| Should Be "My value";
|
||||
$archetypeInstance.Subscriptions.Toolkit.nested.concatEnvironmentVariables | Should Be "My value-bar";
|
||||
$archetypeInstance.ToolkitComponents | Should BeOfType [object];
|
||||
$archetypeInstance.ArchetypeParameters | Should BeOfType [object];
|
||||
$archetypeInstance.ArchetypeOrchestration | Should BeOfType [object];
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче