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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@
Starting with 3.0.0, xunit.runner.visualstudio only supports net472, but we target net462
-->
<XUnitRunnerVisualStudioVersion>2.8.2</XUnitRunnerVisualStudioVersion>
<MicrosoftDotNetXUnitExtensionsVersion>9.0.0-beta.25562.4</MicrosoftDotNetXUnitExtensionsVersion>
<!-- MEVD is still part of the Semantic Kernel repo -->
<MicrosoftExtensionsVectorDataAbstractionsVersion>9.7.0</MicrosoftExtensionsVectorDataAbstractionsVersion>
<MicrosoftSemanticKernelConnectorsVersion>1.67.0-preview</MicrosoftSemanticKernelConnectorsVersion>
Expand Down
1 change: 1 addition & 0 deletions eng/packages/TestOnly.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<PackageVersion Include="DocumentFormat.OpenXml" version="3.0.1" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.2.2" />
<PackageVersion Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="3.1.3" />
<PackageVersion Include="Microsoft.DotNet.XUnitExtensions" Version="$(MicrosoftDotNetXUnitExtensionsVersion)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.0" />
<PackageVersion Include="Microsoft.ML.Tokenizers.Data.Cl100kBase" Version="$(MicrosoftMLTokenizersVersion)" />
Expand Down
4 changes: 2 additions & 2 deletions scripts/Slngen.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Describe "Slngen.ps1" {

$DefaultExcludePath = "--exclude src\Tools\MutationTesting\samples\ --exclude src\Templates\templates"
$DefaultSlnPath = '"' + (Join-Path -Path (Get-Location) -ChildPath "SDK.sln") + '"'
$PollyKeywordGlobs = 'test/TestUtilities/TestUtilities.csproj src/**/*Polly*/**/*.*sproj test/**/*Polly*/**/*.*sproj bench/**/*Polly*/**/*.*sproj int_test/**/*Polly*/**/*.*sproj docs/**/*Polly*/**/*.*sproj'
$PollyHttpKeywordsGlobs = 'test/TestUtilities/TestUtilities.csproj src/**/*Polly*/**/*.*sproj test/**/*Polly*/**/*.*sproj bench/**/*Polly*/**/*.*sproj int_test/**/*Polly*/**/*.*sproj docs/**/*Polly*/**/*.*sproj src/**/*Http*/**/*.*sproj test/**/*Http*/**/*.*sproj bench/**/*Http*/**/*.*sproj int_test/**/*Http*/**/*.*sproj docs/**/*Http*/**/*.*sproj'
$PollyKeywordGlobs = 'src/**/*Polly*/**/*.*sproj test/**/*Polly*/**/*.*sproj bench/**/*Polly*/**/*.*sproj int_test/**/*Polly*/**/*.*sproj docs/**/*Polly*/**/*.*sproj'
$PollyHttpKeywordsGlobs = 'src/**/*Polly*/**/*.*sproj test/**/*Polly*/**/*.*sproj bench/**/*Polly*/**/*.*sproj int_test/**/*Polly*/**/*.*sproj docs/**/*Polly*/**/*.*sproj src/**/*Http*/**/*.*sproj test/**/*Http*/**/*.*sproj bench/**/*Http*/**/*.*sproj int_test/**/*Http*/**/*.*sproj docs/**/*Http*/**/*.*sproj'
}

