@@ -119,10 +119,22 @@ jobs:
119
119
120
120
$allTestFolders = @($testsPath) + (Find-TestDirectories -Path $testsPath)
121
121
122
+ $skipTests = $env:PSMODULE_GET_TESTSUITES_INPUT_SkipTests -Split ",|\s+" | ForEach-Object { $_.Trim() }
123
+
124
+ Write-Host "The following tests will be skipped:"
125
+ $skipTests | ForEach-Object { " - $_ " }
126
+
122
127
$testSuites = foreach ($folder in $allTestFolders) {
123
128
$testItems = Get-TestItemsFromFolder -FolderPath $folder
124
129
foreach ($item in $testItems) {
125
130
foreach ($osConfig in $osConfigs) {
131
+ if ($skipTests -contains 'All' -or
132
+ $skipTests -contains $osConfig.OSName -or
133
+ ($skipTests -contains 'Module' -and $item.Name -match '\.Tests\.ps1$') -or
134
+ ($skipTests -contains 'SourceCode' -and $item.Name -match '\.(Configuration|Container)\.ps1$')) {
135
+ continue
136
+ }
137
+
126
138
[pscustomobject]@{
127
139
RunsOn = $osConfig.RunsOn
128
140
OSName = $osConfig.OSName
@@ -133,8 +145,10 @@ jobs:
133
145
}
134
146
}
135
147
136
- # Create separate outputs for source code tests (OS only) and module tests (existing detailed output)
137
- $sourceCodeTestSuites = $osConfigs | Select-Object -Property RunsOn, OSName -Unique
148
+ # Adjust source code test suites based on SkipTests
149
+ $sourceCodeTestSuites = $osConfigs | Where-Object {
150
+ -not ($skipTests -contains 'All' -or $skipTests -contains $_.OSName -or $skipTests -contains 'SourceCode')
151
+ } | Select-Object -Property RunsOn, OSName -Unique
138
152
139
153
# Display the generated matrices for verification.
140
154
Write-Host "Source Code Test Suites:"
0 commit comments