|
111 | 111 | $skippedTestsForService.ForEach{ |
112 | 112 | $notConnectedService = ($_).Service.Where{ $_ -notin $ConnectedService } |
113 | 113 | # Mark the test as skipped. |
| 114 | + Write-PSFMessage -Message ('Test {0} is skipped because no service connection was found' -f $_.TestId) -Level Verbose |
114 | 115 | Add-ZtTestResultDetail -SkippedBecause NotConnectedToService -TestId $_.TestId -NotConnectedService $notConnectedService |
115 | 116 | } |
116 | 117 |
|
117 | 118 | $testsToRun = $testsToRun.Where{ $_.TestId -notin $skippedTestsForService.TestId } |
118 | 119 |
|
119 | | - # Separate Sync Tests (Compliance/ExchangeOnline/SharePointOnline) from Parallel Tests (because of DLL order to manage in runspaces & remoting into WPS) |
120 | | - # Tests that depend on SecurityCompliance remoting must run on the main thread regardless of pillar. |
121 | | - [int[]]$syncTestIds = $testsToRun.Where{ |
122 | | - $_.Pillar -contains 'Data' -or $_.Service -contains 'SecurityCompliance' |
123 | | - }.TestId |
124 | | - $syncTests = $testsToRun.Where{ $_.TestId -in $syncTestIds } |
125 | | - $parallelTests = $testsToRun.Where{ $_.TestId -notin $syncTestIds } |
| 120 | + # Separate Sync Tests (Compliance/ExchangeOnline/SharePointOnline/AIP) from Parallel Tests (because of DLL order to manage in runspaces & remoting into WPS) |
| 121 | + # Tests that depend on SecurityCompliance/ExchangeOnline/SharePointOnline/AIPService must run on the main thread |
| 122 | + # regardless of pillar: those services expose their cmdlets through dynamically-generated, connection-bound |
| 123 | + # proxy modules (Connect-IPPSSession / Connect-ExchangeOnline / Connect-SPOService / Connect-AipService) that only exist in the |
| 124 | + # main runspace where Connect-ZtAssessment ran. In a worker runspace those cmdlets are "not recognized", |
| 125 | + # so such tests would incorrectly skip (e.g. Get-SafeLinksPolicy, Get-OrganizationConfig, Get-SPOTenant). |
| 126 | + $mainThreadServices = 'SecurityCompliance', 'ExchangeOnline', 'SharePointOnline', 'AipService' |
| 127 | + |
| 128 | + $syncTests, $parallelTests = $testsToRun.Where({ |
| 129 | + $_.Pillar -contains 'Data' -or |
| 130 | + @($_.Service).Where({ $_ -in $mainThreadServices }) |
| 131 | + }, 'Split') |
126 | 132 |
|
127 | 133 | [dateTime] $startTime = [datetime]::Now |
128 | 134 | $workflow = $null |
|
0 commit comments