Skip to content

Commit 4c52728

Browse files
committed
add test
1 parent 587c379 commit 4c52728

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

dsc/tests/dsc_tracing.tests.ps1

+12
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,16 @@ Describe 'tracing tests' {
8585
$out = (dsc -l $level config get -d $configYaml 2> $null) | ConvertFrom-Json
8686
$out.results[0].result.actualState.level | Should -BeExactly $level
8787
}
88+
89+
It 'Pass-through tracing should only emit JSON for child processes' {
90+
$logPath = "$TestDrive/dsc_trace.log"
91+
$out = dsc -l info -f pass-through config get -p ../examples/groups.dsc.yaml 2> $logPath
92+
foreach ($line in (Get-Content $logPath)) {
93+
$line | Should -Not -BeNullOrEmpty
94+
$json = $line | ConvertFrom-Json
95+
$json.timestamp | Should -Not -BeNullOrEmpty
96+
$json.level | Should -BeIn 'ERROR', 'WARN', 'INFO', 'DEBUG', 'TRACE'
97+
}
98+
$out | Should -BeNullOrEmpty
99+
}
88100
}

0 commit comments

Comments
 (0)