From ea35bfffa81e5293a6d9d747970a240b3bf468d8 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Wed, 25 Nov 2020 12:48:47 -0800 Subject: [PATCH] Enable code coverage (#17067) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use VSTest integration for Coverlet Fixes #15231. Relates to #14427. * Do not ignore CompilerGeneratedAttribute See https://github.com/coverlet-coverage/coverlet/issues/794#issuecomment-612067552 * Enable code coverage for PRs * Publish code coverage even for failed tests * Enable code coverage reports Resolves #14427 by limiting reports to a single service directory (CIs) or per test project (dev environments). For CIs, full coverage reports of everything build will be uploaded. For dev environments, a summary HTML file will be output to test projects' TestResults directories. * Fix filefilters path for CI * Use absolute path for filefilters Same as dev support; reportgenerator documentation is not clear on when absolute or relative paths are required. * Use absolute path for reports * Update report directory to limit globbing * Disable code coverage of track 2 mgmt Opened #17090 to track re-enabling once improved. * Generate report before uploading test results The exact same commands are working locally using the same versions of ReportGenerator, sans running the test publishing executable. There's also extra coverage files showing up that I'm wondering if it's responsible. * Temporarily upload all code coverage artifacts * Split between props and targets again At one point, this mostly worked. Going back to how I was split between props and targets before to see if that makes a difference. * Collect more information * Always define CoverletGetPathMap @clairernovotny recommended important some changes. These are working locally when simulating a CI, so 🤞. * Resolve PR feedback Fix extra (temporary) logging as well. * Use different variable to detect CI ContinuousIntegrationBuild wasn't defined for test projects. * Replace curly braces with Of in file names Fixes #17164 * Removing extra logging * Renames files with curly braces Fixes #17164 * Resolve PR feedback * Do not reformat HTML coverage report --- .config/dotnet-tools.json | 12 ++++ CONTRIBUTING.md | 23 +++++- eng/CodeCoverage.runsettings | 18 +++++ eng/CodeCoverage.targets | 70 +++++++++++++++++-- eng/Directory.Build.Data.props | 4 +- eng/Directory.Build.Data.targets | 7 +- eng/Packages.Data.props | 12 ++-- .../templates/jobs/archetype-sdk-client.yml | 27 ++++--- eng/service.proj | 3 + .../src/Azure.Data.AppConfiguration.csproj | 2 +- ...}.cs => RecordedTestBaseOfTEnvironment.cs} | 2 + .../src/{Operation{T}.cs => OperationOfT.cs} | 2 + .../src/{Response{T}.cs => ResponseOfT.cs} | 2 + ...odyResponse{T}.cs => NoBodyResponseOfT.cs} | 2 + .../Azure.Core/tests/Azure.Core.Tests.csproj | 2 +- ...essor{TPartition}.cs => EventProcessor.cs} | 0 .../Directory.Build.props | 1 + ...ypeLocator{T}.cs => FakeTypeLocatorOfT.cs} | 2 + ...nt}.cs => AzureClientCredentialOptions.cs} | 0 ...tion{TClient}.cs => ClientRegistration.cs} | 0 .../src/{FormField{T}.cs => FormFieldOfT.cs} | 2 + .../tests/CertificatesTestBase.cs | 2 +- sdk/keyvault/samples/Directory.Build.props | 1 + ...her{T}.Message.cs => Publisher.Message.cs} | 0 ...ation.cs => Publisher.MessageOperation.cs} | 0 .../{Publisher{T}.cs => Publisher.cs} | 0 ...blisherAction{T}.cs => PublisherAction.cs} | 0 ...{T}.cs => SearchIndexingBufferedSender.cs} | 0 ...=> SearchIndexingBufferedSenderOptions.cs} | 0 ...isher{T}.cs => SearchIndexingPublisher.cs} | 0 ...tsAction{T}.cs => IndexDocumentsAction.cs} | 0 ...entsBatch{T}.cs => IndexDocumentsBatch.cs} | 0 .../{SearchResult{T}.cs => SearchResult.cs} | 0 .../{SearchResults{T}.cs => SearchResults.cs} | 0 ...chSuggestion{T}.cs => SearchSuggestion.cs} | 0 ...SuggestResults{T}.cs => SuggestResults.cs} | 0 ...e.Storage.Blobs.Batch.Samples.Tests.csproj | 4 +- .../src/Azure.Storage.Blobs.Batch.csproj | 4 +- ...rage.Blobs.ChangeFeed.Samples.Tests.csproj | 4 +- .../Azure.Storage.Blobs.Samples.Tests.csproj | 4 +- .../src/Azure.Storage.Blobs.csproj | 2 +- .../Azure.Storage.Common.Samples.Tests.csproj | 4 +- .../src/Azure.Storage.Common.csproj | 4 +- ...torage.Files.DataLake.Samples.Tests.csproj | 4 +- .../src/Azure.Storage.Files.DataLake.csproj | 4 +- ....Storage.Files.Shares.Samples.Tests.csproj | 4 +- .../src/Azure.Storage.Files.Shares.csproj | 4 +- .../Azure.Storage.Queues.Samples.Tests.csproj | 4 +- .../src/Azure.Storage.Queues.csproj | 4 +- ...onverter{T}.cs => StorageBlobConverter.cs} | 0 ...lt}.cs => ExpectManualCompletionLogger.cs} | 0 .../src/Azure.Data.Tables.csproj | 2 +- ...{T}.cs => ReferenceEqualityComparerOfT.cs} | 2 + 53 files changed, 191 insertions(+), 59 deletions(-) create mode 100644 .config/dotnet-tools.json create mode 100644 eng/CodeCoverage.runsettings rename sdk/core/Azure.Core.TestFramework/src/{RecordedTestBase{TEnvironment}.cs => RecordedTestBaseOfTEnvironment.cs} (87%) rename sdk/core/Azure.Core/src/{Operation{T}.cs => OperationOfT.cs} (97%) rename sdk/core/Azure.Core/src/{Response{T}.cs => ResponseOfT.cs} (91%) rename sdk/core/Azure.Core/src/Shared/{NoBodyResponse{T}.cs => NoBodyResponseOfT.cs} (88%) rename sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/{EventProcessor{TPartition}.cs => EventProcessor.cs} (100%) rename sdk/extensions/Microsoft.Azure.WebJobs.Extensions.Clients/tests/shared/{FakeTypeLocator{T}.cs => FakeTypeLocatorOfT.cs} (72%) rename sdk/extensions/Microsoft.Extensions.Azure/src/Internal/{AzureClientCredentialOptions{TClient}.cs => AzureClientCredentialOptions.cs} (100%) rename sdk/extensions/Microsoft.Extensions.Azure/src/Internal/{ClientRegistration{TClient}.cs => ClientRegistration.cs} (100%) rename sdk/formrecognizer/Azure.AI.FormRecognizer/src/{FormField{T}.cs => FormFieldOfT.cs} (94%) rename sdk/search/Azure.Search.Documents/src/Batching/{Publisher{T}.Message.cs => Publisher.Message.cs} (100%) rename sdk/search/Azure.Search.Documents/src/Batching/{Publisher{T}.MessageOperation.cs => Publisher.MessageOperation.cs} (100%) rename sdk/search/Azure.Search.Documents/src/Batching/{Publisher{T}.cs => Publisher.cs} (100%) rename sdk/search/Azure.Search.Documents/src/Batching/{PublisherAction{T}.cs => PublisherAction.cs} (100%) rename sdk/search/Azure.Search.Documents/src/Batching/{SearchIndexingBufferedSender{T}.cs => SearchIndexingBufferedSender.cs} (100%) rename sdk/search/Azure.Search.Documents/src/Batching/{SearchIndexingBufferedSenderOptions{T}.cs => SearchIndexingBufferedSenderOptions.cs} (100%) rename sdk/search/Azure.Search.Documents/src/Batching/{SearchIndexingPublisher{T}.cs => SearchIndexingPublisher.cs} (100%) rename sdk/search/Azure.Search.Documents/src/Models/{IndexDocumentsAction{T}.cs => IndexDocumentsAction.cs} (100%) rename sdk/search/Azure.Search.Documents/src/Models/{IndexDocumentsBatch{T}.cs => IndexDocumentsBatch.cs} (100%) rename sdk/search/Azure.Search.Documents/src/Models/{SearchResult{T}.cs => SearchResult.cs} (100%) rename sdk/search/Azure.Search.Documents/src/Models/{SearchResults{T}.cs => SearchResults.cs} (100%) rename sdk/search/Azure.Search.Documents/src/Models/{SearchSuggestion{T}.cs => SearchSuggestion.cs} (100%) rename sdk/search/Azure.Search.Documents/src/Models/{SuggestResults{T}.cs => SuggestResults.cs} (100%) rename sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/src/{StorageBlobConverter{T}.cs => StorageBlobConverter.cs} (100%) rename sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/tests/{ExpectManualCompletionLogger{TResult}.cs => ExpectManualCompletionLogger.cs} (100%) rename sdk/tables/Azure.Data.Tables/src/Queryable/{ReferenceEqualityComparer{T}.cs => ReferenceEqualityComparerOfT.cs} (90%) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000000000..493dd5c6774a4 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-reportgenerator-globaltool": { + "version": "4.8.0", + "commands": [ + "reportgenerator" + ] + } + } +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6c87d512c524d..7f39025049e40 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,8 +55,11 @@ Nuget package will be created in root directory under \artifacts\packages\Debug ### Using the command line: Run e.g. `msbuild eng\mgmt.proj /t:"Runtests" /p:Scope=Compute` -In the above example _RunTests_ will build and run tests for Compute only or you can use command line CLI -`dotnet test Compute\Microsoft.Azure.Management.Compute\tests\Microsoft.Azure.Management.Tests.csproj` +In the above example _RunTests_ will build and run tests for Compute only or you can use command line CLI: + +```bash +dotnet test Compute\Microsoft.Azure.Management.Compute\tests\Microsoft.Azure.Management.Tests.csproj +``` ### Non-Windows command line build @@ -67,6 +70,22 @@ Now you can use the same command on non-windows as above for e.g. on Ubuntu you - `dotnet msbuild eng\mgmt.proj /t:CreateNugetPackage /p:scope=Compute` - `dotnet msbuild build.proj /t:Util /p:UtilityName=InstallPsModules` +### Code Coverage + +If you want to enable code coverage reporting, on the command line pass `/p:CollectCoverage=true` like so: + +```bash +dotnet tool restore +dotnet test /p:CollectCoverage=true +``` + +On developers' machines, you can open `index.html` from within the `TestResults` directory in each of your test projects. +Coverage reports can also be found in Azure Pipelines on the "Code Coverage" tab after a pull request validation build completes. +All covered projects should have 70% or better test coverage. + +By default, all _Azure.*_ libraries are covered, and any project that sets the `IsClientLibrary=true` MSBuild property. +To exclude a project, set `ExcludeFromCodeCoverage=true` in the project's MSBuild properties before other targets are imported. + ### Update build tools Build tools are now downloaded as part of a nuget package under `root\restoredPackages\microsoft.internal.netsdkbuild.mgmt.tools` diff --git a/eng/CodeCoverage.runsettings b/eng/CodeCoverage.runsettings new file mode 100644 index 0000000000000..9cc066020173a --- /dev/null +++ b/eng/CodeCoverage.runsettings @@ -0,0 +1,18 @@ + + + + + + + cobertura + ExcludeFromCodeCoverageAttribute,GeneratedCodeAttribute,Obsolete + false + false + true + + + + + + + diff --git a/eng/CodeCoverage.targets b/eng/CodeCoverage.targets index 135eaa5eef26f..297c676529b65 100644 --- a/eng/CodeCoverage.targets +++ b/eng/CodeCoverage.targets @@ -1,13 +1,70 @@ - - + + <_IsCodeCoverable Condition="'$(IsClientLibrary)' == 'true' and '$(IsMgmtClientLibrary)' != 'true'">true + + + + $([System.IO.Path]::GetFullPath("$(MSBuildProjectDirectory)\..")) + true + XPlat Code Coverage + $(MSBuildThisFileDirectory)CodeCoverage.runsettings + <_CollectCoverage>true + <_TestResultsDirectory>$(MSBuildProjectDirectory)\TestResults + + + + + all runtime; build; native; contentfiles; analyzers - + + + + + + + + + dotnet tool run reportgenerator -- + $(CoverageReportCommandLine) "-reports:$(_TestResultsDirectory)\**\coverage.cobertura.xml" + $(CoverageReportCommandLine) -reporttypes:Html + $(CoverageReportCommandLine) "-targetdir:$(_TestResultsDirectory)" + $(CoverageReportCommandLine) "-filefilters:+$(CodeCoverageDirectory)\**" + + + + + + + + <_ContainsCurlyBraces Include="@(Compile)" Condition="$([MSBuild]::ValueOrDefault('%(Directory)%(Filename)', '').Contains('{')) or $([MSBuild]::ValueOrDefault('%(Directory)%(Filename)', '').Contains('}'))" /> + + + + + @@ -17,7 +74,8 @@ Returns="@(_LocalTopLevelSourceRoot)" Condition="'$(DeterministicSourcePaths)' == 'true'"> - <_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/> + <_LocalTopLevelSourceRoot Include="@(SourceRoot)" + Condition="'%(SourceRoot.NestedRoot)' == ''"/> - \ No newline at end of file + diff --git a/eng/Directory.Build.Data.props b/eng/Directory.Build.Data.props index 6f8e8e2cff383..2598f04d10aa9 100644 --- a/eng/Directory.Build.Data.props +++ b/eng/Directory.Build.Data.props @@ -55,7 +55,6 @@ true $(AZURE_DEV_UPDATESOURCESONBUILD) pwsh - cobertura false @@ -97,7 +96,8 @@ false netcoreapp2.1;net5.0 - netcoreapp2.1;net5.0;net461 + + net461;netcoreapp2.1;net5.0 diff --git a/eng/Directory.Build.Data.targets b/eng/Directory.Build.Data.targets index a9f939e79812a..b3b5f77db8feb 100644 --- a/eng/Directory.Build.Data.targets +++ b/eng/Directory.Build.Data.targets @@ -71,9 +71,6 @@ - - - @@ -85,7 +82,7 @@ - + @@ -105,6 +102,8 @@ + + diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 6379f41e36103..7cef773fe2789 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -9,9 +9,9 @@ - + - + @@ -32,7 +32,7 @@ - + @@ -69,7 +69,7 @@ - + @@ -180,9 +180,9 @@ - + - + diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index 66f2e7680b6da..83b9816fc1369 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -110,6 +110,8 @@ jobs: condition: and(succeededOrFailed(), ne(variables['Skip.Test'], true)) variables: - template: ../variables/globals.yml + - name: disable.coverage.autogenerate + value: true strategy: maxParallel: $[ variables['MaxParallelTestJobs'] ] matrix: @@ -119,6 +121,7 @@ jobs: Windows_NetCoreApp: OSVmImage: "windows-2019" TestTargetFramework: netcoreapp2.1 + CollectCoverage: true Windows_NetCoreApp_ProjectReferences: OSVmImage: "windows-2019" TestTargetFramework: netcoreapp2.1 @@ -149,7 +152,8 @@ jobs: --logger "trx;LogFileName=$(TestTargetFramework).trx" --logger:"console;verbosity=normal" /p:ServiceDirectory=${{parameters.ServiceToTest}} /p:IncludeSrc=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false - /p:Configuration=$(BuildConfiguration) $(ConvertToProjectReferenceOption) /p:CollectCoverage=$(CollectCoverage) + /p:Configuration=$(BuildConfiguration) $(ConvertToProjectReferenceOption) + /p:CollectCoverage=$(CollectCoverage) /p:CodeCoverageDirectory=${{parameters.ServiceDirectory}} displayName: "Build & Test ($(TestTargetFramework))" env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 @@ -163,15 +167,18 @@ jobs: testResultsFormat: "VSTest" mergeTestResults: true - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@4 - condition: and(succeeded(), eq(variables['CollectCoverage'], 'true')) - displayName: ReportGenerator + condition: and(succeededOrFailed(), eq(variables['CollectCoverage'], 'true')) + displayName: Generate Code Coverage Reports inputs: - reports: '**/*coverage.netcoreapp2.1.cobertura.xml' - targetdir: '$(Build.SourcesDirectory)' - reporttypes: Cobertura + reports: $(Build.SourcesDirectory)\sdk\${{parameters.ServiceDirectory}}\**\coverage.cobertura.xml + targetdir: $(Build.ArtifactStagingDirectory)\coverage + reporttypes: Cobertura;HtmlInline_AzurePipelines + filefilters: +$(Build.SourcesDirectory)\sdk\${{parameters.ServiceDirectory}}\** + verbosity: Verbose - task: PublishCodeCoverageResults@1 - condition: and(succeeded(), eq(variables['CollectCoverage'], 'true')) - displayName: 'Publish code coverage report' + condition: and(succeededOrFailed(), eq(variables['CollectCoverage'], 'true')) + displayName: Publish Code Coverage Reports inputs: - codeCoverageTool: 'Cobertura' - summaryFileLocation: 'Cobertura.xml' + codeCoverageTool: Cobertura + summaryFileLocation: $(Build.ArtifactStagingDirectory)\coverage\Cobertura.xml + reportDirectory: $(Build.ArtifactStagingDirectory)\coverage diff --git a/eng/service.proj b/eng/service.proj index 9e6ecfe5897a8..b8197a7fdc33e 100644 --- a/eng/service.proj +++ b/eng/service.proj @@ -9,6 +9,9 @@ true true false + + CodeCoverageDirectory=$([System.IO.Path]::GetFullPath("$(CodeCoverageDirectory)", "$(MSBuildThisFileDirectory)..\sdk")); + diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Azure.Data.AppConfiguration.csproj b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Azure.Data.AppConfiguration.csproj index 0cb257676fc6a..c2dd1ceb9fe62 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Azure.Data.AppConfiguration.csproj +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/Azure.Data.AppConfiguration.csproj @@ -30,7 +30,7 @@ - + diff --git a/sdk/core/Azure.Core.TestFramework/src/RecordedTestBase{TEnvironment}.cs b/sdk/core/Azure.Core.TestFramework/src/RecordedTestBaseOfTEnvironment.cs similarity index 87% rename from sdk/core/Azure.Core.TestFramework/src/RecordedTestBase{TEnvironment}.cs rename to sdk/core/Azure.Core.TestFramework/src/RecordedTestBaseOfTEnvironment.cs index c665dbf1af03e..260ea937d8d6b 100644 --- a/sdk/core/Azure.Core.TestFramework/src/RecordedTestBase{TEnvironment}.cs +++ b/sdk/core/Azure.Core.TestFramework/src/RecordedTestBaseOfTEnvironment.cs @@ -3,7 +3,9 @@ namespace Azure.Core.TestFramework { +#pragma warning disable SA1649 // File name should match first type name public abstract class RecordedTestBase : RecordedTestBase where TEnvironment : TestEnvironment, new() +#pragma warning restore SA1649 // File name should match first type name { protected RecordedTestBase(bool isAsync) : base(isAsync) { diff --git a/sdk/core/Azure.Core/src/Operation{T}.cs b/sdk/core/Azure.Core/src/OperationOfT.cs similarity index 97% rename from sdk/core/Azure.Core/src/Operation{T}.cs rename to sdk/core/Azure.Core/src/OperationOfT.cs index ad4827028506c..08f554885f2aa 100644 --- a/sdk/core/Azure.Core/src/Operation{T}.cs +++ b/sdk/core/Azure.Core/src/OperationOfT.cs @@ -14,7 +14,9 @@ namespace Azure /// Represents a long-running operation. /// /// The final result of the long-running operation. +#pragma warning disable SA1649 // File name should match first type name public abstract class Operation where T : notnull +#pragma warning restore SA1649 // File name should match first type name { /// /// Gets an ID representing the operation that can be used to poll for diff --git a/sdk/core/Azure.Core/src/Response{T}.cs b/sdk/core/Azure.Core/src/ResponseOfT.cs similarity index 91% rename from sdk/core/Azure.Core/src/Response{T}.cs rename to sdk/core/Azure.Core/src/ResponseOfT.cs index 4ebe53eb18416..f7c1228e4a4a7 100644 --- a/sdk/core/Azure.Core/src/Response{T}.cs +++ b/sdk/core/Azure.Core/src/ResponseOfT.cs @@ -11,7 +11,9 @@ namespace Azure /// /// The type of returned value. [DebuggerTypeProxy(typeof(ResponseDebugView<>))] +#pragma warning disable SA1649 // File name should match first type name public abstract class Response +#pragma warning restore SA1649 // File name should match first type name { /// /// Returns the HTTP response returned by the service. diff --git a/sdk/core/Azure.Core/src/Shared/NoBodyResponse{T}.cs b/sdk/core/Azure.Core/src/Shared/NoBodyResponseOfT.cs similarity index 88% rename from sdk/core/Azure.Core/src/Shared/NoBodyResponse{T}.cs rename to sdk/core/Azure.Core/src/Shared/NoBodyResponseOfT.cs index 85ba5aa2f3036..da295d9702016 100644 --- a/sdk/core/Azure.Core/src/Shared/NoBodyResponse{T}.cs +++ b/sdk/core/Azure.Core/src/Shared/NoBodyResponseOfT.cs @@ -5,7 +5,9 @@ namespace Azure { +#pragma warning disable SA1649 // File name should match first type name internal class NoBodyResponse : Response +#pragma warning restore SA1649 // File name should match first type name { private readonly Response _response; diff --git a/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj b/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj index f825e76110d71..339cb2dc29ff9 100644 --- a/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj +++ b/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj @@ -26,7 +26,7 @@ - + diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/EventProcessor{TPartition}.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/EventProcessor.cs similarity index 100% rename from sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/EventProcessor{TPartition}.cs rename to sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/EventProcessor.cs diff --git a/sdk/eventhub/Microsoft.Azure.EventHubs/Directory.Build.props b/sdk/eventhub/Microsoft.Azure.EventHubs/Directory.Build.props index 9fbcdd9981039..d18453d3ded2b 100755 --- a/sdk/eventhub/Microsoft.Azure.EventHubs/Directory.Build.props +++ b/sdk/eventhub/Microsoft.Azure.EventHubs/Directory.Build.props @@ -1,5 +1,6 @@  + true true diff --git a/sdk/extensions/Microsoft.Azure.WebJobs.Extensions.Clients/tests/shared/FakeTypeLocator{T}.cs b/sdk/extensions/Microsoft.Azure.WebJobs.Extensions.Clients/tests/shared/FakeTypeLocatorOfT.cs similarity index 72% rename from sdk/extensions/Microsoft.Azure.WebJobs.Extensions.Clients/tests/shared/FakeTypeLocator{T}.cs rename to sdk/extensions/Microsoft.Azure.WebJobs.Extensions.Clients/tests/shared/FakeTypeLocatorOfT.cs index 9ada78519cabc..5b8cfbc7aabbb 100644 --- a/sdk/extensions/Microsoft.Azure.WebJobs.Extensions.Clients/tests/shared/FakeTypeLocator{T}.cs +++ b/sdk/extensions/Microsoft.Azure.WebJobs.Extensions.Clients/tests/shared/FakeTypeLocatorOfT.cs @@ -6,7 +6,9 @@ namespace Microsoft.Azure.WebJobs.Host.TestCommon { +#pragma warning disable SA1649 // File name should match first type name public class FakeTypeLocator : ITypeLocator +#pragma warning restore SA1649 // File name should match first type name { public IReadOnlyList GetTypes() { diff --git a/sdk/extensions/Microsoft.Extensions.Azure/src/Internal/AzureClientCredentialOptions{TClient}.cs b/sdk/extensions/Microsoft.Extensions.Azure/src/Internal/AzureClientCredentialOptions.cs similarity index 100% rename from sdk/extensions/Microsoft.Extensions.Azure/src/Internal/AzureClientCredentialOptions{TClient}.cs rename to sdk/extensions/Microsoft.Extensions.Azure/src/Internal/AzureClientCredentialOptions.cs diff --git a/sdk/extensions/Microsoft.Extensions.Azure/src/Internal/ClientRegistration{TClient}.cs b/sdk/extensions/Microsoft.Extensions.Azure/src/Internal/ClientRegistration.cs similarity index 100% rename from sdk/extensions/Microsoft.Extensions.Azure/src/Internal/ClientRegistration{TClient}.cs rename to sdk/extensions/Microsoft.Extensions.Azure/src/Internal/ClientRegistration.cs diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/FormField{T}.cs b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/FormFieldOfT.cs similarity index 94% rename from sdk/formrecognizer/Azure.AI.FormRecognizer/src/FormField{T}.cs rename to sdk/formrecognizer/Azure.AI.FormRecognizer/src/FormFieldOfT.cs index 79b82c8bdb61e..135acf87b55e1 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/FormField{T}.cs +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/FormFieldOfT.cs @@ -7,7 +7,9 @@ namespace Azure.AI.FormRecognizer.Models /// Represents a field recognized in the input form, where the field's value is of a known type. /// /// The type of the value in the field this instance represents. +#pragma warning disable SA1649 // File name should match first type name public class FormField +#pragma warning restore SA1649 // File name should match first type name { /// /// Initializes a new instance of the class. diff --git a/sdk/keyvault/Azure.Security.KeyVault.Certificates/tests/CertificatesTestBase.cs b/sdk/keyvault/Azure.Security.KeyVault.Certificates/tests/CertificatesTestBase.cs index 587a672be15cc..bc1602162ded2 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Certificates/tests/CertificatesTestBase.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Certificates/tests/CertificatesTestBase.cs @@ -17,7 +17,7 @@ namespace Azure.Security.KeyVault.Certificates.Tests CertificateClientOptions.ServiceVersion.V7_0, CertificateClientOptions.ServiceVersion.V7_1)] [NonParallelizable] - public class CertificatesTestBase : RecordedTestBase + public abstract class CertificatesTestBase : RecordedTestBase { protected readonly TimeSpan PollingInterval = TimeSpan.FromSeconds(5); private readonly CertificateClientOptions.ServiceVersion _serviceVersion; diff --git a/sdk/keyvault/samples/Directory.Build.props b/sdk/keyvault/samples/Directory.Build.props index aac01a03d888a..fe5aa561b0195 100644 --- a/sdk/keyvault/samples/Directory.Build.props +++ b/sdk/keyvault/samples/Directory.Build.props @@ -3,6 +3,7 @@ true false + true false diff --git a/sdk/search/Azure.Search.Documents/src/Batching/Publisher{T}.Message.cs b/sdk/search/Azure.Search.Documents/src/Batching/Publisher.Message.cs similarity index 100% rename from sdk/search/Azure.Search.Documents/src/Batching/Publisher{T}.Message.cs rename to sdk/search/Azure.Search.Documents/src/Batching/Publisher.Message.cs diff --git a/sdk/search/Azure.Search.Documents/src/Batching/Publisher{T}.MessageOperation.cs b/sdk/search/Azure.Search.Documents/src/Batching/Publisher.MessageOperation.cs similarity index 100% rename from sdk/search/Azure.Search.Documents/src/Batching/Publisher{T}.MessageOperation.cs rename to sdk/search/Azure.Search.Documents/src/Batching/Publisher.MessageOperation.cs diff --git a/sdk/search/Azure.Search.Documents/src/Batching/Publisher{T}.cs b/sdk/search/Azure.Search.Documents/src/Batching/Publisher.cs similarity index 100% rename from sdk/search/Azure.Search.Documents/src/Batching/Publisher{T}.cs rename to sdk/search/Azure.Search.Documents/src/Batching/Publisher.cs diff --git a/sdk/search/Azure.Search.Documents/src/Batching/PublisherAction{T}.cs b/sdk/search/Azure.Search.Documents/src/Batching/PublisherAction.cs similarity index 100% rename from sdk/search/Azure.Search.Documents/src/Batching/PublisherAction{T}.cs rename to sdk/search/Azure.Search.Documents/src/Batching/PublisherAction.cs diff --git a/sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingBufferedSender{T}.cs b/sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingBufferedSender.cs similarity index 100% rename from sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingBufferedSender{T}.cs rename to sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingBufferedSender.cs diff --git a/sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingBufferedSenderOptions{T}.cs b/sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingBufferedSenderOptions.cs similarity index 100% rename from sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingBufferedSenderOptions{T}.cs rename to sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingBufferedSenderOptions.cs diff --git a/sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingPublisher{T}.cs b/sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingPublisher.cs similarity index 100% rename from sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingPublisher{T}.cs rename to sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingPublisher.cs diff --git a/sdk/search/Azure.Search.Documents/src/Models/IndexDocumentsAction{T}.cs b/sdk/search/Azure.Search.Documents/src/Models/IndexDocumentsAction.cs similarity index 100% rename from sdk/search/Azure.Search.Documents/src/Models/IndexDocumentsAction{T}.cs rename to sdk/search/Azure.Search.Documents/src/Models/IndexDocumentsAction.cs diff --git a/sdk/search/Azure.Search.Documents/src/Models/IndexDocumentsBatch{T}.cs b/sdk/search/Azure.Search.Documents/src/Models/IndexDocumentsBatch.cs similarity index 100% rename from sdk/search/Azure.Search.Documents/src/Models/IndexDocumentsBatch{T}.cs rename to sdk/search/Azure.Search.Documents/src/Models/IndexDocumentsBatch.cs diff --git a/sdk/search/Azure.Search.Documents/src/Models/SearchResult{T}.cs b/sdk/search/Azure.Search.Documents/src/Models/SearchResult.cs similarity index 100% rename from sdk/search/Azure.Search.Documents/src/Models/SearchResult{T}.cs rename to sdk/search/Azure.Search.Documents/src/Models/SearchResult.cs diff --git a/sdk/search/Azure.Search.Documents/src/Models/SearchResults{T}.cs b/sdk/search/Azure.Search.Documents/src/Models/SearchResults.cs similarity index 100% rename from sdk/search/Azure.Search.Documents/src/Models/SearchResults{T}.cs rename to sdk/search/Azure.Search.Documents/src/Models/SearchResults.cs diff --git a/sdk/search/Azure.Search.Documents/src/Models/SearchSuggestion{T}.cs b/sdk/search/Azure.Search.Documents/src/Models/SearchSuggestion.cs similarity index 100% rename from sdk/search/Azure.Search.Documents/src/Models/SearchSuggestion{T}.cs rename to sdk/search/Azure.Search.Documents/src/Models/SearchSuggestion.cs diff --git a/sdk/search/Azure.Search.Documents/src/Models/SuggestResults{T}.cs b/sdk/search/Azure.Search.Documents/src/Models/SuggestResults.cs similarity index 100% rename from sdk/search/Azure.Search.Documents/src/Models/SuggestResults{T}.cs rename to sdk/search/Azure.Search.Documents/src/Models/SuggestResults.cs diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/samples/Azure.Storage.Blobs.Batch.Samples.Tests.csproj b/sdk/storage/Azure.Storage.Blobs.Batch/samples/Azure.Storage.Blobs.Batch.Samples.Tests.csproj index c6fce5bba3930..748b67441b365 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/samples/Azure.Storage.Blobs.Batch.Samples.Tests.csproj +++ b/sdk/storage/Azure.Storage.Blobs.Batch/samples/Azure.Storage.Blobs.Batch.Samples.Tests.csproj @@ -18,7 +18,7 @@ - + @@ -28,4 +28,4 @@ - \ No newline at end of file + diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj b/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj index 94be97e4e3d17..0a253bed2dcda 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj +++ b/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj @@ -27,7 +27,7 @@ - + @@ -40,4 +40,4 @@ - \ No newline at end of file + diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/samples/Azure.Storage.Blobs.ChangeFeed.Samples.Tests.csproj b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/samples/Azure.Storage.Blobs.ChangeFeed.Samples.Tests.csproj index f9990a28230b7..404a6aa0b19f8 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/samples/Azure.Storage.Blobs.ChangeFeed.Samples.Tests.csproj +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/samples/Azure.Storage.Blobs.ChangeFeed.Samples.Tests.csproj @@ -17,7 +17,7 @@ - + @@ -27,4 +27,4 @@ - \ No newline at end of file + diff --git a/sdk/storage/Azure.Storage.Blobs/samples/Azure.Storage.Blobs.Samples.Tests.csproj b/sdk/storage/Azure.Storage.Blobs/samples/Azure.Storage.Blobs.Samples.Tests.csproj index a3f5a9b16a70c..cef761108ee39 100644 --- a/sdk/storage/Azure.Storage.Blobs/samples/Azure.Storage.Blobs.Samples.Tests.csproj +++ b/sdk/storage/Azure.Storage.Blobs/samples/Azure.Storage.Blobs.Samples.Tests.csproj @@ -18,7 +18,7 @@ - + @@ -28,4 +28,4 @@ - \ No newline at end of file + diff --git a/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj b/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj index 5c7b2610b6d9b..b7dff2a1809af 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj +++ b/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj @@ -32,7 +32,7 @@ - + diff --git a/sdk/storage/Azure.Storage.Common/samples/Azure.Storage.Common.Samples.Tests.csproj b/sdk/storage/Azure.Storage.Common/samples/Azure.Storage.Common.Samples.Tests.csproj index 29cfb206a9fa7..be0ed02d2abb2 100644 --- a/sdk/storage/Azure.Storage.Common/samples/Azure.Storage.Common.Samples.Tests.csproj +++ b/sdk/storage/Azure.Storage.Common/samples/Azure.Storage.Common.Samples.Tests.csproj @@ -20,7 +20,7 @@ - + @@ -30,4 +30,4 @@ - \ No newline at end of file + diff --git a/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj b/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj index 26cb1619e19b4..cc3d345be83b1 100644 --- a/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj +++ b/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj @@ -21,7 +21,7 @@ - + @@ -42,4 +42,4 @@ - \ No newline at end of file + diff --git a/sdk/storage/Azure.Storage.Files.DataLake/samples/Azure.Storage.Files.DataLake.Samples.Tests.csproj b/sdk/storage/Azure.Storage.Files.DataLake/samples/Azure.Storage.Files.DataLake.Samples.Tests.csproj index a24ed06072927..b9f7eb5a138e8 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/samples/Azure.Storage.Files.DataLake.Samples.Tests.csproj +++ b/sdk/storage/Azure.Storage.Files.DataLake/samples/Azure.Storage.Files.DataLake.Samples.Tests.csproj @@ -17,7 +17,7 @@ - + @@ -27,4 +27,4 @@ - \ No newline at end of file + diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj b/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj index 1abb61315f799..7c893e8e2b8a4 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj @@ -30,7 +30,7 @@ - + @@ -70,4 +70,4 @@ - \ No newline at end of file + diff --git a/sdk/storage/Azure.Storage.Files.Shares/samples/Azure.Storage.Files.Shares.Samples.Tests.csproj b/sdk/storage/Azure.Storage.Files.Shares/samples/Azure.Storage.Files.Shares.Samples.Tests.csproj index deae88375ee28..6bcef8bee566f 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/samples/Azure.Storage.Files.Shares.Samples.Tests.csproj +++ b/sdk/storage/Azure.Storage.Files.Shares/samples/Azure.Storage.Files.Shares.Samples.Tests.csproj @@ -17,7 +17,7 @@ - + @@ -27,4 +27,4 @@ - \ No newline at end of file + diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj b/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj index e998ed2ffc524..c39ace343a05e 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj @@ -29,7 +29,7 @@ - + @@ -69,4 +69,4 @@ - \ No newline at end of file + diff --git a/sdk/storage/Azure.Storage.Queues/samples/Azure.Storage.Queues.Samples.Tests.csproj b/sdk/storage/Azure.Storage.Queues/samples/Azure.Storage.Queues.Samples.Tests.csproj index 27bfcca87139d..cfe401234c037 100644 --- a/sdk/storage/Azure.Storage.Queues/samples/Azure.Storage.Queues.Samples.Tests.csproj +++ b/sdk/storage/Azure.Storage.Queues/samples/Azure.Storage.Queues.Samples.Tests.csproj @@ -17,7 +17,7 @@ - + @@ -27,4 +27,4 @@ - \ No newline at end of file + diff --git a/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj b/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj index 0934c04db1579..3e27e4531cb23 100644 --- a/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj +++ b/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj @@ -29,7 +29,7 @@ - + @@ -58,4 +58,4 @@ - \ No newline at end of file + diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/src/StorageBlobConverter{T}.cs b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/src/StorageBlobConverter.cs similarity index 100% rename from sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/src/StorageBlobConverter{T}.cs rename to sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/src/StorageBlobConverter.cs diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/tests/ExpectManualCompletionLogger{TResult}.cs b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/tests/ExpectManualCompletionLogger.cs similarity index 100% rename from sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/tests/ExpectManualCompletionLogger{TResult}.cs rename to sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/tests/ExpectManualCompletionLogger.cs diff --git a/sdk/tables/Azure.Data.Tables/src/Azure.Data.Tables.csproj b/sdk/tables/Azure.Data.Tables/src/Azure.Data.Tables.csproj index ac3f504406582..80a68edfb1cfc 100644 --- a/sdk/tables/Azure.Data.Tables/src/Azure.Data.Tables.csproj +++ b/sdk/tables/Azure.Data.Tables/src/Azure.Data.Tables.csproj @@ -16,7 +16,7 @@ - + diff --git a/sdk/tables/Azure.Data.Tables/src/Queryable/ReferenceEqualityComparer{T}.cs b/sdk/tables/Azure.Data.Tables/src/Queryable/ReferenceEqualityComparerOfT.cs similarity index 90% rename from sdk/tables/Azure.Data.Tables/src/Queryable/ReferenceEqualityComparer{T}.cs rename to sdk/tables/Azure.Data.Tables/src/Queryable/ReferenceEqualityComparerOfT.cs index 0ab50f7d587b7..508a5c8bf73ff 100644 --- a/sdk/tables/Azure.Data.Tables/src/Queryable/ReferenceEqualityComparer{T}.cs +++ b/sdk/tables/Azure.Data.Tables/src/Queryable/ReferenceEqualityComparerOfT.cs @@ -7,7 +7,9 @@ namespace Azure.Data.Tables.Queryable { +#pragma warning disable SA1649 // File name should match first type name internal sealed class ReferenceEqualityComparer : ReferenceEqualityComparer, IEqualityComparer +#pragma warning restore SA1649 // File name should match first type name { private static ReferenceEqualityComparer s_instance;