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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,6 @@ public void Dispose()
void AddSearchDirectoriesFromRunSetting(List<RecursiveDirectoryPath> recursiveDirectoryPath)
{
// Enqueue elements from the list in Queue
if (recursiveDirectoryPath == null)
{
return;
}

foreach (RecursiveDirectoryPath recPath in recursiveDirectoryPath)
{
_directoryList.Enqueue(recPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,7 @@
/// <returns>True if found.</returns>
public bool TryGetPropertyValue(string propertyName, out object? propertyValue)
{
if (_properties == null)
{
propertyValue = null;
return false;
}

return _properties.TryGetValue(propertyName, out propertyValue);

Check failure on line 258 in src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build MacOS Debug)

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs#L258

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs(258,9): error IDE0022: (NETCORE_ENGINEERING_TELEMETRY=Build) Use expression body for method (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0022)

Check failure on line 258 in src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build MacOS Debug)

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs#L258

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs(258,9): error IDE0022: (NETCORE_ENGINEERING_TELEMETRY=Build) Use expression body for method (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0022)

Check failure on line 258 in src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build Linux Debug)

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs#L258

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs(258,9): error IDE0022: (NETCORE_ENGINEERING_TELEMETRY=Build) Use expression body for method (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0022)

Check failure on line 258 in src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build Linux Release)

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs#L258

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs(258,9): error IDE0022: (NETCORE_ENGINEERING_TELEMETRY=Build) Use expression body for method (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0022)

Check failure on line 258 in src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build Linux Release)

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs#L258

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs(258,9): error IDE0022: (NETCORE_ENGINEERING_TELEMETRY=Build) Use expression body for method (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0022)

Check failure on line 258 in src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build MacOS Release)

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs#L258

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs(258,9): error IDE0022: (NETCORE_ENGINEERING_TELEMETRY=Build) Use expression body for method (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0022)

Check failure on line 258 in src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build MacOS Release)

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs#L258

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs(258,9): error IDE0022: (NETCORE_ENGINEERING_TELEMETRY=Build) Use expression body for method (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0022)

Check failure on line 258 in src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs#L258

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs(258,9): error IDE0022: (NETCORE_ENGINEERING_TELEMETRY=Build) Use expression body for method (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0022)

Check failure on line 258 in src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs#L258

src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs(258,9): error IDE0022: (NETCORE_ENGINEERING_TELEMETRY=Build) Use expression body for method (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0022)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error IDE0022: (NETCORE_ENGINEERING_TELEMETRY=Build) Use expression body for method

}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ private static async Task<Solution> FixTestMethodAsync(Document document, Method
INamedTypeSymbol? taskSymbol = wellKnownTypeProvider.GetOrCreateTypeByMetadataName(WellKnownTypeNames.SystemThreadingTasksTask);
INamedTypeSymbol? valueTaskSymbol = wellKnownTypeProvider.GetOrCreateTypeByMetadataName(WellKnownTypeNames.SystemThreadingTasksValueTask);

if (newMethodDeclaration.ReturnType != null &&
!newMethodDeclaration.ReturnType.IsVoid() &&
if (!newMethodDeclaration.ReturnType.IsVoid() &&
(taskSymbol == null || !semanticModel.ClassifyConversion(methodDeclaration.ReturnType, taskSymbol).IsImplicit) &&
(valueTaskSymbol == null || !semanticModel.ClassifyConversion(methodDeclaration.ReturnType, valueTaskSymbol).IsImplicit))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ protected ContextAdapterBase(ICommandLineOptions commandLineOptions, IRunSetting
if (commandLineOptions.TryGetOptionArgumentList(
TestCaseFilterCommandLineOptionsProvider.TestCaseFilterOptionName,
out string[]? filterExpressions)
&& filterExpressions is not null
&& filterExpressions.Length == 1)
{
filterFromCommandLineOption = filterExpressions[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ public async Task ExecuteMaxFailedTestsCallbacksAsync(int maxFailedTests, Cancel
{
_lastMaxFailedTests = maxFailedTests;
IsMaxFailedTestsTriggered = true;
if (_maxFailedTestsCallbacks is null)
{
return;
}

foreach (Func<int, CancellationToken, Task> callback in _maxFailedTestsCallbacks)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,9 @@ private async Task ShowTelemetryBannerFirstNoticeAsync(ServiceProvider servicePr

ITestApplicationModuleInfo testApplicationModuleInfo = serviceProvider.GetTestApplicationModuleInfo();
#pragma warning disable RS0030 // Do not use banned APIs - There is no easy way to disable it for all members
string? directory = environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData, Environment.SpecialFolderOption.Create);
Copy link
Member

@Youssef1313 Youssef1313 Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one I'm not sure about. Some tests might be mocking stuff in a way that breaks this. If we can write the tests in a better way, that could be a good option. Otherwise, we probably keep this one for now.

But other than that, the rest of the changes look very good!

string directory = environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData, Environment.SpecialFolderOption.Create);
#pragma warning restore RS0030 // Do not use banned APIs
if (directory is not null)
{
directory = Path.Combine(directory, "Microsoft", "TestingPlatform");
}
directory = Path.Combine(directory, "Microsoft", "TestingPlatform");

IFileSystem fileSystem = serviceProvider.GetFileSystem();
string fileName = testApplicationModuleInfo.TryGetCurrentTestApplicationFullPath() is { } testApplicationFullPath
Expand Down
Loading