diff --git a/.github/workflows/dotnet-build-and-test.yml b/.github/workflows/dotnet-build-and-test.yml index 22047407a7..3bdb43dabf 100644 --- a/.github/workflows/dotnet-build-and-test.yml +++ b/.github/workflows/dotnet-build-and-test.yml @@ -59,20 +59,20 @@ jobs: if: steps.filter.outputs.dotnet != 'true' run: echo "NOT dotnet file" - dotnet-build-and-test: + # Build the full solution (including samples) on all TFMs. No tests. + dotnet-build: needs: paths-filter if: needs.paths-filter.outputs.dotnetChanges == 'true' strategy: fail-fast: false matrix: include: - - { targetFramework: "net10.0", os: "ubuntu-latest", configuration: Release, integration-tests: true, environment: "integration" } + - { targetFramework: "net10.0", os: "ubuntu-latest", configuration: Release } - { targetFramework: "net9.0", os: "windows-latest", configuration: Debug } - { targetFramework: "net8.0", os: "ubuntu-latest", configuration: Release } - - { targetFramework: "net472", os: "windows-latest", configuration: Release, integration-tests: true, environment: "integration" } + - { targetFramework: "net472", os: "windows-latest", configuration: Release } runs-on: ${{ matrix.os }} - environment: ${{ matrix.environment }} steps: - uses: actions/checkout@v6 with: @@ -84,16 +84,6 @@ jobs: python workflow-samples - # Start Cosmos DB Emulator for all integration tests and only for unit tests when CosmosDB changes happened) - - name: Start Azure Cosmos DB Emulator - if: ${{ runner.os == 'Windows' && (needs.paths-filter.outputs.cosmosDbChanges == 'true' || (github.event_name != 'pull_request' && matrix.integration-tests)) }} - shell: pwsh - run: | - Write-Host "Launching Azure Cosmos DB Emulator" - Import-Module "$env:ProgramFiles\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator" - Start-CosmosDbEmulator -NoUI -Key "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" - echo "COSMOSDB_EMULATOR_AVAILABLE=true" >> $env:GITHUB_ENV - - name: Setup dotnet uses: actions/setup-dotnet@v5.1.0 with: @@ -140,25 +130,98 @@ jobs: popd rm -rf "$TEMP_DIR" - - name: Run Unit Tests + # Build src+tests only (no samples) for a single TFM and run tests. + dotnet-test: + needs: paths-filter + if: needs.paths-filter.outputs.dotnetChanges == 'true' + strategy: + fail-fast: false + matrix: + include: + - { targetFramework: "net10.0", os: "ubuntu-latest", configuration: Release, integration-tests: true, environment: "integration" } + - { targetFramework: "net472", os: "windows-latest", configuration: Release, integration-tests: true, environment: "integration" } + + runs-on: ${{ matrix.os }} + environment: ${{ matrix.environment }} + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + sparse-checkout: | + . + .github + dotnet + python + workflow-samples + + # Start Cosmos DB Emulator for all integration tests and only for unit tests when CosmosDB changes happened) + - name: Start Azure Cosmos DB Emulator + if: ${{ runner.os == 'Windows' && (needs.paths-filter.outputs.cosmosDbChanges == 'true' || (github.event_name != 'pull_request' && matrix.integration-tests)) }} + shell: pwsh + run: | + Write-Host "Launching Azure Cosmos DB Emulator" + Import-Module "$env:ProgramFiles\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator" + Start-CosmosDbEmulator -NoUI -Key "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" + echo "COSMOSDB_EMULATOR_AVAILABLE=true" >> $env:GITHUB_ENV + + - name: Setup dotnet + uses: actions/setup-dotnet@v5.1.0 + with: + global-json-file: ${{ github.workspace }}/dotnet/global.json + + - name: Generate test solution (no samples) + shell: pwsh + run: | + ./dotnet/eng/scripts/New-FilteredSolution.ps1 ` + -Solution dotnet/agent-framework-dotnet.slnx ` + -TargetFramework ${{ matrix.targetFramework }} ` + -Configuration ${{ matrix.configuration }} ` + -ExcludeSamples ` + -OutputPath dotnet/filtered.slnx ` + -Verbose + + - name: Build src and tests shell: bash + run: dotnet build dotnet/filtered.slnx -c ${{ matrix.configuration }} -f ${{ matrix.targetFramework }} --warnaserror + + - name: Generate test-type filtered solutions + shell: pwsh run: | - export UT_PROJECTS=$(find ./dotnet -type f -name "*.UnitTests.csproj" | tr '\n' ' ') - for project in $UT_PROJECTS; do - # Query the project's target frameworks using MSBuild with the current configuration - target_frameworks=$(dotnet msbuild $project -getProperty:TargetFrameworks -p:Configuration=${{ matrix.configuration }} -nologo 2>/dev/null | tr -d '\r') - - # Check if the project supports the target framework - if [[ "$target_frameworks" == *"${{ matrix.targetFramework }}"* ]]; then - if [[ "${{ matrix.targetFramework }}" == "${{ env.COVERAGE_FRAMEWORK }}" ]]; then - dotnet test -f ${{ matrix.targetFramework }} -c ${{ matrix.configuration }} $project --no-build -v Normal --logger trx --collect:"XPlat Code Coverage" --results-directory:"TestResults/Coverage/" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ExcludeByAttribute=GeneratedCodeAttribute,CompilerGeneratedAttribute,ExcludeFromCodeCoverageAttribute - else - dotnet test -f ${{ matrix.targetFramework }} -c ${{ matrix.configuration }} $project --no-build -v Normal --logger trx - fi - else - echo "Skipping $project - does not support target framework ${{ matrix.targetFramework }} (supports: $target_frameworks)" - fi - done + $commonArgs = @{ + Solution = "dotnet/filtered.slnx" + TargetFramework = "${{ matrix.targetFramework }}" + Configuration = "${{ matrix.configuration }}" + Verbose = $true + } + ./dotnet/eng/scripts/New-FilteredSolution.ps1 @commonArgs ` + -TestProjectNameFilter "*UnitTests*" ` + -OutputPath dotnet/filtered-unit.slnx + ./dotnet/eng/scripts/New-FilteredSolution.ps1 @commonArgs ` + -TestProjectNameFilter "*IntegrationTests*" ` + -OutputPath dotnet/filtered-integration.slnx + + - name: Run Unit Tests + shell: pwsh + working-directory: dotnet + run: | + $coverageSettings = Join-Path $PWD "tests/coverage.runsettings" + $coverageArgs = @() + if ("${{ matrix.targetFramework }}" -eq "${{ env.COVERAGE_FRAMEWORK }}") { + $coverageArgs = @( + "--coverage", + "--coverage-output-format", "cobertura", + "--coverage-settings", $coverageSettings, + "--results-directory", "../TestResults/Coverage/" + ) + } + + dotnet test --solution ./filtered-unit.slnx ` + -f ${{ matrix.targetFramework }} ` + -c ${{ matrix.configuration }} ` + --no-build -v Normal ` + --report-xunit-trx ` + --ignore-exit-code 8 ` + @coverageArgs env: # Cosmos DB Emulator connection settings COSMOSDB_ENDPOINT: https://localhost:8081 @@ -185,21 +248,19 @@ jobs: id: azure-functions-setup - name: Run Integration Tests - shell: bash + shell: pwsh + working-directory: dotnet if: github.event_name != 'pull_request' && matrix.integration-tests run: | - export INTEGRATION_TEST_PROJECTS=$(find ./dotnet -type f -name "*IntegrationTests.csproj" | tr '\n' ' ') - for project in $INTEGRATION_TEST_PROJECTS; do - # Query the project's target frameworks using MSBuild with the current configuration - target_frameworks=$(dotnet msbuild $project -getProperty:TargetFrameworks -p:Configuration=${{ matrix.configuration }} -nologo 2>/dev/null | tr -d '\r') - - # Check if the project supports the target framework - if [[ "$target_frameworks" == *"${{ matrix.targetFramework }}"* ]]; then - dotnet test -f ${{ matrix.targetFramework }} -c ${{ matrix.configuration }} $project --no-build -v Normal --logger trx --filter "Category!=IntegrationDisabled" - else - echo "Skipping $project - does not support target framework ${{ matrix.targetFramework }} (supports: $target_frameworks)" - fi - done + dotnet test --solution ./filtered-integration.slnx ` + -f ${{ matrix.targetFramework }} ` + -c ${{ matrix.configuration }} ` + --no-build -v Normal ` + --report-xunit-trx ` + --ignore-exit-code 8 ` + --filter-not-trait "Category=IntegrationDisabled" ` + --parallel-algorithm aggressive ` + --max-threads 2.0x env: # Cosmos DB Emulator connection settings COSMOSDB_ENDPOINT: https://localhost:8081 @@ -222,7 +283,7 @@ jobs: if: matrix.targetFramework == env.COVERAGE_FRAMEWORK uses: danielpalme/ReportGenerator-GitHub-Action@5.5.1 with: - reports: "./TestResults/Coverage/**/coverage.cobertura.xml" + reports: "./TestResults/Coverage/**/*.cobertura.xml" targetdir: "./TestResults/Reports" reporttypes: "HtmlInline;JsonSummary" @@ -236,13 +297,13 @@ jobs: - name: Check coverage if: matrix.targetFramework == env.COVERAGE_FRAMEWORK shell: pwsh - run: .github/workflows/dotnet-check-coverage.ps1 -JsonReportPath "TestResults/Reports/Summary.json" -CoverageThreshold $env:COVERAGE_THRESHOLD + run: ./dotnet/eng/scripts/dotnet-check-coverage.ps1 -JsonReportPath "TestResults/Reports/Summary.json" -CoverageThreshold $env:COVERAGE_THRESHOLD # This final job is required to satisfy the merge queue. It must only run (or succeed) if no tests failed dotnet-build-and-test-check: if: always() runs-on: ubuntu-latest - needs: [dotnet-build-and-test] + needs: [dotnet-build, dotnet-test] steps: - name: Get Date shell: bash diff --git a/dotnet/.github/skills/build-and-test/SKILL.md b/dotnet/.github/skills/build-and-test/SKILL.md index 60492fe135..1009e2c5b7 100644 --- a/dotnet/.github/skills/build-and-test/SKILL.md +++ b/dotnet/.github/skills/build-and-test/SKILL.md @@ -17,14 +17,17 @@ dotnet format # Auto-fix formatting for all projects # Build/test/format a specific project (preferred for isolated/internal changes) dotnet build src/Microsoft.Agents.AI. --tl:off -dotnet test tests/Microsoft.Agents.AI..UnitTests +dotnet test --project tests/Microsoft.Agents.AI..UnitTests dotnet format src/Microsoft.Agents.AI. # Run a single test -dotnet test --filter "FullyQualifiedName~Namespace.TestClassName.TestMethodName" +# Replace the filter values with the appropriate assembly, namespace, class, and method names for the test you want to run and use * as a wildcard elsewhere, e.g. "/*/*/HttpClientTests/GetAsync_ReturnsSuccessStatusCode" +# Use `--ignore-exit-code 8` to avoid failing the build when no tests are found for some projects +dotnet test --filter-query "////" --ignore-exit-code 8 # Run unit tests only -dotnet test --filter FullyQualifiedName\~UnitTests +# Use `--ignore-exit-code 8` to avoid failing the build when no tests are found for integration test projects +dotnet test --filter-query "/*UnitTests*/*/*/*" --ignore-exit-code 8 ``` Use `--tl:off` when building to avoid flickering when running commands in the agent. @@ -56,7 +59,7 @@ Example: Running tests for a single project using .NET 10. ```bash # From dotnet/ directory -dotnet test ./tests/Microsoft.Agents.AI.Abstractions.UnitTests -f net10.0 +dotnet test --project ./tests/Microsoft.Agents.AI.Abstractions.UnitTests -f net10.0 ``` Example: Running a single test in a specific project using .NET 10. @@ -64,7 +67,7 @@ Provide the full namespace, class name, and method name for the test you want to ```bash # From dotnet/ directory -dotnet test ./tests/Microsoft.Agents.AI.Abstractions.UnitTests -f net10.0 --filter "FullyQualifiedName~Microsoft.Agents.AI.Abstractions.UnitTests.AgentRunOptionsTests.CloningConstructorCopiesProperties" +dotnet test --project ./tests/Microsoft.Agents.AI.Abstractions.UnitTests -f net10.0 --filter-query "/*/Microsoft.Agents.AI.Abstractions.UnitTests/AgentRunOptionsTests/CloningConstructorCopiesProperties" ``` ### Multi-target framework tip @@ -83,3 +86,45 @@ Just remember to run `dotnet restore` after pulling changes, making changes to p Unit tests target both .NET Framework as well as .NET Core. When running on Linux, only the .NET Core tests can be run, as .NET Framework is not supported on Linux. To run only the .NET Core tests, use the `-f net10.0` option with `dotnet test`. + +### Microsoft Testing Platform (MTP) + +Tests use the [Microsoft Testing Platform](https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-intro) via xUnit v3. Key differences from the legacy VSTest runner: + +- **`dotnet test` requires `--project`** to specify a test project directly (positional arguments are no longer supported). +- **Test output** uses the MTP format (e.g., `[✓112/x0/↓0]` progress and `Test run summary: Passed!`). +- **TRX reports** use `--report-xunit-trx` instead of `--logger trx`. +- **Code coverage** uses `Microsoft.Testing.Extensions.CodeCoverage` with `--coverage --coverage-output-format cobertura`. +- **Running a test project directly** is supported via `dotnet run --project `. This bypasses the `dotnet test` infrastructure and runs the test executable directly with the MTP command line. + +- **Running tests across the solution** with a filter may cause some projects to match zero tests, which MTP treats as a failure (exit code 8). Use `--ignore-exit-code 8` to suppress this: + +```bash +# Run all unit tests across the solution, ignoring projects with no matching tests +dotnet test --solution ./agent-framework-dotnet.slnx --no-build -f net10.0 --ignore-exit-code 8 +``` + +- **Running tests with `--solution` for a specific TFM** requires all projects in the solution to support that TFM. Not all projects target every framework (e.g., some are `net10.0`-only). Use `./dotnet/eng/scripts/New-FilteredSolution.ps1` to generate a filtered solution: + +```powershell +# Generate a filtered solution for net472 and run tests +$filtered = ./dotnet/eng/scripts/New-FilteredSolution.ps1 -Solution dotnet/agent-framework-dotnet.slnx -TargetFramework net472 +dotnet test --solution $filtered --no-build -f net472 --ignore-exit-code 8 + +# Exclude samples and keep only unit test projects +./dotnet/eng/scripts/New-FilteredSolution.ps1 -Solution dotnet/agent-framework-dotnet.slnx -TargetFramework net10.0 -ExcludeSamples -TestProjectNameFilter "*UnitTests*" -OutputPath dotnet/filtered-unit.slnx +``` + +```bash +# Run tests via dotnet test (uses MTP under the hood) +dotnet test --project ./tests/Microsoft.Agents.AI.UnitTests -f net10.0 + +# Run tests with code coverage (Cobertura format) +dotnet test --project ./tests/Microsoft.Agents.AI.UnitTests -f net10.0 --coverage --coverage-output-format cobertura --coverage-settings ./tests/coverage.runsettings + +# Run tests directly via dotnet run (MTP native command line) +dotnet run --project ./tests/Microsoft.Agents.AI.UnitTests -f net10.0 + +# Show MTP command line help +dotnet run --project ./tests/Microsoft.Agents.AI.UnitTests -f net10.0 -- -? +``` diff --git a/dotnet/Directory.Packages.props b/dotnet/Directory.Packages.props index 396a316575..e3b3cbbc42 100644 --- a/dotnet/Directory.Packages.props +++ b/dotnet/Directory.Packages.props @@ -138,12 +138,10 @@ - - - - - - + + + + diff --git a/dotnet/agent-framework-dotnet.slnx b/dotnet/agent-framework-dotnet.slnx index 2bb11b01b8..39aee03b4a 100644 --- a/dotnet/agent-framework-dotnet.slnx +++ b/dotnet/agent-framework-dotnet.slnx @@ -305,7 +305,6 @@ - @@ -338,6 +337,10 @@ + + + + diff --git a/dotnet/eng/scripts/New-FilteredSolution.ps1 b/dotnet/eng/scripts/New-FilteredSolution.ps1 new file mode 100644 index 0000000000..de6a8f9d1d --- /dev/null +++ b/dotnet/eng/scripts/New-FilteredSolution.ps1 @@ -0,0 +1,145 @@ +#!/usr/bin/env pwsh +# Copyright (c) Microsoft. All rights reserved. + +<# +.SYNOPSIS + Generates a filtered .slnx solution file by removing projects that don't match the specified criteria. + +.DESCRIPTION + Parses a .slnx solution file and applies one or more filters: + - Removes projects that don't support the specified target framework (via MSBuild query). + - Optionally removes all sample projects (under samples/). + - Optionally filters test projects by name pattern (e.g., only *UnitTests*). + Writes the filtered solution to the specified output path and prints the path. + +.PARAMETER Solution + Path to the source .slnx solution file. + +.PARAMETER TargetFramework + The target framework to filter by (e.g., net10.0, net472). + +.PARAMETER Configuration + Optional MSBuild configuration used when querying TargetFrameworks. Defaults to Debug. + +.PARAMETER TestProjectNameFilter + Optional wildcard pattern to filter test project names (e.g., *UnitTests*, *IntegrationTests*). + When specified, only test projects whose filename matches this pattern are kept. + +.PARAMETER ExcludeSamples + When specified, removes all projects under the samples/ directory from the solution. + +.PARAMETER OutputPath + Optional output path for the filtered .slnx file. If not specified, a temp file is created. + +.EXAMPLE + # Generate a filtered solution and run tests + $filtered = ./dotnet/eng/scripts/New-FilteredSolution.ps1 -Solution dotnet/agent-framework-dotnet.slnx -TargetFramework net472 + dotnet test --solution $filtered --no-build -f net472 + +.EXAMPLE + # Generate a solution with only unit test projects + ./dotnet/eng/scripts/New-FilteredSolution.ps1 -Solution dotnet/agent-framework-dotnet.slnx -TargetFramework net10.0 -TestProjectNameFilter "*UnitTests*" -OutputPath filtered-unit.slnx + +.EXAMPLE + # Inline usage with dotnet test (PowerShell) + dotnet test --solution (./dotnet/eng/scripts/New-FilteredSolution.ps1 -Solution dotnet/agent-framework-dotnet.slnx -TargetFramework net472) --no-build -f net472 +#> + +[CmdletBinding()] +param( + [Parameter(Mandatory)] + [string]$Solution, + + [Parameter(Mandatory)] + [string]$TargetFramework, + + [string]$Configuration = "Debug", + + [string]$TestProjectNameFilter, + + [switch]$ExcludeSamples, + + [string]$OutputPath +) + +$ErrorActionPreference = "Stop" + +# Resolve the solution path +$solutionPath = Resolve-Path $Solution +$solutionDir = Split-Path $solutionPath -Parent + +if (-not $OutputPath) { + $OutputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), "filtered-$(Split-Path $solutionPath -Leaf)") +} + +# Parse the .slnx XML +[xml]$slnx = Get-Content $solutionPath -Raw + +$removed = @() +$kept = @() + +# Remove sample projects if requested +if ($ExcludeSamples) { + $sampleProjects = $slnx.SelectNodes("//Project[contains(@Path, 'samples/')]") + foreach ($proj in $sampleProjects) { + $projRelPath = $proj.GetAttribute("Path") + Write-Verbose "Removing (sample): $projRelPath" + $removed += $projRelPath + $proj.ParentNode.RemoveChild($proj) | Out-Null + } + Write-Host "Removed $($sampleProjects.Count) sample project(s)." -ForegroundColor Yellow +} + +# Filter all remaining projects by target framework +$allProjects = $slnx.SelectNodes("//Project") + +foreach ($proj in $allProjects) { + $projRelPath = $proj.GetAttribute("Path") + $projFullPath = Join-Path $solutionDir $projRelPath + $projFileName = Split-Path $projRelPath -Leaf + $isTestProject = $projRelPath -like "*tests/*" + + # Filter test projects by name pattern if specified + if ($isTestProject -and $TestProjectNameFilter -and ($projFileName -notlike $TestProjectNameFilter)) { + Write-Verbose "Removing (name filter): $projRelPath" + $removed += $projRelPath + $proj.ParentNode.RemoveChild($proj) | Out-Null + continue + } + + if (-not (Test-Path $projFullPath)) { + Write-Verbose "Project not found, keeping in solution: $projRelPath" + $kept += $projRelPath + continue + } + + # Query the project's target frameworks using MSBuild + $targetFrameworks = & dotnet msbuild $projFullPath -getProperty:TargetFrameworks -p:Configuration=$Configuration -nologo 2>$null + $targetFrameworks = $targetFrameworks.Trim() + + if ($targetFrameworks -like "*$TargetFramework*") { + Write-Verbose "Keeping: $projRelPath (targets: $targetFrameworks)" + $kept += $projRelPath + } + else { + Write-Verbose "Removing: $projRelPath (targets: $targetFrameworks, missing: $TargetFramework)" + $removed += $projRelPath + $proj.ParentNode.RemoveChild($proj) | Out-Null + } +} + +# Write the filtered solution +$slnx.Save($OutputPath) + +# Report results to stderr so stdout is clean for piping +Write-Host "Filtered solution written to: $OutputPath" -ForegroundColor Green +if ($removed.Count -gt 0) { + Write-Host "Removed $($removed.Count) project(s):" -ForegroundColor Yellow + foreach ($r in $removed) { + Write-Host " - $r" -ForegroundColor Yellow + } +} +Write-Host "Kept $($kept.Count) project(s)." -ForegroundColor Green + +# Output the path for piping +Write-Output $OutputPath diff --git a/.github/workflows/dotnet-check-coverage.ps1 b/dotnet/eng/scripts/dotnet-check-coverage.ps1 similarity index 100% rename from .github/workflows/dotnet-check-coverage.ps1 rename to dotnet/eng/scripts/dotnet-check-coverage.ps1 diff --git a/dotnet/global.json b/dotnet/global.json index 54533bf771..482aa6b8d3 100644 --- a/dotnet/global.json +++ b/dotnet/global.json @@ -3,5 +3,8 @@ "version": "10.0.100", "rollForward": "minor", "allowPrerelease": false + }, + "test": { + "runner": "Microsoft.Testing.Platform" } } \ No newline at end of file diff --git a/dotnet/tests/AgentConformance.IntegrationTests/AgentTests.cs b/dotnet/tests/AgentConformance.IntegrationTests/AgentTests.cs index 353b4a36ba..1dc8fa2bcd 100644 --- a/dotnet/tests/AgentConformance.IntegrationTests/AgentTests.cs +++ b/dotnet/tests/AgentConformance.IntegrationTests/AgentTests.cs @@ -15,11 +15,15 @@ public abstract class AgentTests(Func createAgentF { protected TAgentFixture Fixture { get; private set; } = default!; - public Task InitializeAsync() + public async ValueTask InitializeAsync() { this.Fixture = createAgentFixture(); - return this.Fixture.InitializeAsync(); + await this.Fixture.InitializeAsync(); } - public Task DisposeAsync() => this.Fixture.DisposeAsync(); + public async ValueTask DisposeAsync() + { + GC.SuppressFinalize(this); + await this.Fixture.DisposeAsync(); + } } diff --git a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletion.IntegrationTests.csproj b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletion.IntegrationTests.csproj index 929eafe998..ac59cff3fd 100644 --- a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletion.IntegrationTests.csproj +++ b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletion.IntegrationTests.csproj @@ -1,6 +1,7 @@ + $(NoWarn);CS8793 True diff --git a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionChatClientAgentRunStreamingTests.cs b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionChatClientAgentRunStreamingTests.cs index 992db5380b..86b07a30f9 100644 --- a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionChatClientAgentRunStreamingTests.cs +++ b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionChatClientAgentRunStreamingTests.cs @@ -1,26 +1,13 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Threading.Tasks; using AgentConformance.IntegrationTests; namespace AnthropicChatCompletion.IntegrationTests; -public abstract class SkipAllChatClientRunStreaming(Func func) : ChatClientAgentRunStreamingTests(func) -{ - [Fact(Skip = AnthropicChatCompletionFixture.SkipReason)] - public override Task RunWithFunctionsInvokesFunctionsAndReturnsExpectedResultsAsync() - => base.RunWithFunctionsInvokesFunctionsAndReturnsExpectedResultsAsync(); +public class AnthropicBetaChatCompletionChatClientAgentReasoningRunStreamingTests() : ChatClientAgentRunStreamingTests(() => new(useReasoningChatModel: true, useBeta: true)); - [Fact(Skip = AnthropicChatCompletionFixture.SkipReason)] - public override Task RunWithInstructionsAndNoMessageReturnsExpectedResultAsync() - => base.RunWithInstructionsAndNoMessageReturnsExpectedResultAsync(); -} +public class AnthropicBetaChatCompletionChatClientAgentRunStreamingTests() : ChatClientAgentRunStreamingTests(() => new(useReasoningChatModel: false, useBeta: true)); -public class AnthropicBetaChatCompletionChatClientAgentReasoningRunStreamingTests() : SkipAllChatClientRunStreaming(() => new(useReasoningChatModel: true, useBeta: true)); +public class AnthropicChatCompletionChatClientAgentRunStreamingTests() : ChatClientAgentRunStreamingTests(() => new(useReasoningChatModel: false, useBeta: false)); -public class AnthropicBetaChatCompletionChatClientAgentRunStreamingTests() : SkipAllChatClientRunStreaming(() => new(useReasoningChatModel: false, useBeta: true)); - -public class AnthropicChatCompletionChatClientAgentRunStreamingTests() : SkipAllChatClientRunStreaming(() => new(useReasoningChatModel: false, useBeta: false)); - -public class AnthropicChatCompletionChatClientAgentReasoningRunStreamingTests() : SkipAllChatClientRunStreaming(() => new(useReasoningChatModel: true, useBeta: false)); +public class AnthropicChatCompletionChatClientAgentReasoningRunStreamingTests() : ChatClientAgentRunStreamingTests(() => new(useReasoningChatModel: true, useBeta: false)); diff --git a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionChatClientAgentRunTests.cs b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionChatClientAgentRunTests.cs index e2ce6e5d04..db150a2605 100644 --- a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionChatClientAgentRunTests.cs +++ b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionChatClientAgentRunTests.cs @@ -1,30 +1,17 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Threading.Tasks; using AgentConformance.IntegrationTests; namespace AnthropicChatCompletion.IntegrationTests; -public abstract class SkipAllChatClientAgentRun(Func func) : ChatClientAgentRunTests(func) -{ - [Fact(Skip = AnthropicChatCompletionFixture.SkipReason)] - public override Task RunWithFunctionsInvokesFunctionsAndReturnsExpectedResultsAsync() - => base.RunWithFunctionsInvokesFunctionsAndReturnsExpectedResultsAsync(); - - [Fact(Skip = AnthropicChatCompletionFixture.SkipReason)] - public override Task RunWithInstructionsAndNoMessageReturnsExpectedResultAsync() - => base.RunWithInstructionsAndNoMessageReturnsExpectedResultAsync(); -} - public class AnthropicBetaChatCompletionChatClientAgentRunTests() - : SkipAllChatClientAgentRun(() => new(useReasoningChatModel: false, useBeta: true)); + : ChatClientAgentRunTests(() => new(useReasoningChatModel: false, useBeta: true)); public class AnthropicBetaChatCompletionChatClientAgentReasoningRunTests() - : SkipAllChatClientAgentRun(() => new(useReasoningChatModel: true, useBeta: true)); + : ChatClientAgentRunTests(() => new(useReasoningChatModel: true, useBeta: true)); public class AnthropicChatCompletionChatClientAgentRunTests() - : SkipAllChatClientAgentRun(() => new(useReasoningChatModel: false, useBeta: false)); + : ChatClientAgentRunTests(() => new(useReasoningChatModel: false, useBeta: false)); public class AnthropicChatCompletionChatClientAgentReasoningRunTests() - : SkipAllChatClientAgentRun(() => new(useReasoningChatModel: true, useBeta: false)); + : ChatClientAgentRunTests(() => new(useReasoningChatModel: true, useBeta: false)); diff --git a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionFixture.cs b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionFixture.cs index 16bb97d218..af98629237 100644 --- a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionFixture.cs +++ b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionFixture.cs @@ -1,5 +1,6 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -102,9 +103,15 @@ public Task DeleteSessionAsync(AgentSession session) => // Chat Completion does not require/support deleting sessions, so this is a no-op. Task.CompletedTask; - public async Task InitializeAsync() => + public async ValueTask InitializeAsync() + { + Assert.SkipWhen(SkipReason is not null, SkipReason ?? string.Empty); this._agent = await this.CreateChatClientAgentAsync(); + } - public Task DisposeAsync() => - Task.CompletedTask; + public ValueTask DisposeAsync() + { + GC.SuppressFinalize(this); + return default; + } } diff --git a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionRunStreamingTests.cs b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionRunStreamingTests.cs index 4ed6d39edb..ee39281ba6 100644 --- a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionRunStreamingTests.cs +++ b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionRunStreamingTests.cs @@ -1,37 +1,17 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Threading.Tasks; using AgentConformance.IntegrationTests; namespace AnthropicChatCompletion.IntegrationTests; -public abstract class SkipAllRunStreaming(Func func) : RunStreamingTests(func) -{ - [Fact(Skip = AnthropicChatCompletionFixture.SkipReason)] - public override Task RunWithChatMessageReturnsExpectedResultAsync() => base.RunWithChatMessageReturnsExpectedResultAsync(); - - [Fact(Skip = AnthropicChatCompletionFixture.SkipReason)] - public override Task RunWithNoMessageDoesNotFailAsync() => base.RunWithNoMessageDoesNotFailAsync(); - - [Fact(Skip = AnthropicChatCompletionFixture.SkipReason)] - public override Task RunWithChatMessagesReturnsExpectedResultAsync() => base.RunWithChatMessagesReturnsExpectedResultAsync(); - - [Fact(Skip = AnthropicChatCompletionFixture.SkipReason)] - public override Task RunWithStringReturnsExpectedResultAsync() => base.RunWithStringReturnsExpectedResultAsync(); - - [Fact(Skip = AnthropicChatCompletionFixture.SkipReason)] - public override Task SessionMaintainsHistoryAsync() => base.SessionMaintainsHistoryAsync(); -} - public class AnthropicBetaChatCompletionRunStreamingTests() - : SkipAllRunStreaming(() => new(useReasoningChatModel: false, useBeta: true)); + : RunStreamingTests(() => new(useReasoningChatModel: false, useBeta: true)); public class AnthropicBetaChatCompletionReasoningRunStreamingTests() - : SkipAllRunStreaming(() => new(useReasoningChatModel: true, useBeta: true)); + : RunStreamingTests(() => new(useReasoningChatModel: true, useBeta: true)); public class AnthropicChatCompletionRunStreamingTests() - : SkipAllRunStreaming(() => new(useReasoningChatModel: false, useBeta: false)); + : RunStreamingTests(() => new(useReasoningChatModel: false, useBeta: false)); public class AnthropicChatCompletionReasoningRunStreamingTests() - : SkipAllRunStreaming(() => new(useReasoningChatModel: true, useBeta: false)); + : RunStreamingTests(() => new(useReasoningChatModel: true, useBeta: false)); diff --git a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionRunTests.cs b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionRunTests.cs index 06f2a15804..6cf514e695 100644 --- a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionRunTests.cs +++ b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionRunTests.cs @@ -1,37 +1,17 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Threading.Tasks; using AgentConformance.IntegrationTests; namespace AnthropicChatCompletion.IntegrationTests; -public abstract class SkipAllRun(Func func) : RunTests(func) -{ - [Fact(Skip = AnthropicChatCompletionFixture.SkipReason)] - public override Task RunWithChatMessageReturnsExpectedResultAsync() => base.RunWithChatMessageReturnsExpectedResultAsync(); - - [Fact(Skip = AnthropicChatCompletionFixture.SkipReason)] - public override Task RunWithNoMessageDoesNotFailAsync() => base.RunWithNoMessageDoesNotFailAsync(); - - [Fact(Skip = AnthropicChatCompletionFixture.SkipReason)] - public override Task RunWithChatMessagesReturnsExpectedResultAsync() => base.RunWithChatMessagesReturnsExpectedResultAsync(); - - [Fact(Skip = AnthropicChatCompletionFixture.SkipReason)] - public override Task RunWithStringReturnsExpectedResultAsync() => base.RunWithStringReturnsExpectedResultAsync(); - - [Fact(Skip = AnthropicChatCompletionFixture.SkipReason)] - public override Task SessionMaintainsHistoryAsync() => base.SessionMaintainsHistoryAsync(); -} - public class AnthropicBetaChatCompletionRunTests() - : SkipAllRun(() => new(useReasoningChatModel: false, useBeta: true)); + : RunTests(() => new(useReasoningChatModel: false, useBeta: true)); public class AnthropicBetaChatCompletionReasoningRunTests() - : SkipAllRun(() => new(useReasoningChatModel: true, useBeta: true)); + : RunTests(() => new(useReasoningChatModel: true, useBeta: true)); public class AnthropicChatCompletionRunTests() - : SkipAllRun(() => new(useReasoningChatModel: false, useBeta: false)); + : RunTests(() => new(useReasoningChatModel: false, useBeta: false)); public class AnthropicChatCompletionReasoningRunTests() - : SkipAllRun(() => new(useReasoningChatModel: true, useBeta: false)); + : RunTests(() => new(useReasoningChatModel: true, useBeta: false)); diff --git a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicSkillsIntegrationTests.cs b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicSkillsIntegrationTests.cs index 50474a1eeb..452b0c6cf2 100644 --- a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicSkillsIntegrationTests.cs +++ b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicSkillsIntegrationTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using System.Threading.Tasks; using AgentConformance.IntegrationTests.Support; @@ -22,9 +22,11 @@ public sealed class AnthropicSkillsIntegrationTests // All tests for Anthropic are intended to be ran locally as the CI pipeline for Anthropic is not setup. private const string SkipReason = "Integrations tests for local execution only"; - [Fact(Skip = SkipReason)] + [Fact] public async Task CreateAgentWithPptxSkillAsync() { + Assert.SkipWhen(SkipReason is not null, SkipReason ?? string.Empty); + // Arrange AnthropicClient anthropicClient = new() { ApiKey = TestConfiguration.GetRequiredValue(TestSettings.AnthropicApiKey) }; string model = TestConfiguration.GetRequiredValue(TestSettings.AnthropicChatModelName); @@ -51,9 +53,11 @@ public async Task CreateAgentWithPptxSkillAsync() Assert.NotEmpty(response.Text); } - [Fact(Skip = SkipReason)] + [Fact] public async Task ListAnthropicManagedSkillsAsync() { + Assert.SkipWhen(SkipReason is not null, SkipReason ?? string.Empty); + // Arrange AnthropicClient anthropicClient = new() { ApiKey = TestConfiguration.GetRequiredValue(TestSettings.AnthropicApiKey) }; diff --git a/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientAgentRunStreamingTests.cs b/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientAgentRunStreamingTests.cs index 50ced1e64d..870dda648c 100644 --- a/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientAgentRunStreamingTests.cs +++ b/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientAgentRunStreamingTests.cs @@ -9,10 +9,10 @@ namespace AzureAI.IntegrationTests; public class AIProjectClientAgentRunStreamingPreviousResponseTests() : RunStreamingTests(() => new()) { - [Fact(Skip = "No messages is not supported")] public override Task RunWithNoMessageDoesNotFailAsync() { - return Task.CompletedTask; + Assert.Skip("No messages is not supported"); + return base.RunWithNoMessageDoesNotFailAsync(); } } @@ -24,9 +24,9 @@ public override Task RunWithNoMessageDoesNotFailAsync() return new ChatClientAgentRunOptions(new() { ConversationId = conversationId }); }; - [Fact(Skip = "No messages is not supported")] public override Task RunWithNoMessageDoesNotFailAsync() { - return Task.CompletedTask; + Assert.Skip("No messages is not supported"); + return base.RunWithNoMessageDoesNotFailAsync(); } } diff --git a/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientAgentRunTests.cs b/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientAgentRunTests.cs index 0092090401..af4cee82e6 100644 --- a/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientAgentRunTests.cs +++ b/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientAgentRunTests.cs @@ -9,10 +9,10 @@ namespace AzureAI.IntegrationTests; public class AIProjectClientAgentRunPreviousResponseTests() : RunTests(() => new()) { - [Fact(Skip = "No messages is not supported")] public override Task RunWithNoMessageDoesNotFailAsync() { - return Task.CompletedTask; + Assert.Skip("No messages is not supported"); + return base.RunWithNoMessageDoesNotFailAsync(); } } @@ -24,9 +24,9 @@ public override Task RunWithNoMessageDoesNotFailAsync() return new ChatClientAgentRunOptions(new() { ConversationId = conversationId }); }; - [Fact(Skip = "No messages is not supported")] public override Task RunWithNoMessageDoesNotFailAsync() { - return Task.CompletedTask; + Assert.Skip("No messages is not supported"); + return base.RunWithNoMessageDoesNotFailAsync(); } } diff --git a/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientAgentStructuredOutputRunTests.cs b/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientAgentStructuredOutputRunTests.cs index 94ce01e221..9db48f3832 100644 --- a/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientAgentStructuredOutputRunTests.cs +++ b/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientAgentStructuredOutputRunTests.cs @@ -1,6 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System; using System.Threading.Tasks; using AgentConformance.IntegrationTests; using AgentConformance.IntegrationTests.Support; @@ -66,17 +65,23 @@ public async Task RunGenericWithResponseFormatAtAgentInitializationReturnsExpect Assert.Equal("Paris", response.Result.Name); } - [Fact(Skip = NotSupported)] - public override Task RunWithGenericTypeReturnsExpectedResultAsync() => - base.RunWithGenericTypeReturnsExpectedResultAsync(); + public override Task RunWithGenericTypeReturnsExpectedResultAsync() + { + Assert.Skip(NotSupported); + return base.RunWithGenericTypeReturnsExpectedResultAsync(); + } - [Fact(Skip = NotSupported)] - public override Task RunWithResponseFormatReturnsExpectedResultAsync() => - base.RunWithResponseFormatReturnsExpectedResultAsync(); + public override Task RunWithResponseFormatReturnsExpectedResultAsync() + { + Assert.Skip(NotSupported); + return base.RunWithResponseFormatReturnsExpectedResultAsync(); + } - [Fact(Skip = NotSupported)] - public override Task RunWithPrimitiveTypeReturnsExpectedResultAsync() => - base.RunWithPrimitiveTypeReturnsExpectedResultAsync(); + public override Task RunWithPrimitiveTypeReturnsExpectedResultAsync() + { + Assert.Skip(NotSupported); + return base.RunWithPrimitiveTypeReturnsExpectedResultAsync(); + } } /// @@ -84,7 +89,7 @@ public override Task RunWithPrimitiveTypeReturnsExpectedResultAsync() => /// public class AIProjectClientStructuredOutputFixture : AIProjectClientFixture { - public override Task InitializeAsync() + public override async ValueTask InitializeAsync() { var agentOptions = new ChatClientAgentOptions { @@ -94,6 +99,6 @@ public override Task InitializeAsync() }, }; - return this.InitializeAsync(agentOptions); + await this.InitializeAsync(agentOptions); } } diff --git a/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientChatClientAgentRunStreamingTests.cs b/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientChatClientAgentRunStreamingTests.cs index befa409d80..3b0c1c27b4 100644 --- a/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientChatClientAgentRunStreamingTests.cs +++ b/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientChatClientAgentRunStreamingTests.cs @@ -7,9 +7,9 @@ namespace AzureAI.IntegrationTests; public class AIProjectClientChatClientAgentRunStreamingTests() : ChatClientAgentRunStreamingTests(() => new()) { - [Fact(Skip = "No messages is not supported")] public override Task RunWithInstructionsAndNoMessageReturnsExpectedResultAsync() { - return Task.CompletedTask; + Assert.Skip("No messages is not supported"); + return base.RunWithInstructionsAndNoMessageReturnsExpectedResultAsync(); } } diff --git a/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientChatClientAgentRunTests.cs b/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientChatClientAgentRunTests.cs index 1af12606cb..1e47d0a970 100644 --- a/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientChatClientAgentRunTests.cs +++ b/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientChatClientAgentRunTests.cs @@ -7,9 +7,9 @@ namespace AzureAI.IntegrationTests; public class AIProjectClientChatClientAgentRunTests() : ChatClientAgentRunTests(() => new()) { - [Fact(Skip = "No messages is not supported")] public override Task RunWithInstructionsAndNoMessageReturnsExpectedResultAsync() { - return Task.CompletedTask; + Assert.Skip("No messages is not supported"); + return base.RunWithInstructionsAndNoMessageReturnsExpectedResultAsync(); } } diff --git a/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientFixture.cs b/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientFixture.cs index 64a8e86c8a..192e8b6c9e 100644 --- a/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientFixture.cs +++ b/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientFixture.cs @@ -156,17 +156,19 @@ private async Task DeleteResponseChainAsync(string lastResponseId) } } - public Task DisposeAsync() + public ValueTask DisposeAsync() { + GC.SuppressFinalize(this); + if (this._client is not null && this._agent is not null) { - return this._client.Agents.DeleteAgentAsync(this._agent.Name); + return new ValueTask(this._client.Agents.DeleteAgentAsync(this._agent.Name)); } - return Task.CompletedTask; + return default; } - public virtual async Task InitializeAsync() + public virtual async ValueTask InitializeAsync() { this._client = new(new Uri(TestConfiguration.GetRequiredValue(TestSettings.AzureAIProjectEndpoint)), new AzureCliCredential()); this._agent = await this.CreateChatClientAgentAsync(); diff --git a/dotnet/tests/AzureAI.IntegrationTests/AzureAI.IntegrationTests.csproj b/dotnet/tests/AzureAI.IntegrationTests/AzureAI.IntegrationTests.csproj index 83f65051d2..7ea633e3d4 100644 --- a/dotnet/tests/AzureAI.IntegrationTests/AzureAI.IntegrationTests.csproj +++ b/dotnet/tests/AzureAI.IntegrationTests/AzureAI.IntegrationTests.csproj @@ -1,6 +1,7 @@ + $(NoWarn);CS8793 True diff --git a/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistent.IntegrationTests.csproj b/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistent.IntegrationTests.csproj index 4078342410..2b12fe728a 100644 --- a/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistent.IntegrationTests.csproj +++ b/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistent.IntegrationTests.csproj @@ -1,6 +1,7 @@ + $(NoWarn);CS8793 True diff --git a/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistentFixture.cs b/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistentFixture.cs index 5de4192557..1ebbd2b4f1 100644 --- a/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistentFixture.cs +++ b/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistentFixture.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. +using System; using System.Collections.Generic; using System.Threading.Tasks; using AgentConformance.IntegrationTests; @@ -84,17 +85,19 @@ public Task DeleteSessionAsync(AgentSession session) return Task.CompletedTask; } - public Task DisposeAsync() + public ValueTask DisposeAsync() { + GC.SuppressFinalize(this); + if (this._persistentAgentsClient is not null && this._agent is not null) { - return this._persistentAgentsClient.Administration.DeleteAgentAsync(this._agent.Id); + return new ValueTask(this._persistentAgentsClient.Administration.DeleteAgentAsync(this._agent.Id)); } - return Task.CompletedTask; + return default; } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { this._persistentAgentsClient = new(TestConfiguration.GetRequiredValue(TestSettings.AzureAIProjectEndpoint), new AzureCliCredential()); this._agent = await this.CreateChatClientAgentAsync(); diff --git a/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistentStructuredOutputRunTests.cs b/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistentStructuredOutputRunTests.cs index a56917c515..0fa20f18ac 100644 --- a/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistentStructuredOutputRunTests.cs +++ b/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistentStructuredOutputRunTests.cs @@ -9,15 +9,21 @@ namespace AzureAIAgentsPersistent.IntegrationTests; { private const string SkipReason = "Fails intermittently on the build agent/CI"; - [Fact(Skip = SkipReason)] - public override Task RunWithResponseFormatReturnsExpectedResultAsync() => - base.RunWithResponseFormatReturnsExpectedResultAsync(); + public override Task RunWithResponseFormatReturnsExpectedResultAsync() + { + Assert.SkipWhen(SkipReason is not null, SkipReason ?? string.Empty); + return base.RunWithResponseFormatReturnsExpectedResultAsync(); + } - [Fact(Skip = SkipReason)] - public override Task RunWithGenericTypeReturnsExpectedResultAsync() => - base.RunWithGenericTypeReturnsExpectedResultAsync(); + public override Task RunWithGenericTypeReturnsExpectedResultAsync() + { + Assert.SkipWhen(SkipReason is not null, SkipReason ?? string.Empty); + return base.RunWithGenericTypeReturnsExpectedResultAsync(); + } - [Fact(Skip = SkipReason)] - public override Task RunWithPrimitiveTypeReturnsExpectedResultAsync() => - base.RunWithPrimitiveTypeReturnsExpectedResultAsync(); + public override Task RunWithPrimitiveTypeReturnsExpectedResultAsync() + { + Assert.SkipWhen(SkipReason is not null, SkipReason ?? string.Empty); + return base.RunWithPrimitiveTypeReturnsExpectedResultAsync(); + } } diff --git a/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudio.IntegrationTests.csproj b/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudio.IntegrationTests.csproj index 5f535eb7bd..312a322989 100644 --- a/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudio.IntegrationTests.csproj +++ b/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudio.IntegrationTests.csproj @@ -1,6 +1,7 @@ + $(NoWarn);CS8793 True true diff --git a/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudioFixture.cs b/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudioFixture.cs index 8dfeba1972..c8db0c77d7 100644 --- a/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudioFixture.cs +++ b/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudioFixture.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using System; using System.Collections.Generic; @@ -28,16 +28,24 @@ public Task DeleteSessionAsync(AgentSession session) => // Chat Completion does not require/support deleting threads, so this is a no-op. Task.CompletedTask; - public Task InitializeAsync() + public ValueTask InitializeAsync() { const string CopilotStudioHttpClientName = nameof(CopilotStudioAgent); - var settings = new CopilotStudioConnectionSettings( - TestConfiguration.GetRequiredValue(TestSettings.CopilotStudioTenantId), - TestConfiguration.GetRequiredValue(TestSettings.CopilotStudioAgentAppId)) + CopilotStudioConnectionSettings? settings = null; + try { - DirectConnectUrl = TestConfiguration.GetRequiredValue(TestSettings.CopilotStudioDirectConnectUrl), - }; + settings = new CopilotStudioConnectionSettings( + TestConfiguration.GetRequiredValue(TestSettings.CopilotStudioTenantId), + TestConfiguration.GetRequiredValue(TestSettings.CopilotStudioAgentAppId)) + { + DirectConnectUrl = TestConfiguration.GetRequiredValue(TestSettings.CopilotStudioDirectConnectUrl), + }; + } + catch (InvalidOperationException ex) + { + Assert.Skip("CopilotStudio configuration could not be loaded. Error:" + ex.Message); + } ServiceCollection services = new(); @@ -56,8 +64,12 @@ public Task InitializeAsync() this.Agent = new CopilotStudioAgent(client); - return Task.CompletedTask; + return default; } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() + { + GC.SuppressFinalize(this); + return default; + } } diff --git a/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudioRunStreamingTests.cs b/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudioRunStreamingTests.cs index 076512252b..cd482ee748 100644 --- a/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudioRunStreamingTests.cs +++ b/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudioRunStreamingTests.cs @@ -10,23 +10,33 @@ namespace CopilotStudio.IntegrationTests; // Set to null to run the tests. private const string ManualVerification = "For manual verification"; - [Fact(Skip = "Copilot Studio does not support session history retrieval, so this test is not applicable.")] - public override Task SessionMaintainsHistoryAsync() => - Task.CompletedTask; - - [Fact(Skip = ManualVerification)] - public override Task RunWithChatMessageReturnsExpectedResultAsync() => - base.RunWithChatMessageReturnsExpectedResultAsync(); - - [Fact(Skip = ManualVerification)] - public override Task RunWithChatMessagesReturnsExpectedResultAsync() => - base.RunWithChatMessagesReturnsExpectedResultAsync(); - - [Fact(Skip = ManualVerification)] - public override Task RunWithNoMessageDoesNotFailAsync() => - base.RunWithNoMessageDoesNotFailAsync(); - - [Fact(Skip = ManualVerification)] - public override Task RunWithStringReturnsExpectedResultAsync() => - base.RunWithStringReturnsExpectedResultAsync(); + public override Task SessionMaintainsHistoryAsync() + { + Assert.Skip("Copilot Studio does not support session history retrieval, so this test is not applicable."); + return base.SessionMaintainsHistoryAsync(); + } + + public override Task RunWithChatMessageReturnsExpectedResultAsync() + { + Assert.SkipWhen(ManualVerification is not null, ManualVerification ?? string.Empty); + return base.RunWithChatMessageReturnsExpectedResultAsync(); + } + + public override Task RunWithChatMessagesReturnsExpectedResultAsync() + { + Assert.SkipWhen(ManualVerification is not null, ManualVerification ?? string.Empty); + return base.RunWithChatMessagesReturnsExpectedResultAsync(); + } + + public override Task RunWithNoMessageDoesNotFailAsync() + { + Assert.SkipWhen(ManualVerification is not null, ManualVerification ?? string.Empty); + return base.RunWithNoMessageDoesNotFailAsync(); + } + + public override Task RunWithStringReturnsExpectedResultAsync() + { + Assert.SkipWhen(ManualVerification is not null, ManualVerification ?? string.Empty); + return base.RunWithStringReturnsExpectedResultAsync(); + } } diff --git a/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudioRunTests.cs b/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudioRunTests.cs index bf7bcfcd64..b927b1bfc5 100644 --- a/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudioRunTests.cs +++ b/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudioRunTests.cs @@ -10,23 +10,33 @@ namespace CopilotStudio.IntegrationTests; // Set to null to run the tests. private const string ManualVerification = "For manual verification"; - [Fact(Skip = "Copilot Studio does not support session history retrieval, so this test is not applicable.")] - public override Task SessionMaintainsHistoryAsync() => - Task.CompletedTask; - - [Fact(Skip = ManualVerification)] - public override Task RunWithChatMessageReturnsExpectedResultAsync() => base.RunWithChatMessageReturnsExpectedResultAsync(); - - [Fact(Skip = ManualVerification)] - public override Task RunWithChatMessagesReturnsExpectedResultAsync() => - - base.RunWithChatMessagesReturnsExpectedResultAsync(); - - [Fact(Skip = ManualVerification)] - public override Task RunWithNoMessageDoesNotFailAsync() => - base.RunWithNoMessageDoesNotFailAsync(); - - [Fact(Skip = ManualVerification)] - public override Task RunWithStringReturnsExpectedResultAsync() => - base.RunWithStringReturnsExpectedResultAsync(); + public override Task SessionMaintainsHistoryAsync() + { + Assert.Skip("Copilot Studio does not support session history retrieval, so this test is not applicable."); + return base.SessionMaintainsHistoryAsync(); + } + + public override Task RunWithChatMessageReturnsExpectedResultAsync() + { + Assert.SkipWhen(ManualVerification is not null, ManualVerification ?? string.Empty); + return base.RunWithChatMessageReturnsExpectedResultAsync(); + } + + public override Task RunWithChatMessagesReturnsExpectedResultAsync() + { + Assert.SkipWhen(ManualVerification is not null, ManualVerification ?? string.Empty); + return base.RunWithChatMessagesReturnsExpectedResultAsync(); + } + + public override Task RunWithNoMessageDoesNotFailAsync() + { + Assert.SkipWhen(ManualVerification is not null, ManualVerification ?? string.Empty); + return base.RunWithNoMessageDoesNotFailAsync(); + } + + public override Task RunWithStringReturnsExpectedResultAsync() + { + Assert.SkipWhen(ManualVerification is not null, ManualVerification ?? string.Empty); + return base.RunWithStringReturnsExpectedResultAsync(); + } } diff --git a/dotnet/tests/Directory.Build.props b/dotnet/tests/Directory.Build.props index e3bdd6745d..c4bfc0b0b5 100644 --- a/dotnet/tests/Directory.Build.props +++ b/dotnet/tests/Directory.Build.props @@ -6,22 +6,25 @@ false true false + Exe net10.0;net472 b7762d10-e29b-4bb1-8b74-b6d69a667dd4 - $(NoWarn);Moq1410;xUnit2023;MAAI001 + true + true + $(NoWarn);Moq1410;xUnit1051;MAAI001 - + - - + + - + diff --git a/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosChatHistoryProviderTests.cs b/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosChatHistoryProviderTests.cs index a790b19cdd..cedf37f292 100644 --- a/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosChatHistoryProviderTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosChatHistoryProviderTests.cs @@ -58,7 +58,7 @@ public sealed class CosmosChatHistoryProviderTests : IAsyncLifetime, IDisposable private bool _preserveContainer; private CosmosClient? _setupClient; // Only used for test setup/cleanup - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { // Fail fast if emulator is not available this.SkipIfEmulatorNotAvailable(); @@ -100,8 +100,10 @@ await databaseResponse.Database.CreateContainerIfNotExistsAsync( } } - public async Task DisposeAsync() + public async ValueTask DisposeAsync() { + GC.SuppressFinalize(this); + if (this._setupClient != null && this._emulatorAvailable) { try @@ -143,12 +145,12 @@ private void SkipIfEmulatorNotAvailable() // Locally: Skip if emulator connection check failed var ciEmulatorAvailable = string.Equals(Environment.GetEnvironmentVariable("COSMOSDB_EMULATOR_AVAILABLE"), bool.TrueString, StringComparison.OrdinalIgnoreCase); - Xunit.Skip.If(!ciEmulatorAvailable && !this._emulatorAvailable, "Cosmos DB Emulator is not available"); + Assert.SkipWhen(!ciEmulatorAvailable && !this._emulatorAvailable, "Cosmos DB Emulator is not available"); } #region Constructor Tests - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public void StateKey_ReturnsDefaultKey_WhenNoStateKeyProvided() { @@ -162,7 +164,7 @@ public void StateKey_ReturnsDefaultKey_WhenNoStateKeyProvided() Assert.Equal("CosmosChatHistoryProvider", provider.StateKey); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public void StateKey_ReturnsCustomKey_WhenSetViaConstructor() { @@ -177,7 +179,7 @@ public void StateKey_ReturnsCustomKey_WhenSetViaConstructor() Assert.Equal("custom-key", provider.StateKey); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public void Constructor_WithConnectionString_ShouldCreateInstance() { @@ -194,7 +196,7 @@ public void Constructor_WithConnectionString_ShouldCreateInstance() Assert.Equal(TestContainerId, provider.ContainerId); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public void Constructor_WithNullConnectionString_ShouldThrowArgumentException() { @@ -204,7 +206,7 @@ public void Constructor_WithNullConnectionString_ShouldThrowArgumentException() _ => new CosmosChatHistoryProvider.State("test-conversation"))); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public void Constructor_WithNullStateInitializer_ShouldThrowArgumentNullException() { @@ -219,7 +221,7 @@ public void Constructor_WithNullStateInitializer_ShouldThrowArgumentNullExceptio #region InvokedAsync Tests - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task InvokedAsync_WithSingleMessage_ShouldAddMessageAsync() { @@ -284,7 +286,7 @@ public async Task InvokedAsync_WithSingleMessage_ShouldAddMessageAsync() Assert.Equal(ChatRole.User, messageList[0].Role); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task InvokedAsync_WithMultipleMessages_ShouldAddAllMessagesAsync() { @@ -327,7 +329,7 @@ public async Task InvokedAsync_WithMultipleMessages_ShouldAddAllMessagesAsync() #region InvokingAsync Tests - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task InvokingAsync_WithNoMessages_ShouldReturnEmptyAsync() { @@ -345,7 +347,7 @@ public async Task InvokingAsync_WithNoMessages_ShouldReturnEmptyAsync() Assert.Empty(messages); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task InvokingAsync_WithConversationIsolation_ShouldOnlyReturnMessagesForConversationAsync() { @@ -389,7 +391,7 @@ public async Task InvokingAsync_WithConversationIsolation_ShouldOnlyReturnMessag #region Integration Tests - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task FullWorkflow_AddAndGet_ShouldWorkCorrectlyAsync() { @@ -440,7 +442,7 @@ public async Task FullWorkflow_AddAndGet_ShouldWorkCorrectlyAsync() #region Disposal Tests - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public void Dispose_AfterUse_ShouldNotThrow() { @@ -453,7 +455,7 @@ public void Dispose_AfterUse_ShouldNotThrow() provider.Dispose(); // Should not throw } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public void Dispose_MultipleCalls_ShouldNotThrow() { @@ -471,7 +473,7 @@ public void Dispose_MultipleCalls_ShouldNotThrow() #region Hierarchical Partitioning Tests - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public void Constructor_WithHierarchicalConnectionString_ShouldCreateInstance() { @@ -488,7 +490,7 @@ public void Constructor_WithHierarchicalConnectionString_ShouldCreateInstance() Assert.Equal(HierarchicalTestContainerId, provider.ContainerId); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public void Constructor_WithHierarchicalEndpoint_ShouldCreateInstance() { @@ -506,7 +508,7 @@ public void Constructor_WithHierarchicalEndpoint_ShouldCreateInstance() Assert.Equal(HierarchicalTestContainerId, provider.ContainerId); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public void Constructor_WithHierarchicalCosmosClient_ShouldCreateInstance() { @@ -523,7 +525,7 @@ public void Constructor_WithHierarchicalCosmosClient_ShouldCreateInstance() Assert.Equal(HierarchicalTestContainerId, provider.ContainerId); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public void State_WithEmptyConversationId_ShouldThrowArgumentException() { @@ -532,7 +534,7 @@ public void State_WithEmptyConversationId_ShouldThrowArgumentException() new CosmosChatHistoryProvider.State("")); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public void State_WithWhitespaceConversationId_ShouldThrowArgumentException() { @@ -541,7 +543,7 @@ public void State_WithWhitespaceConversationId_ShouldThrowArgumentException() new CosmosChatHistoryProvider.State(" ")); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task InvokedAsync_WithHierarchicalPartitioning_ShouldAddMessageWithMetadataAsync() { @@ -595,7 +597,7 @@ public async Task InvokedAsync_WithHierarchicalPartitioning_ShouldAddMessageWith Assert.Equal(SessionId, (string)document!.sessionId); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task InvokedAsync_WithHierarchicalMultipleMessages_ShouldAddAllMessagesAsync() { @@ -634,7 +636,7 @@ public async Task InvokedAsync_WithHierarchicalMultipleMessages_ShouldAddAllMess Assert.Equal("Third hierarchical message", messageList[2].Text); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task InvokingAsync_WithHierarchicalPartitionIsolation_ShouldIsolateMessagesByUserIdAsync() { @@ -680,7 +682,7 @@ public async Task InvokingAsync_WithHierarchicalPartitionIsolation_ShouldIsolate Assert.Equal("Message from user 2", messageList2[0].Text); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task StateBag_WithHierarchicalPartitioning_ShouldPreserveStateAcrossProviderInstancesAsync() { @@ -715,7 +717,7 @@ public async Task StateBag_WithHierarchicalPartitioning_ShouldPreserveStateAcros Assert.Equal(HierarchicalTestContainerId, newStore.ContainerId); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task HierarchicalAndSimplePartitioning_ShouldCoexistAsync() { @@ -757,7 +759,7 @@ public async Task HierarchicalAndSimplePartitioning_ShouldCoexistAsync() Assert.Equal("Hierarchical partitioning message", hierarchicalMessageList[0].Text); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task MaxMessagesToRetrieve_ShouldLimitAndReturnMostRecentAsync() { @@ -798,7 +800,7 @@ public async Task MaxMessagesToRetrieve_ShouldLimitAndReturnMostRecentAsync() Assert.Equal("Message 10", messageList[4].Text); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task MaxMessagesToRetrieve_Null_ShouldReturnAllMessagesAsync() { @@ -834,7 +836,7 @@ public async Task MaxMessagesToRetrieve_Null_ShouldReturnAllMessagesAsync() Assert.Equal("Message 10", messageList[9].Text); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task GetMessageCountAsync_WithMessages_ShouldReturnCorrectCountAsync() { @@ -866,7 +868,7 @@ public async Task GetMessageCountAsync_WithMessages_ShouldReturnCorrectCountAsyn Assert.Equal(5, count); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task GetMessageCountAsync_WithNoMessages_ShouldReturnZeroAsync() { @@ -885,7 +887,7 @@ public async Task GetMessageCountAsync_WithNoMessages_ShouldReturnZeroAsync() Assert.Equal(0, count); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task ClearMessagesAsync_WithMessages_ShouldDeleteAndReturnCountAsync() { @@ -933,7 +935,7 @@ public async Task ClearMessagesAsync_WithMessages_ShouldDeleteAndReturnCountAsyn Assert.Empty(retrievedMessages); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task ClearMessagesAsync_WithNoMessages_ShouldReturnZeroAsync() { @@ -956,7 +958,7 @@ public async Task ClearMessagesAsync_WithNoMessages_ShouldReturnZeroAsync() #region Message Filter Tests - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task InvokedAsync_DefaultFilter_ExcludesChatHistoryMessagesFromStorageAsync() { @@ -991,7 +993,7 @@ public async Task InvokedAsync_DefaultFilter_ExcludesChatHistoryMessagesFromStor Assert.Equal("Response", messages[2].Text); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task InvokedAsync_CustomStorageInputFilter_OverridesDefaultAsync() { @@ -1029,7 +1031,7 @@ public async Task InvokedAsync_CustomStorageInputFilter_OverridesDefaultAsync() Assert.Equal("Response", messages[1].Text); } - [SkippableFact] + [Fact] [Trait("Category", "CosmosDB")] public async Task InvokingAsync_RetrievalOutputFilter_FiltersRetrievedMessagesAsync() { diff --git a/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosCheckpointStoreTests.cs b/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosCheckpointStoreTests.cs index 4fa013b8d1..301b58bc49 100644 --- a/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosCheckpointStoreTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosCheckpointStoreTests.cs @@ -55,7 +55,7 @@ private static JsonSerializerOptions CreateJsonOptions() return options; } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { // Fail fast if emulator is not available this.SkipIfEmulatorNotAvailable(); @@ -88,8 +88,10 @@ await this._database.CreateContainerIfNotExistsAsync( } } - public async Task DisposeAsync() + public async ValueTask DisposeAsync() { + GC.SuppressFinalize(this); + if (this._cosmosClient != null && this._emulatorAvailable) { try @@ -124,12 +126,12 @@ private void SkipIfEmulatorNotAvailable() // Locally: Skip if emulator connection check failed var ciEmulatorAvailable = string.Equals(Environment.GetEnvironmentVariable("COSMOSDB_EMULATOR_AVAILABLE"), bool.TrueString, StringComparison.OrdinalIgnoreCase); - Xunit.Skip.If(!ciEmulatorAvailable && !this._emulatorAvailable, "Cosmos DB Emulator is not available"); + Assert.SkipWhen(!ciEmulatorAvailable && !this._emulatorAvailable, "Cosmos DB Emulator is not available"); } #region Constructor Tests - [SkippableFact] + [Fact] public void Constructor_WithCosmosClient_SetsProperties() { // Arrange @@ -143,7 +145,7 @@ public void Constructor_WithCosmosClient_SetsProperties() Assert.Equal(TestContainerId, store.ContainerId); } - [SkippableFact] + [Fact] public void Constructor_WithConnectionString_SetsProperties() { // Arrange @@ -157,7 +159,7 @@ public void Constructor_WithConnectionString_SetsProperties() Assert.Equal(TestContainerId, store.ContainerId); } - [SkippableFact] + [Fact] public void Constructor_WithNullCosmosClient_ThrowsArgumentNullException() { // Act & Assert @@ -165,7 +167,7 @@ public void Constructor_WithNullCosmosClient_ThrowsArgumentNullException() new CosmosCheckpointStore((CosmosClient)null!, s_testDatabaseId, TestContainerId)); } - [SkippableFact] + [Fact] public void Constructor_WithNullConnectionString_ThrowsArgumentException() { // Act & Assert @@ -177,7 +179,7 @@ public void Constructor_WithNullConnectionString_ThrowsArgumentException() #region Checkpoint Operations Tests - [SkippableFact] + [Fact] public async Task CreateCheckpointAsync_NewCheckpoint_CreatesSuccessfullyAsync() { this.SkipIfEmulatorNotAvailable(); @@ -197,7 +199,7 @@ public async Task CreateCheckpointAsync_NewCheckpoint_CreatesSuccessfullyAsync() Assert.NotEmpty(checkpointInfo.CheckpointId); } - [SkippableFact] + [Fact] public async Task RetrieveCheckpointAsync_ExistingCheckpoint_ReturnsCorrectValueAsync() { this.SkipIfEmulatorNotAvailable(); @@ -218,7 +220,7 @@ public async Task RetrieveCheckpointAsync_ExistingCheckpoint_ReturnsCorrectValue Assert.Equal("Hello, World!", messageProp.GetString()); } - [SkippableFact] + [Fact] public async Task RetrieveCheckpointAsync_NonExistentCheckpoint_ThrowsInvalidOperationExceptionAsync() { this.SkipIfEmulatorNotAvailable(); @@ -233,7 +235,7 @@ await Assert.ThrowsAsync(() => store.RetrieveCheckpointAsync(sessionId, fakeCheckpointInfo).AsTask()); } - [SkippableFact] + [Fact] public async Task RetrieveIndexAsync_EmptyStore_ReturnsEmptyCollectionAsync() { this.SkipIfEmulatorNotAvailable(); @@ -250,7 +252,7 @@ public async Task RetrieveIndexAsync_EmptyStore_ReturnsEmptyCollectionAsync() Assert.Empty(index); } - [SkippableFact] + [Fact] public async Task RetrieveIndexAsync_WithCheckpoints_ReturnsAllCheckpointsAsync() { this.SkipIfEmulatorNotAvailable(); @@ -275,7 +277,7 @@ public async Task RetrieveIndexAsync_WithCheckpoints_ReturnsAllCheckpointsAsync( Assert.Contains(index, c => c.CheckpointId == checkpoint3.CheckpointId); } - [SkippableFact] + [Fact] public async Task CreateCheckpointAsync_WithParent_CreatesHierarchyAsync() { this.SkipIfEmulatorNotAvailable(); @@ -295,7 +297,7 @@ public async Task CreateCheckpointAsync_WithParent_CreatesHierarchyAsync() Assert.Equal(sessionId, childCheckpoint.SessionId); } - [SkippableFact] + [Fact] public async Task RetrieveIndexAsync_WithParentFilter_ReturnsFilteredResultsAsync() { this.SkipIfEmulatorNotAvailable(); @@ -331,7 +333,7 @@ public async Task RetrieveIndexAsync_WithParentFilter_ReturnsFilteredResultsAsyn #region Run Isolation Tests - [SkippableFact] + [Fact] public async Task CheckpointOperations_DifferentRuns_IsolatesDataAsync() { this.SkipIfEmulatorNotAvailable(); @@ -361,7 +363,7 @@ public async Task CheckpointOperations_DifferentRuns_IsolatesDataAsync() #region Error Handling Tests - [SkippableFact] + [Fact] public async Task CreateCheckpointAsync_WithNullSessionId_ThrowsArgumentExceptionAsync() { this.SkipIfEmulatorNotAvailable(); @@ -375,7 +377,7 @@ await Assert.ThrowsAsync(() => store.CreateCheckpointAsync(null!, checkpointValue).AsTask()); } - [SkippableFact] + [Fact] public async Task CreateCheckpointAsync_WithEmptySessionId_ThrowsArgumentExceptionAsync() { this.SkipIfEmulatorNotAvailable(); @@ -389,7 +391,7 @@ await Assert.ThrowsAsync(() => store.CreateCheckpointAsync("", checkpointValue).AsTask()); } - [SkippableFact] + [Fact] public async Task RetrieveCheckpointAsync_WithNullCheckpointInfo_ThrowsArgumentNullExceptionAsync() { this.SkipIfEmulatorNotAvailable(); @@ -407,7 +409,7 @@ await Assert.ThrowsAsync(() => #region Disposal Tests - [SkippableFact] + [Fact] public async Task Dispose_AfterDisposal_ThrowsObjectDisposedExceptionAsync() { this.SkipIfEmulatorNotAvailable(); @@ -424,7 +426,7 @@ await Assert.ThrowsAsync(() => store.CreateCheckpointAsync("test-run", checkpointValue).AsTask()); } - [SkippableFact] + [Fact] public void Dispose_MultipleCalls_DoesNotThrow() { this.SkipIfEmulatorNotAvailable(); diff --git a/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/Microsoft.Agents.AI.CosmosNoSql.UnitTests.csproj b/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/Microsoft.Agents.AI.CosmosNoSql.UnitTests.csproj index 78072b8b6a..0103c23028 100644 --- a/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/Microsoft.Agents.AI.CosmosNoSql.UnitTests.csproj +++ b/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/Microsoft.Agents.AI.CosmosNoSql.UnitTests.csproj @@ -17,7 +17,6 @@ - diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/AgentEntityTests.cs b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/AgentEntityTests.cs index fe20b2e843..e8c17cdfc9 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/AgentEntityTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/AgentEntityTests.cs @@ -9,7 +9,6 @@ using Microsoft.DurableTask.Entities; using Microsoft.Extensions.Configuration; using OpenAI.Chat; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.DurableTask.IntegrationTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ConsoleAppSamplesValidation.cs b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ConsoleAppSamplesValidation.cs index d49614868f..af14a4c8f4 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ConsoleAppSamplesValidation.cs +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ConsoleAppSamplesValidation.cs @@ -6,7 +6,6 @@ using System.Text; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.DurableTask.IntegrationTests; @@ -30,7 +29,7 @@ public sealed class ConsoleAppSamplesValidation(ITestOutputHelper outputHelper) private readonly ITestOutputHelper _outputHelper = outputHelper; - async Task IAsyncLifetime.InitializeAsync() + async ValueTask IAsyncLifetime.InitializeAsync() { if (!s_infrastructureStarted) { @@ -39,7 +38,7 @@ async Task IAsyncLifetime.InitializeAsync() } } - async Task IAsyncLifetime.DisposeAsync() + async ValueTask IAsyncDisposable.DisposeAsync() { // Nothing to clean up await Task.CompletedTask; @@ -736,6 +735,9 @@ private async Task IsRedisRunningAsync() private async Task RunSampleTestAsync(string samplePath, Func, Task> testAction) { + // Build the sample project first (it may not have been built as part of the solution) + await this.BuildSampleAsync(samplePath); + // Generate a unique TaskHub name for this sample test to prevent cross-test interference // when multiple tests run together and share the same DTS emulator. string uniqueTaskHubName = $"sample-{Guid.NewGuid().ToString("N").Substring(0, 6)}"; @@ -814,12 +816,44 @@ private async Task WriteInputAsync(Process process, string input, CancellationTo return null; } + private async Task BuildSampleAsync(string samplePath) + { + this._outputHelper.WriteLine($"Building sample at {samplePath}..."); + + ProcessStartInfo buildInfo = new() + { + FileName = "dotnet", + Arguments = $"build --framework {s_dotnetTargetFramework}", + WorkingDirectory = samplePath, + UseShellExecute = false, + RedirectStandardOutput = true, + RedirectStandardError = true, + }; + + using Process buildProcess = new() { StartInfo = buildInfo }; + buildProcess.Start(); + + // Read both streams asynchronously to avoid deadlocks from filled pipe buffers + Task stdoutTask = buildProcess.StandardOutput.ReadToEndAsync(); + Task stderrTask = buildProcess.StandardError.ReadToEndAsync(); + await buildProcess.WaitForExitAsync(); + + string stderr = await stderrTask; + if (buildProcess.ExitCode != 0) + { + string stdout = await stdoutTask; + throw new InvalidOperationException($"Failed to build sample at {samplePath}:\n{stdout}\n{stderr}"); + } + + this._outputHelper.WriteLine($"Build completed for {samplePath}."); + } + private Process StartConsoleApp(string samplePath, BlockingCollection logs, string taskHubName) { ProcessStartInfo startInfo = new() { FileName = "dotnet", - Arguments = $"run --framework {s_dotnetTargetFramework}", + Arguments = $"run --no-build --framework {s_dotnetTargetFramework}", WorkingDirectory = samplePath, UseShellExecute = false, RedirectStandardOutput = true, diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ExternalClientTests.cs b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ExternalClientTests.cs index d48e8c0c28..0e35d29750 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ExternalClientTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ExternalClientTests.cs @@ -9,7 +9,6 @@ using Microsoft.Extensions.AI; using Microsoft.Extensions.Configuration; using OpenAI.Chat; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.DurableTask.IntegrationTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/Logging/TestLogger.cs b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/Logging/TestLogger.cs index ca80b8cf7b..764d9cb24c 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/Logging/TestLogger.cs +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/Logging/TestLogger.cs @@ -2,7 +2,6 @@ using System.Collections.Concurrent; using Microsoft.Extensions.Logging; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.DurableTask.IntegrationTests.Logging; diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/Logging/TestLoggerProvider.cs b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/Logging/TestLoggerProvider.cs index 7019852e5e..57fbc4e4db 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/Logging/TestLoggerProvider.cs +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/Logging/TestLoggerProvider.cs @@ -2,7 +2,6 @@ using System.Collections.Concurrent; using Microsoft.Extensions.Logging; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.DurableTask.IntegrationTests.Logging; diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/OrchestrationTests.cs b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/OrchestrationTests.cs index 641cb57dc8..753d57f160 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/OrchestrationTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/OrchestrationTests.cs @@ -7,7 +7,6 @@ using Microsoft.Extensions.AI; using Microsoft.Extensions.Configuration; using OpenAI.Chat; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.DurableTask.IntegrationTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/TestHelper.cs b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/TestHelper.cs index 295277021b..e092db9e8d 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/TestHelper.cs +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/TestHelper.cs @@ -14,7 +14,6 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using OpenAI.Chat; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.DurableTask.IntegrationTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/TimeToLiveTests.cs b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/TimeToLiveTests.cs index f9f008c1c2..4c21817a6d 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/TimeToLiveTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/TimeToLiveTests.cs @@ -7,7 +7,6 @@ using Microsoft.DurableTask.Client.Entities; using Microsoft.Extensions.Configuration; using OpenAI.Chat; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.DurableTask.IntegrationTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.Hosting.AGUI.AspNetCore.IntegrationTests/ToolCallingTests.cs b/dotnet/tests/Microsoft.Agents.AI.Hosting.AGUI.AspNetCore.IntegrationTests/ToolCallingTests.cs index d512af28cd..3da741851d 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Hosting.AGUI.AspNetCore.IntegrationTests/ToolCallingTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Hosting.AGUI.AspNetCore.IntegrationTests/ToolCallingTests.cs @@ -16,7 +16,6 @@ using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.AI; using Microsoft.Extensions.DependencyInjection; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Hosting.AGUI.AspNetCore.IntegrationTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs index 173cea189f..c7004e6ba5 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs @@ -8,7 +8,6 @@ using Microsoft.Extensions.Logging; using ModelContextProtocol.Client; using ModelContextProtocol.Protocol; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests; @@ -36,7 +35,7 @@ public sealed class SamplesValidation(ITestOutputHelper outputHelper) : IAsyncLi private readonly ITestOutputHelper _outputHelper = outputHelper; - async Task IAsyncLifetime.InitializeAsync() + async ValueTask IAsyncLifetime.InitializeAsync() { if (!s_infrastructureStarted) { @@ -45,7 +44,7 @@ async Task IAsyncLifetime.InitializeAsync() } } - async Task IAsyncLifetime.DisposeAsync() + async ValueTask IAsyncDisposable.DisposeAsync() { // Nothing to clean up await Task.CompletedTask; @@ -793,6 +792,9 @@ private async Task WaitForConditionAsync(Func> condition, string mess private async Task RunSampleTestAsync(string samplePath, Func, Task> testAction) { + // Build the sample project first (it may not have been built as part of the solution) + await this.BuildSampleAsync(samplePath); + // Start the Azure Functions app List logsContainer = []; using Process funcProcess = this.StartFunctionApp(samplePath, logsContainer); @@ -812,12 +814,44 @@ private async Task RunSampleTestAsync(string samplePath, Func stdoutTask = buildProcess.StandardOutput.ReadToEndAsync(); + Task stderrTask = buildProcess.StandardError.ReadToEndAsync(); + await buildProcess.WaitForExitAsync(); + + string stderr = await stderrTask; + if (buildProcess.ExitCode != 0) + { + string stdout = await stdoutTask; + throw new InvalidOperationException($"Failed to build sample at {samplePath}:\n{stdout}\n{stderr}"); + } + + this._outputHelper.WriteLine($"Build completed for {samplePath}."); + } + private Process StartFunctionApp(string samplePath, List logs) { ProcessStartInfo startInfo = new() { FileName = "dotnet", - Arguments = $"run -f {s_dotnetTargetFramework} --port {AzureFunctionsPort}", + Arguments = $"run --no-build -f {s_dotnetTargetFramework} --port {AzureFunctionsPort}", WorkingDirectory = samplePath, UseShellExecute = false, RedirectStandardOutput = true, diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/AzureAgentProviderTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/AzureAgentProviderTest.cs index da3f6f2fd5..562ce8abda 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/AzureAgentProviderTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/AzureAgentProviderTest.cs @@ -5,7 +5,6 @@ using Azure.Identity; using Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Framework; using Microsoft.Extensions.AI; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/DeclarativeCodeGenTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/DeclarativeCodeGenTest.cs index 93623d40ca..459144a514 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/DeclarativeCodeGenTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/DeclarativeCodeGenTest.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Framework; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/DeclarativeWorkflowTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/DeclarativeWorkflowTest.cs index 8757ff1f3f..c6a328d73d 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/DeclarativeWorkflowTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/DeclarativeWorkflowTest.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Agents; using Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Framework; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/IntegrationTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/IntegrationTest.cs index 470de21166..59f2dd51ed 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/IntegrationTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/IntegrationTest.cs @@ -5,13 +5,11 @@ using System.Reflection; using System.Threading.Tasks; using Azure.Identity; -using Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Agents; using Microsoft.Agents.AI.Workflows.Declarative.PowerFx; using Microsoft.Agents.ObjectModel; using Microsoft.Extensions.AI; using Microsoft.Extensions.Configuration; using Shared.IntegrationTests; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Framework; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/TestOutputAdapter.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/TestOutputAdapter.cs index e1a0857c85..5acc3e5c02 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/TestOutputAdapter.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/TestOutputAdapter.cs @@ -5,7 +5,6 @@ using System.IO; using System.Text; using Microsoft.Extensions.Logging; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Framework; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/WorkflowTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/WorkflowTest.cs index 151e9fc70c..0333bf4d1c 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/WorkflowTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/WorkflowTest.cs @@ -8,7 +8,6 @@ using System.Text.Json.Serialization; using System.Threading.Tasks; using Microsoft.Extensions.AI; -using Xunit.Abstractions; using Xunit.Sdk; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Framework; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/FunctionCallingWorkflowTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/FunctionCallingWorkflowTest.cs index 63e052481a..17b9514ee4 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/FunctionCallingWorkflowTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/FunctionCallingWorkflowTest.cs @@ -11,7 +11,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Framework; using Microsoft.Agents.AI.Workflows.Declarative.Kit; using Microsoft.Extensions.AI; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/InvokeToolWorkflowTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/InvokeToolWorkflowTest.cs index 359d9389a6..9d5efa6b6d 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/InvokeToolWorkflowTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/InvokeToolWorkflowTest.cs @@ -12,7 +12,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.Kit; using Microsoft.Agents.AI.Workflows.Declarative.Mcp; using Microsoft.Extensions.AI; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/MediaInputTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/MediaInputTest.cs index da30db6f98..60c4915579 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/MediaInputTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/MediaInputTest.cs @@ -9,7 +9,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Framework; using Microsoft.Extensions.AI; using OpenAI.Files; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/AddConversationMessageTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/AddConversationMessageTemplateTest.cs index d62bb8556c..786563d688 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/AddConversationMessageTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/AddConversationMessageTemplateTest.cs @@ -5,7 +5,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.CodeGen; using Microsoft.Agents.AI.Workflows.Declarative.Kit; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/BreakLoopTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/BreakLoopTemplateTest.cs index a3e202b60a..2960718256 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/BreakLoopTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/BreakLoopTemplateTest.cs @@ -2,7 +2,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.CodeGen; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ClearAllVariablesTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ClearAllVariablesTemplateTest.cs index a7abb63ee4..be7ea25eab 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ClearAllVariablesTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ClearAllVariablesTemplateTest.cs @@ -3,7 +3,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.CodeGen; using Microsoft.Agents.AI.Workflows.Declarative.Kit; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ConditionGroupTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ConditionGroupTemplateTest.cs index 0d3c47089e..af0166c44e 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ConditionGroupTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ConditionGroupTemplateTest.cs @@ -3,7 +3,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.CodeGen; using Microsoft.Agents.AI.Workflows.Declarative.Kit; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ContinueLoopTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ContinueLoopTemplateTest.cs index 19e4a41d2c..9210460701 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ContinueLoopTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ContinueLoopTemplateTest.cs @@ -2,7 +2,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.CodeGen; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/CopyConversationMessagesTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/CopyConversationMessagesTemplateTest.cs index 438f793b0e..5f005b6b3b 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/CopyConversationMessagesTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/CopyConversationMessagesTemplateTest.cs @@ -3,7 +3,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.CodeGen; using Microsoft.Agents.AI.Workflows.Declarative.Kit; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/CreateConversationTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/CreateConversationTemplateTest.cs index 9991a1a827..c4c0fd4458 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/CreateConversationTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/CreateConversationTemplateTest.cs @@ -5,7 +5,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.Extensions; using Microsoft.Agents.AI.Workflows.Declarative.Kit; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/DeclarativeEjectionTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/DeclarativeEjectionTest.cs index 6f87f77fb4..0c6ac9efe7 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/DeclarativeEjectionTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/DeclarativeEjectionTest.cs @@ -4,7 +4,6 @@ using System.IO; using System.Threading.Tasks; using Shared.Code; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/EdgeTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/EdgeTemplateTest.cs index ead2ca742a..10633f4581 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/EdgeTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/EdgeTemplateTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using Microsoft.Agents.AI.Workflows.Declarative.CodeGen; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/EndConversationTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/EndConversationTest.cs index c38036e777..75d2cc7b80 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/EndConversationTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/EndConversationTest.cs @@ -2,7 +2,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.CodeGen; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/EndDialogTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/EndDialogTest.cs index 59065665c3..aea9b76833 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/EndDialogTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/EndDialogTest.cs @@ -2,7 +2,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.CodeGen; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ForeachTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ForeachTemplateTest.cs index aaafa5bfb3..d6e924c262 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ForeachTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ForeachTemplateTest.cs @@ -4,7 +4,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.Kit; using Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/GotoTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/GotoTemplateTest.cs index b4aefadb68..1c9c2c26ad 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/GotoTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/GotoTemplateTest.cs @@ -2,7 +2,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.CodeGen; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/InvokeAzureAgentTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/InvokeAzureAgentTemplateTest.cs index 34acf37702..8642270726 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/InvokeAzureAgentTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/InvokeAzureAgentTemplateTest.cs @@ -3,7 +3,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.CodeGen; using Microsoft.Agents.AI.Workflows.Declarative.Kit; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ProviderTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ProviderTemplateTest.cs index fcaabcb4a1..28ae9a0314 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ProviderTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ProviderTemplateTest.cs @@ -2,7 +2,6 @@ using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows.Declarative.CodeGen; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ResetVariableTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ResetVariableTemplateTest.cs index 1ffd3e16ef..b34126c5be 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ResetVariableTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/ResetVariableTemplateTest.cs @@ -3,7 +3,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.CodeGen; using Microsoft.Agents.AI.Workflows.Declarative.Kit; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/RetrieveConversationMessageTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/RetrieveConversationMessageTemplateTest.cs index 093a43ffa5..153cb95ea4 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/RetrieveConversationMessageTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/RetrieveConversationMessageTemplateTest.cs @@ -3,7 +3,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.CodeGen; using Microsoft.Agents.AI.Workflows.Declarative.Kit; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/RetrieveConversationMessagesTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/RetrieveConversationMessagesTemplateTest.cs index 1c3f5c20f5..30988ef019 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/RetrieveConversationMessagesTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/RetrieveConversationMessagesTemplateTest.cs @@ -3,7 +3,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.CodeGen; using Microsoft.Agents.AI.Workflows.Declarative.Kit; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/SetMultipleVariablesTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/SetMultipleVariablesTemplateTest.cs index 5dd05c8bac..91387705e0 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/SetMultipleVariablesTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/SetMultipleVariablesTemplateTest.cs @@ -4,7 +4,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.Kit; using Microsoft.Agents.ObjectModel; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/SetTextVariableTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/SetTextVariableTemplateTest.cs index 4638ee0c8b..9a503394de 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/SetTextVariableTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/SetTextVariableTemplateTest.cs @@ -3,7 +3,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.CodeGen; using Microsoft.Agents.AI.Workflows.Declarative.Kit; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/SetVariableTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/SetVariableTemplateTest.cs index c71c57486e..64f8a1b6a8 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/SetVariableTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/SetVariableTemplateTest.cs @@ -4,7 +4,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.Kit; using Microsoft.Agents.ObjectModel; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/WorkflowActionTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/WorkflowActionTemplateTest.cs index 2f6cedb6dd..6ae2a4b45e 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/WorkflowActionTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/WorkflowActionTemplateTest.cs @@ -3,7 +3,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.Extensions; using Microsoft.Agents.AI.Workflows.Declarative.Kit; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.CodeGen; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowExceptionTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowExceptionTest.cs index cbe3ac0a81..099c09c27d 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowExceptionTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowExceptionTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowTest.cs index 09c984ca05..6c61d6cb7d 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowTest.cs @@ -12,7 +12,6 @@ using Microsoft.Agents.ObjectModel; using Microsoft.Extensions.AI; using Moq; -using Xunit.Abstractions; using Xunit.Sdk; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Entities/EntityExtractionResultTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Entities/EntityExtractionResultTest.cs index 50cff90b3e..d2c545516e 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Entities/EntityExtractionResultTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Entities/EntityExtractionResultTest.cs @@ -2,7 +2,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.Entities; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.Entities; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Entities/EntityExtractorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Entities/EntityExtractorTest.cs index b03700d215..4a677eb362 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Entities/EntityExtractorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Entities/EntityExtractorTest.cs @@ -4,7 +4,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.Entities; using Microsoft.Agents.ObjectModel; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.Entities; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Events/EventTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Events/EventTest.cs index a4965ebc61..9133471553 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Events/EventTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Events/EventTest.cs @@ -3,7 +3,6 @@ using System.Linq; using System.Text.Json; using Microsoft.Extensions.AI; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Events/ExternalInputRequestTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Events/ExternalInputRequestTest.cs index d1165d84d4..cebdc60cb9 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Events/ExternalInputRequestTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Events/ExternalInputRequestTest.cs @@ -2,7 +2,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.Events; using Microsoft.Extensions.AI; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.Events; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Events/ExternalInputResponseTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Events/ExternalInputResponseTest.cs index b1fb358727..384664a68c 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Events/ExternalInputResponseTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Events/ExternalInputResponseTest.cs @@ -2,7 +2,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.Events; using Microsoft.Extensions.AI; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.Events; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Interpreter/WorkflowModelTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Interpreter/WorkflowModelTest.cs index 95d738f8f0..03a5bb670f 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Interpreter/WorkflowModelTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Interpreter/WorkflowModelTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using Microsoft.Agents.AI.Workflows.Declarative.Interpreter; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.Interpreter; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/AddConversationMessageExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/AddConversationMessageExecutorTest.cs index a7f2ba48f6..2f89de4dee 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/AddConversationMessageExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/AddConversationMessageExecutorTest.cs @@ -9,7 +9,6 @@ using Microsoft.Agents.ObjectModel; using Microsoft.Extensions.AI; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ClearAllVariablesExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ClearAllVariablesExecutorTest.cs index 70e4ac0a02..cc18bcb463 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ClearAllVariablesExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ClearAllVariablesExecutorTest.cs @@ -4,7 +4,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; using Microsoft.Agents.ObjectModel; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ConditionGroupExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ConditionGroupExecutorTest.cs index caf7344467..910af1ca64 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ConditionGroupExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ConditionGroupExecutorTest.cs @@ -4,7 +4,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.Kit; using Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/CopyConversationMessagesExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/CopyConversationMessagesExecutorTest.cs index cb818fec15..c0a2fdf659 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/CopyConversationMessagesExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/CopyConversationMessagesExecutorTest.cs @@ -9,7 +9,6 @@ using Microsoft.Agents.ObjectModel; using Microsoft.Extensions.AI; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/CreateConversationExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/CreateConversationExecutorTest.cs index a8c8f799b2..5c00fbcdda 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/CreateConversationExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/CreateConversationExecutorTest.cs @@ -6,7 +6,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.PowerFx; using Microsoft.Agents.ObjectModel; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/DefaultActionExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/DefaultActionExecutorTest.cs index 0e7f0a4558..e10f0b0d92 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/DefaultActionExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/DefaultActionExecutorTest.cs @@ -3,7 +3,6 @@ using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/EditTableExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/EditTableExecutorTest.cs index 6c422247f1..ad9d51c2fe 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/EditTableExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/EditTableExecutorTest.cs @@ -7,7 +7,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; using Microsoft.Agents.ObjectModel; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/EditTableV2ExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/EditTableV2ExecutorTest.cs index 5eb723ae0e..bb4442507c 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/EditTableV2ExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/EditTableV2ExecutorTest.cs @@ -5,7 +5,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; using Microsoft.Agents.ObjectModel; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ForeachExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ForeachExecutorTest.cs index 44989ad8a1..7840910d5b 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ForeachExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ForeachExecutorTest.cs @@ -5,7 +5,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; using Microsoft.Agents.ObjectModel; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/InvokeFunctionToolExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/InvokeFunctionToolExecutorTest.cs index 4a07ba3002..b00339ea3b 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/InvokeFunctionToolExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/InvokeFunctionToolExecutorTest.cs @@ -6,7 +6,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.PowerFx; using Microsoft.Agents.ObjectModel; using Microsoft.Extensions.AI; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/InvokeMcpToolExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/InvokeMcpToolExecutorTest.cs index 2cad0029ff..45b0b3c7b7 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/InvokeMcpToolExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/InvokeMcpToolExecutorTest.cs @@ -10,7 +10,6 @@ using Microsoft.Agents.ObjectModel; using Microsoft.Extensions.AI; using Moq; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ParseValueExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ParseValueExecutorTest.cs index 22854c90e8..01c6944654 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ParseValueExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ParseValueExecutorTest.cs @@ -4,7 +4,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; using Microsoft.Agents.ObjectModel; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/QuestionExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/QuestionExecutorTest.cs index b2713037bc..dbe056f891 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/QuestionExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/QuestionExecutorTest.cs @@ -12,7 +12,6 @@ using Microsoft.Extensions.AI; using Microsoft.PowerFx.Types; using Moq; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/RequestExternalInputExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/RequestExternalInputExecutorTest.cs index 778a6dd7b7..1e11f1a0ae 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/RequestExternalInputExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/RequestExternalInputExecutorTest.cs @@ -12,7 +12,6 @@ using Microsoft.Extensions.AI; using Microsoft.PowerFx.Types; using Moq; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ResetVariableExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ResetVariableExecutorTest.cs index 9059780751..022d84bbfe 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ResetVariableExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ResetVariableExecutorTest.cs @@ -4,7 +4,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; using Microsoft.Agents.ObjectModel; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/RetrieveConversationMessageExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/RetrieveConversationMessageExecutorTest.cs index e3812100ee..622b54d1b2 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/RetrieveConversationMessageExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/RetrieveConversationMessageExecutorTest.cs @@ -6,7 +6,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; using Microsoft.Agents.ObjectModel; using Microsoft.Extensions.AI; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/RetrieveConversationMessagesExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/RetrieveConversationMessagesExecutorTest.cs index cbdfc2056d..7b726ccb23 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/RetrieveConversationMessagesExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/RetrieveConversationMessagesExecutorTest.cs @@ -4,7 +4,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.Extensions; using Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/SendActivityExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/SendActivityExecutorTest.cs index 32cadc6c4e..8ae95d0eb5 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/SendActivityExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/SendActivityExecutorTest.cs @@ -3,7 +3,6 @@ using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/SetMultipleVariablesExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/SetMultipleVariablesExecutorTest.cs index 037ee5b94a..467a20044e 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/SetMultipleVariablesExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/SetMultipleVariablesExecutorTest.cs @@ -5,7 +5,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; using Microsoft.Agents.ObjectModel; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/SetTextVariableExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/SetTextVariableExecutorTest.cs index 0bc850e9ce..f15a315eab 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/SetTextVariableExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/SetTextVariableExecutorTest.cs @@ -4,7 +4,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; using Microsoft.Agents.ObjectModel; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/SetVariableExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/SetVariableExecutorTest.cs index dddfab6365..4f4bb39856 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/SetVariableExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/SetVariableExecutorTest.cs @@ -4,7 +4,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; using Microsoft.Agents.ObjectModel; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/WorkflowActionExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/WorkflowActionExecutorTest.cs index 6c87668bbf..de5487c79b 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/WorkflowActionExecutorTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/WorkflowActionExecutorTest.cs @@ -10,7 +10,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.PowerFx; using Microsoft.Agents.ObjectModel; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; using Xunit.Sdk; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.ObjectModel; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/PowerFx/RecalcEngineFactoryTests.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/PowerFx/RecalcEngineFactoryTests.cs index 976ad796b9..d158ca552b 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/PowerFx/RecalcEngineFactoryTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/PowerFx/RecalcEngineFactoryTests.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using Microsoft.Agents.AI.Workflows.Declarative.PowerFx; using Microsoft.PowerFx; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.PowerFx; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/PowerFx/RecalcEngineTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/PowerFx/RecalcEngineTest.cs index eeaefaf669..c509259fe1 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/PowerFx/RecalcEngineTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/PowerFx/RecalcEngineTest.cs @@ -2,7 +2,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.PowerFx; using Microsoft.PowerFx; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.PowerFx; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/PowerFx/TemplateExtensionsTests.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/PowerFx/TemplateExtensionsTests.cs index 9bbbc39f42..de7f045052 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/PowerFx/TemplateExtensionsTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/PowerFx/TemplateExtensionsTests.cs @@ -4,7 +4,6 @@ using Microsoft.Agents.AI.Workflows.Declarative.Extensions; using Microsoft.Agents.ObjectModel; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.PowerFx; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/PowerFx/WorkflowExpressionEngineTests.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/PowerFx/WorkflowExpressionEngineTests.cs index 2aaa016141..ebaaf5d046 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/PowerFx/WorkflowExpressionEngineTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/PowerFx/WorkflowExpressionEngineTests.cs @@ -8,7 +8,6 @@ using Microsoft.Agents.ObjectModel.Abstractions; using Microsoft.Agents.ObjectModel.Exceptions; using Microsoft.PowerFx.Types; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests.PowerFx; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/TestOutputAdapter.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/TestOutputAdapter.cs index 72da232da9..e4d756a24a 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/TestOutputAdapter.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/TestOutputAdapter.cs @@ -5,7 +5,6 @@ using System.IO; using System.Text; using Microsoft.Extensions.Logging; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/WorkflowTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/WorkflowTest.cs index c8805b606c..1e6704b1f6 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/WorkflowTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/WorkflowTest.cs @@ -3,7 +3,6 @@ using System; using Microsoft.Agents.AI.Workflows.Declarative.PowerFx; using Microsoft.Agents.ObjectModel; -using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests; diff --git a/dotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantFixture.cs b/dotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantFixture.cs index b2ae9b81e8..f679da04aa 100644 --- a/dotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantFixture.cs +++ b/dotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantFixture.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. +using System; using System.Collections.Generic; using System.Threading.Tasks; using AgentConformance.IntegrationTests; @@ -77,7 +78,7 @@ public Task DeleteSessionAsync(AgentSession session) return Task.CompletedTask; } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var client = new OpenAIClient(TestConfiguration.GetRequiredValue(TestSettings.OpenAIApiKey)); this._assistantClient = client.GetAssistantClient(); @@ -85,13 +86,15 @@ public async Task InitializeAsync() this._agent = await this.CreateChatClientAgentAsync(); } - public Task DisposeAsync() + public ValueTask DisposeAsync() { + GC.SuppressFinalize(this); + if (this._assistantClient is not null && this._agent is not null) { - return this._assistantClient.DeleteAssistantAsync(this._agent.Id); + return new ValueTask(this._assistantClient.DeleteAssistantAsync(this._agent.Id)); } - return Task.CompletedTask; + return default; } } diff --git a/dotnet/tests/OpenAIChatCompletion.IntegrationTests/OpenAIChatCompletionFixture.cs b/dotnet/tests/OpenAIChatCompletion.IntegrationTests/OpenAIChatCompletionFixture.cs index b8a9388b27..4e3bd7e3b0 100644 --- a/dotnet/tests/OpenAIChatCompletion.IntegrationTests/OpenAIChatCompletionFixture.cs +++ b/dotnet/tests/OpenAIChatCompletion.IntegrationTests/OpenAIChatCompletionFixture.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -63,9 +64,12 @@ public Task DeleteSessionAsync(AgentSession session) => // Chat Completion does not require/support deleting threads, so this is a no-op. Task.CompletedTask; - public async Task InitializeAsync() => + public async ValueTask InitializeAsync() => this._agent = await this.CreateChatClientAgentAsync(); - public Task DisposeAsync() => - Task.CompletedTask; + public ValueTask DisposeAsync() + { + GC.SuppressFinalize(this); + return default; + } } diff --git a/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseChatClientAgentRunStreamingTests.cs b/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseChatClientAgentRunStreamingTests.cs index 80a148d7fc..737abd2561 100644 --- a/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseChatClientAgentRunStreamingTests.cs +++ b/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseChatClientAgentRunStreamingTests.cs @@ -9,16 +9,20 @@ namespace ResponseResult.IntegrationTests; { private const string SkipReason = "ResponseResult does not support empty messages"; - [Fact(Skip = SkipReason)] - public override Task RunWithInstructionsAndNoMessageReturnsExpectedResultAsync() => - Task.CompletedTask; + public override Task RunWithInstructionsAndNoMessageReturnsExpectedResultAsync() + { + Assert.Skip(SkipReason); + return base.RunWithInstructionsAndNoMessageReturnsExpectedResultAsync(); + } } public class OpenAIResponseStoreFalseChatClientAgentRunStreamingTests() : ChatClientAgentRunStreamingTests(() => new(store: false)) { private const string SkipReason = "ResponseResult does not support empty messages"; - [Fact(Skip = SkipReason)] - public override Task RunWithInstructionsAndNoMessageReturnsExpectedResultAsync() => - Task.CompletedTask; + public override Task RunWithInstructionsAndNoMessageReturnsExpectedResultAsync() + { + Assert.Skip(SkipReason); + return base.RunWithInstructionsAndNoMessageReturnsExpectedResultAsync(); + } } diff --git a/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseChatClientAgentRunTests.cs b/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseChatClientAgentRunTests.cs index 8b742e2964..58463212bd 100644 --- a/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseChatClientAgentRunTests.cs +++ b/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseChatClientAgentRunTests.cs @@ -9,16 +9,20 @@ namespace ResponseResult.IntegrationTests; { private const string SkipReason = "ResponseResult does not support empty messages"; - [Fact(Skip = SkipReason)] - public override Task RunWithInstructionsAndNoMessageReturnsExpectedResultAsync() => - Task.CompletedTask; + public override Task RunWithInstructionsAndNoMessageReturnsExpectedResultAsync() + { + Assert.Skip(SkipReason); + return base.RunWithInstructionsAndNoMessageReturnsExpectedResultAsync(); + } } public class OpenAIResponseStoreFalseChatClientAgentRunTests() : ChatClientAgentRunTests(() => new(store: false)) { private const string SkipReason = "ResponseResult does not support empty messages"; - [Fact(Skip = SkipReason)] - public override Task RunWithInstructionsAndNoMessageReturnsExpectedResultAsync() => - Task.CompletedTask; + public override Task RunWithInstructionsAndNoMessageReturnsExpectedResultAsync() + { + Assert.Skip(SkipReason); + return base.RunWithInstructionsAndNoMessageReturnsExpectedResultAsync(); + } } diff --git a/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseFixture.cs b/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseFixture.cs index 515703c21c..74c7ef9041 100644 --- a/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseFixture.cs +++ b/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseFixture.cs @@ -94,7 +94,7 @@ public Task DeleteSessionAsync(AgentSession session) => // Chat Completion does not require/support deleting threads, so this is a no-op. Task.CompletedTask; - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { this._openAIResponseClient = new OpenAIClient(TestConfiguration.GetRequiredValue(TestSettings.OpenAIApiKey)) .GetResponsesClient(TestConfiguration.GetRequiredValue(TestSettings.OpenAIChatModelName)); @@ -102,5 +102,9 @@ public async Task InitializeAsync() this._agent = await this.CreateChatClientAgentAsync(); } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() + { + GC.SuppressFinalize(this); + return default; + } } diff --git a/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseRunStreamingTests.cs b/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseRunStreamingTests.cs index c12f8f2db5..75c337bd5a 100644 --- a/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseRunStreamingTests.cs +++ b/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseRunStreamingTests.cs @@ -8,16 +8,21 @@ namespace ResponseResult.IntegrationTests; public class OpenAIResponseStoreTrueRunStreamingTests() : RunStreamingTests(() => new(store: true)) { private const string SkipReason = "ResponseResult does not support empty messages"; - [Fact(Skip = SkipReason)] - public override Task RunWithNoMessageDoesNotFailAsync() => - Task.CompletedTask; + + public override Task RunWithNoMessageDoesNotFailAsync() + { + Assert.Skip(SkipReason); + return base.RunWithNoMessageDoesNotFailAsync(); + } } public class OpenAIResponseStoreFalseRunStreamingTests() : RunStreamingTests(() => new(store: false)) { private const string SkipReason = "ResponseResult does not support empty messages"; - [Fact(Skip = SkipReason)] - public override Task RunWithNoMessageDoesNotFailAsync() => - Task.CompletedTask; + public override Task RunWithNoMessageDoesNotFailAsync() + { + Assert.Skip(SkipReason); + return base.RunWithNoMessageDoesNotFailAsync(); + } } diff --git a/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseRunTests.cs b/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseRunTests.cs index 423ac583c7..df4962b640 100644 --- a/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseRunTests.cs +++ b/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseRunTests.cs @@ -8,16 +8,21 @@ namespace ResponseResult.IntegrationTests; public class OpenAIResponseStoreTrueRunTests() : RunTests(() => new(store: true)) { private const string SkipReason = "ResponseResult does not support empty messages"; - [Fact(Skip = SkipReason)] - public override Task RunWithNoMessageDoesNotFailAsync() => - Task.CompletedTask; + + public override Task RunWithNoMessageDoesNotFailAsync() + { + Assert.Skip(SkipReason); + return base.RunWithNoMessageDoesNotFailAsync(); + } } public class OpenAIResponseStoreFalseRunTests() : RunTests(() => new(store: false)) { private const string SkipReason = "ResponseResult does not support empty messages"; - [Fact(Skip = SkipReason)] - public override Task RunWithNoMessageDoesNotFailAsync() => - Task.CompletedTask; + public override Task RunWithNoMessageDoesNotFailAsync() + { + Assert.Skip(SkipReason); + return base.RunWithNoMessageDoesNotFailAsync(); + } } diff --git a/dotnet/tests/coverage.runsettings b/dotnet/tests/coverage.runsettings new file mode 100644 index 0000000000..c59039e263 --- /dev/null +++ b/dotnet/tests/coverage.runsettings @@ -0,0 +1,21 @@ + + + + + + + + + + + ^System\.CodeDom\.Compiler\.GeneratedCodeAttribute$ + ^System\.Runtime\.CompilerServices\.CompilerGeneratedAttribute$ + ^System\.Diagnostics\.CodeAnalysis\.ExcludeFromCodeCoverageAttribute$ + + + + + + + +