Skip to content

Commit 0e597ff

Browse files
committed
Enhance verbose logging in policy integration test case retrieval
1 parent 2e1f110 commit 0e597ff

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

scripts/pipelines/policy-integration-tests/pipeline-map-policy-integration-test-cases.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,11 @@ function getTestCasesFromAssignment {
159159
[string]$policyIntegrationTestsPath
160160
)
161161
$testsInScope = @()
162-
$testCases = Get-ChildItem -path $policyIntegrationTestsPath -Depth 1 -Directory
162+
Write-Verbose " - Looking for test cases that are impacted by the policy assignment '$assignmentName' from '$policyIntegrationTestsPath'." -Verbose
163+
$testCases = Get-ChildItem -path $policyIntegrationTestsPath -Depth 0 -Directory
163164

164165
foreach ($testCase in $testCases) {
166+
Write-Verbose " - Checking test case '$($testCase.Name)' for assignment '$assignmentName'..." -Verbose
165167
$testConfigFile = join-Path -Path $testCase.FullName -ChildPath 'config.json' -Resolve
166168
$testConfig = Get-Content -Path $testConfigFile -Raw | ConvertFrom-Json -Depth 99
167169
$policyAssignmentIds = $testConfig.policyAssignmentIds
@@ -523,7 +525,6 @@ Foreach ($file in $modifiedFiles) {
523525
Write-Verbose " - File '$file' is not in the global test paths. Will Check if individual tests need to be executed." -Verbose
524526
$getRequiredTestCasesParams = @{
525527
changeFilePath = $file
526-
policyIntegrationTestsPath = $policyIntegrationTestsPath
527528
policyInitiativesPath = $policyInitiativesPath
528529
policyAssignmentsPath = $policyAssignmentsPath
529530
gitRoot = $gitRoot

0 commit comments

Comments
 (0)