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
27 changes: 27 additions & 0 deletions cli/azd/extensions/azure.ai.agents/ci-test.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
$gopath = go env GOPATH
$gotestsumBinary = "gotestsum"
if ($IsWindows) {
$gotestsumBinary += ".exe"
}
$gotestsum = Join-Path $gopath "bin" $gotestsumBinary

Write-Host "Running unit tests..."

if (Test-Path $gotestsum) {
# Use gotestsum for better output formatting and summary
& $gotestsum --format testname -- ./... -count=1
} else {
# Fallback to go test if gotestsum is not installed
Write-Host "gotestsum not found, using go test..." -ForegroundColor Yellow
go test ./... -v -count=1
}

if ($LASTEXITCODE -ne 0) {
Write-Host ""
Write-Host "Tests failed with exit code: $LASTEXITCODE" -ForegroundColor Red
exit $LASTEXITCODE
}

Write-Host ""
Write-Host "All tests passed!" -ForegroundColor Green
exit 0
1 change: 0 additions & 1 deletion eng/pipelines/release-ext-azure-ai-agents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ extends:
AzdExtensionId: azure.ai.agents
SanitizedExtensionId: azure-ai-agents
AzdExtensionDirectory: cli/azd/extensions/azure.ai.agents
SkipTests: true
1 change: 1 addition & 0 deletions eng/pipelines/templates/jobs/build-azd-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
pwsh: true
targetType: filePath
filePath: ${{ parameters.AzdExtensionDirectory }}/ci-test.ps1
workingDirectory: ${{ parameters.AzdExtensionDirectory }}

- task: PublishTestResults@2
inputs:
Expand Down
Loading