Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions .github/actions/enumerate-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ inputs:
required: false
type: boolean
default: false
integrationsProjectsFilter:
description: 'JSON array of specific integration test project paths to run. Empty array or not provided means run all.'
required: false
type: string
default: '[]'
includeDeployment:
required: false
type: boolean
Expand Down Expand Up @@ -92,9 +97,33 @@ runs:
shell: pwsh
run: |
$filePath = "${{ github.workspace }}/artifacts/TestsForGithubActions.list"
$lines = Get-Content $filePath
$lines = @(Get-Content $filePath)

# Filter to specific projects if provided
$projectsFilter = '${{ inputs.integrationsProjectsFilter }}'
if ($projectsFilter -and $projectsFilter -ne '' -and $projectsFilter -ne '[]') {
$projects = $projectsFilter | ConvertFrom-Json

# Convert project paths to shortnames
# e.g., "tests/Aspire.Milvus.Client.Tests/" -> "Milvus.Client"
$allowedShortnames = @()
foreach ($project in $projects) {
# Extract directory name from path (handle trailing slash)
$dirName = ($project -replace '/$', '') -split '/' | Select-Object -Last 1
# Convert to shortname: Aspire.Milvus.Client.Tests -> Milvus.Client
$shortname = $dirName -replace '^Aspire\.', '' -replace '\.Tests$', ''
$allowedShortnames += $shortname
}

if ($allowedShortnames.Count -gt 0) {
Write-Host "Filtering integration tests to: $($allowedShortnames -join ', ')"
$lines = @($lines | Where-Object { $_ -in $allowedShortnames })
Write-Host "Filtered to $($lines.Count) test(s)"
}
}

$jsonObject = @{
"shortname" = $lines | Sort-Object
"shortname" = @($lines | Sort-Object)
}
$jsonString = ConvertTo-Json $jsonObject -Compress
"integrations_tests_matrix=$jsonString"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- 'release/**'
- 'conditional-test-runs-with-msbuild' # temporary - for validating test scope detection

push:
branches:
Expand Down
Loading
Loading