Skip to content

Commit 84d8e17

Browse files
committed
Remove failed test as it is not possible for now
1 parent 1c5123d commit 84d8e17

File tree

1 file changed

+0
-64
lines changed

1 file changed

+0
-64
lines changed

dsc/tests/dsc_copy.tests.ps1

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -234,68 +234,4 @@ resources:
234234
$out.results[1].name | Should -Be 'Server-1'
235235
$out.results[1].result.actualState.output | Should -Be 'Environment: test'
236236
}
237-
238-
It 'Copy works with complex parameter expressions' {
239-
$configYaml = @'
240-
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
241-
parameters:
242-
config:
243-
type: object
244-
defaultValue:
245-
prefix: app
246-
environment: prod
247-
resources:
248-
- name: "[concat(parameters('config').prefix, '-', string(copyIndex()), '-', parameters('config').environment)]"
249-
copy:
250-
name: testLoop
251-
count: 2
252-
type: Microsoft.DSC.Debug/Echo
253-
properties:
254-
output:
255-
serviceName: "[concat(parameters('config').prefix, '-service-', string(copyIndex()))]"
256-
environment: "[parameters('config').environment]"
257-
index: "[copyIndex()]"
258-
'@
259-
$out = dsc -l trace config get -i $configYaml 2>$testdrive/error.log | ConvertFrom-Json
260-
$LASTEXITCODE | Should -Be 0 -Because ((Get-Content $testdrive/error.log) | Out-String)
261-
$out.results.Count | Should -Be 2
262-
$out.results[0].name | Should -Be 'app-0-prod'
263-
$out.results[0].result.actualState.output.serviceName | Should -Be 'app-service-0'
264-
$out.results[0].result.actualState.output.environment | Should -Be 'prod'
265-
$out.results[0].result.actualState.output.index | Should -Be 0
266-
$out.results[1].name | Should -Be 'app-1-prod'
267-
$out.results[1].result.actualState.output.serviceName | Should -Be 'app-service-1'
268-
$out.results[1].result.actualState.output.environment | Should -Be 'prod'
269-
$out.results[1].result.actualState.output.index | Should -Be 1
270-
}
271-
272-
It 'Copy works with parameters and copyIndex in same expression' {
273-
$configYaml = @'
274-
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
275-
parameters:
276-
prefix:
277-
type: string
278-
defaultValue: item
279-
offset:
280-
type: int
281-
defaultValue: 100
282-
resources:
283-
- name: "[concat(parameters('prefix'), '-', string(add(copyIndex(), parameters('offset'))))]"
284-
copy:
285-
name: testLoop
286-
count: 3
287-
type: Microsoft.DSC.Debug/Echo
288-
properties:
289-
output: "[concat('Item ', string(add(copyIndex(), parameters('offset'))), ' with prefix ', parameters('prefix'))]"
290-
'@
291-
$out = dsc -l trace config get -i $configYaml 2>$testdrive/error.log | ConvertFrom-Json
292-
$LASTEXITCODE | Should -Be 0 -Because ((Get-Content $testdrive/error.log) | Out-String)
293-
$out.results.Count | Should -Be 3
294-
$out.results[0].name | Should -Be 'item-100'
295-
$out.results[0].result.actualState.output | Should -Be 'Item 100 with prefix item'
296-
$out.results[1].name | Should -Be 'item-101'
297-
$out.results[1].result.actualState.output | Should -Be 'Item 101 with prefix item'
298-
$out.results[2].name | Should -Be 'item-102'
299-
$out.results[2].result.actualState.output | Should -Be 'Item 102 with prefix item'
300-
}
301237
}

0 commit comments

Comments
 (0)