Context "Invoke-SlngenExe with test cases from examples" {
Expand Down
4 changes: 0 additions & 4 deletions scripts/Slngen.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,6 @@ Push-Location $RepositoryPath
try {
[System.Collections.ArrayList]$Globs = @()

if (!$OnlySources) {
$Globs += "test/TestUtilities/TestUtilities.csproj"
}

if (!$All) {
foreach ($Keyword in $Keywords) {
$Globs += "src/**/*$($Keyword)*/**/*.*sproj"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using Microsoft.TestUtilities;
using Xunit;

namespace Microsoft.AspNetCore.Testing.Test;
Expand All @@ -23,17 +22,17 @@ public void Create_CreatesCertificate()
Assert.False(certificate.Extensions.OfType<X509EnhancedKeyUsageExtension>().Single().Critical);
}

[ConditionalTheory]
[OSSkipCondition(OperatingSystems.Linux)]
[PlatformSpecific(~TestPlatforms.Linux)]
[Theory]
[InlineData(false)]
[InlineData(true)]
public void GenerateRsa_RunsOnWindows_GeneratesRsa(bool runsOnWindows)
{
Assert.NotNull(FakeSslCertificateFactory.GenerateRsa(runsOnWindows));
}

[ConditionalFact]
[OSSkipCondition(OperatingSystems.Windows)]
[PlatformSpecific(~TestPlatforms.Windows)]
[Fact]
public void GenerateRsa_DoesNotRunOnWindows_GeneratesRsa()
{
Assert.NotNull(FakeSslCertificateFactory.GenerateRsa(runsOnWindows: false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
<ItemGroup>
<ProjectReference Include="..\..\..\src\Libraries\Microsoft.AspNetCore.Testing\Microsoft.AspNetCore.Testing.csproj" ProjectUnderTest="true" />
<ProjectReference Include="..\..\..\src\Libraries\Microsoft.Extensions.Hosting.Testing\Microsoft.Extensions.Hosting.Testing.csproj" />
<ProjectReference Include="..\..\TestUtilities\TestUtilities.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.XUnitExtensions" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.XUnitExtensions" />
<PackageReference Include="Microsoft.Extensions.Logging" />
<PackageReference Include="System.Memory.Data" />
<PackageReference Include="JsonSchema.Net" />
Expand All @@ -37,6 +38,5 @@
<ItemGroup>
<ProjectReference Include="..\..\..\src\Libraries\Microsoft.Extensions.AI.Abstractions\Microsoft.Extensions.AI.Abstractions.csproj" ProjectUnderTest="true" />
<ProjectReference Include="..\..\..\src\Libraries\Microsoft.Extensions.AI\Microsoft.Extensions.AI.csproj" />
<ProjectReference Include="..\..\TestUtilities\TestUtilities.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
using System.Text.Json.Serialization.Metadata;
using System.Threading;
using Microsoft.Extensions.AI.JsonSchemaExporter;
using Microsoft.TestUtilities;
using Xunit;

#pragma warning disable SA1114 // parameter list should follow declaration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
ο»Ώ// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading.Tasks;
using System;

using Microsoft.DotNet.XUnitExtensions;
using Microsoft.Extensions.AI.Evaluation.Quality;
using Microsoft.Extensions.AI.Evaluation.Reporting;
using Microsoft.Extensions.AI.Evaluation.Reporting.Storage;
using Microsoft.Extensions.AI.Evaluation.Reporting;
using Microsoft.Extensions.AI.Evaluation.Tests;
using Microsoft.TestUtilities;
using Xunit;

namespace Microsoft.Extensions.AI.Evaluation.Integration.Tests;

[Experimental("AIEVAL001")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.XUnitExtensions" />
<PackageReference Include="Azure.Core" />
<PackageReference Include="Azure.Identity" />
<PackageReference Include="Microsoft.Extensions.Hosting" />
Expand All @@ -35,7 +36,6 @@
<ProjectReference Include="..\..\..\src\Libraries\Microsoft.Extensions.AI.Evaluation.Quality\Microsoft.Extensions.AI.Evaluation.Quality.csproj" />
<ProjectReference Include="..\..\..\src\Libraries\Microsoft.Extensions.AI.Evaluation.Reporting\CSharp\Microsoft.Extensions.AI.Evaluation.Reporting.csproj" />
<ProjectReference Include="..\..\..\src\Libraries\Microsoft.Extensions.AI.Evaluation.Safety\Microsoft.Extensions.AI.Evaluation.Safety.csproj" />
<ProjectReference Include="..\..\TestUtilities\TestUtilities.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
ο»Ώ// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading.Tasks;
using System;

using Microsoft.DotNet.XUnitExtensions;
using Microsoft.Extensions.AI.Evaluation.NLP;
using Microsoft.Extensions.AI.Evaluation.Reporting;
using Microsoft.Extensions.AI.Evaluation.Reporting.Storage;
using Microsoft.TestUtilities;
using Microsoft.Extensions.AI.Evaluation.Reporting;
using Xunit;

namespace Microsoft.Extensions.AI.Evaluation.Integration.Tests;

[Experimental("AIEVAL001")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
ο»Ώ// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading.Tasks;
using System;

using Microsoft.DotNet.XUnitExtensions;
using Microsoft.Extensions.AI.Evaluation.Quality;
using Microsoft.Extensions.AI.Evaluation.Reporting;
using Microsoft.Extensions.AI.Evaluation.Reporting.Storage;
using Microsoft.Extensions.AI.Evaluation.Reporting;
using Microsoft.Extensions.AI.Evaluation.Tests;
using Microsoft.TestUtilities;
using Xunit;

namespace Microsoft.Extensions.AI.Evaluation.Integration.Tests;

[Experimental("AIEVAL001")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using Microsoft.Extensions.AI.Evaluation.Safety;
using Microsoft.Extensions.AI.Evaluation.Tests;
using Microsoft.Extensions.AI.Evaluation.Utilities;
using Microsoft.TestUtilities;
using Microsoft.DotNet.XUnitExtensions;
using Xunit;

namespace Microsoft.Extensions.AI.Evaluation.Integration.Tests;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;
using Microsoft.Extensions.AI.Evaluation.Reporting.Formats.Html;
using Microsoft.TestUtilities;
using Microsoft.DotNet.XUnitExtensions;
using Xunit;

namespace Microsoft.Extensions.AI.Evaluation.Reporting.Tests;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.XUnitExtensions" />
<PackageReference Include="Azure.Identity" />
<PackageReference Include="Microsoft.Extensions.Hosting" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\Libraries\Microsoft.Extensions.AI.Evaluation.Reporting.Azure\Microsoft.Extensions.AI.Evaluation.Reporting.Azure.csproj" />
<ProjectReference Include="..\..\..\src\Libraries\Microsoft.Extensions.AI.Evaluation.Reporting\CSharp\Microsoft.Extensions.AI.Evaluation.Reporting.csproj" />
<ProjectReference Include="..\..\TestUtilities\TestUtilities.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.TestUtilities;
using Microsoft.DotNet.XUnitExtensions;
using Xunit;

namespace Microsoft.Extensions.AI.Evaluation.Reporting.Tests;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.TestUtilities;
using Microsoft.DotNet.XUnitExtensions;
using Xunit;

namespace Microsoft.Extensions.AI.Evaluation.Reporting.Tests;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;

using Microsoft.DotNet.XUnitExtensions;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Testing;
using Microsoft.TestUtilities;
using OpenTelemetry.Trace;
using Xunit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
using System.Numerics.Tensors;
#endif
using System.Threading.Tasks;

using Microsoft.DotNet.XUnitExtensions;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.TestUtilities;
using OpenTelemetry.Trace;
using Xunit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.TestUtilities;
using Microsoft.DotNet.XUnitExtensions;
using Xunit;

#pragma warning disable CA2000 // Dispose objects before losing scope
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Threading.Tasks;
using Microsoft.TestUtilities;
using Microsoft.DotNet.XUnitExtensions;
using Xunit;

#pragma warning disable CA2214 // Do not call overridable methods in constructors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.XUnitExtensions" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" />
Expand All @@ -52,6 +53,5 @@
<ProjectReference Include="..\..\..\src\Libraries\Microsoft.Extensions.AI.Abstractions\Microsoft.Extensions.AI.Abstractions.csproj" ProjectUnderTest="true" />
<ProjectReference Include="..\..\..\src\Libraries\Microsoft.Extensions.AI\Microsoft.Extensions.AI.csproj" ProjectUnderTest="true" />
<ProjectReference Include="..\..\..\src\Libraries\Microsoft.Extensions.Diagnostics.Testing\Microsoft.Extensions.Diagnostics.Testing.csproj" />
<ProjectReference Include="..\..\TestUtilities\TestUtilities.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Microsoft.TestUtilities;
using Microsoft.DotNet.XUnitExtensions;
using Xunit;

#pragma warning disable CA2214 // Do not call overridable methods in constructors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
using System.ComponentModel;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.TestUtilities;
using OllamaSharp;
using Microsoft.DotNet.XUnitExtensions;
using Xunit;

namespace Microsoft.Extensions.AI;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System;
using System.Threading.Tasks;
using Microsoft.TestUtilities;
using OllamaSharp;
using Xunit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Microsoft.TestUtilities;
using OpenAI.Assistants;
using Xunit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.TestUtilities;
using Microsoft.DotNet.XUnitExtensions;
using Xunit;

namespace Microsoft.Extensions.AI;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<ProjectReference Include="..\..\..\src\Libraries\Microsoft.Extensions.DataIngestion.MarkItDown\Microsoft.Extensions.DataIngestion.MarkItDown.csproj" />
<ProjectReference Include="..\..\..\src\Libraries\Microsoft.Extensions.DataIngestion\Microsoft.Extensions.DataIngestion.csproj" />
<ProjectReference Include="..\..\..\src\Libraries\Microsoft.Extensions.Diagnostics.Testing\Microsoft.Extensions.Diagnostics.Testing.csproj" />
<ProjectReference Include="..\..\TestUtilities\TestUtilities.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.XUnitExtensions" />
<PackageReference Include="DocumentFormat.OpenXml" />
<PackageReference Include="Microsoft.ML.Tokenizers.Data.Cl100kBase" />
<PackageReference Include="Microsoft.ML.Tokenizers.Data.O200kBase" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DataIngestion.Tests.Utils;
using Microsoft.TestUtilities;
using Microsoft.DotNet.XUnitExtensions;
using Xunit;

namespace Microsoft.Extensions.DataIngestion.Readers.Tests;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Text;
using Microsoft.TestUtilities;

namespace Microsoft.Extensions.DataIngestion.Readers.Tests;

/// <summary>
/// This class exists because currently the local copy of <see cref="ConditionalTheoryAttribute"/> can't ignore tests that throw <see cref="SkipTestException"/>.
/// Helper class for checking if MarkItDown is installed.
/// </summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = true)]
public class MarkItDownConditionAttribute : Attribute, ITestCondition
public static class MarkItDownCondition
{
internal static readonly Lazy<bool> IsInstalled = new(CanInvokeMarkItDown);

public bool IsMet => IsInstalled.Value;

public string SkipReason => "MarkItDown is not installed or not accessible.";
public static bool IsMarkItDownInstalled => IsInstalled.Value;

private static bool CanInvokeMarkItDown()
{
Expand Down
Loading
Loading