Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DataFactory]Merge master 1217 #17361

Merged
merged 111 commits into from
Dec 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
9b2aadb
Use pre steps to determine whether to record live tests (#17063)
benbp Nov 20, 2020
a0ad54f
Swtich back to smoke-test before doc publishing error gets fixed. (#1…
azure-sdk Nov 20, 2020
fd2fbbd
Azure Monitor Exporter - Update readme (#17094)
rajkumar-rangaraj Nov 20, 2020
1b49bd2
Minor tweak in queue equals check (#17104)
yvgopal Nov 20, 2020
d979d96
[Event Hubs Client] Docs Enhancements (#17085)
jsquire Nov 20, 2020
d1b735e
Sync eng/common directory with azure-sdk-tools for PR 1219 (#17108)
azure-sdk Nov 20, 2020
76b3310
[live tests] Minor fixes for SupportedClouds and Location overrides/d…
benbp Nov 20, 2020
9e0bd11
Support for Identity in Patch for Microsoft.RecoveryServices/Vaults (…
asmaskar Nov 20, 2020
8f924b2
Merge Feature/formrecognizer2.1 into master (#17121)
maririos Nov 20, 2020
53103ed
add changelog for a new nuget minor version bump (#17131)
DorothySun216 Nov 20, 2020
95745b2
Add EnablePartitioning to QueueProperties ctor; rename GetRawMessage …
JoshLove-msft Nov 20, 2020
7f3d5fc
Fix rest doc links for app config samples (#17127)
weshaggard Nov 20, 2020
215a576
[Identity] Merging feature/identity/140 back to master (#17083)
schaabs Nov 21, 2020
620a140
[Event Hubs Client] Fix Live Test Hangs (#17132)
jsquire Nov 21, 2020
29ae434
Increment version for servicebus releases (#17134)
azure-sdk Nov 21, 2020
4724ab9
fix links (#17139)
maririos Nov 21, 2020
7c1669e
[Synapse][Spark] - Fix null reference exception due to some nullable …
idear1203 Nov 23, 2020
93c1e88
[Synapse] - update version for Spark SDK (#17146)
idear1203 Nov 23, 2020
4165398
Increment version for synapse releases (#17147)
azure-sdk Nov 23, 2020
a3bd0be
Integrate InheritDoc into the build (#17123)
christothes Nov 23, 2020
f240ef2
Add NET 5.0 testing (#16947)
pakrym Nov 23, 2020
1aec6d2
TSI: Add default values for ARM parameters (#17133)
Nov 23, 2020
8e65120
[FR] Updates before release (#17152)
maririos Nov 23, 2020
08d8fc7
GA release (#17151)
JoshLove-msft Nov 23, 2020
9768849
Fix CONTRIBUTING.md .NET 5 SDK link (#17161)
chamons Nov 23, 2020
50bc563
Increment version for formrecognizer releases (#17165)
azure-sdk Nov 23, 2020
7e5c5b2
Increment version for core releases (#17162)
azure-sdk Nov 23, 2020
046d3ba
Sync eng/common directory with azure-sdk-tools for PR 1226 (#17128)
azure-sdk Nov 24, 2020
f4cbb5c
Update FxCop analyzers (#17157)
pakrym Nov 24, 2020
5836c48
Skip .NET 5 installation on Windows (#17167)
pakrym Nov 24, 2020
7176926
Prepare for release (#17166)
JoshLove-msft Nov 24, 2020
6adff90
remove project ref (#17171)
JoshLove-msft Nov 24, 2020
703af79
[Synapse] - Generate SDK based on the latest Swagger spec (#17070)
idear1203 Nov 24, 2020
0202c5e
[DataFactory] Set computeType, coreCount to object type to allow expr…
Jingshu923 Nov 24, 2020
b44dfe2
Fixed the bug of the wrong parameter (#17169)
azure-sdk Nov 24, 2020
d1e4e46
Increment version for servicebus releases (#17172)
azure-sdk Nov 24, 2020
7f69b5c
Enable EventHubs WebJobs extension live tests (#17029)
pakrym Nov 24, 2020
e7bfbf5
Azure Monitor Exporter: LogExporter (#17117)
TimothyMothra Nov 24, 2020
a3be3e8
[FR] Undo customized internal enum (#17182)
maririos Nov 24, 2020
29a6bd3
Add sync HttpClient support (#13722)
pakrym Nov 24, 2020
8f2ddf9
[FR] Enable validation for DataTableCell.Text not null in invoices (…
maririos Nov 25, 2020
e11e630
Miberezi (#16978)
MiriBerezin Nov 25, 2020
1eb8d21
[Communication] - PhoneNumberAdministrationClient - adding live tests…
pavelprystinka Nov 25, 2020
256df13
Update storage generator to suppress FxCop issues (#17181)
pakrym Nov 25, 2020
288ff39
[HMACAuthenticationPolicyTest] added new not null check for authValue…
JoshuaLai Nov 25, 2020
fcf2d56
Enable code coverage (#17067)
heaths Nov 25, 2020
f010bbf
fix live test issue (#17200)
pavelprystinka Nov 25, 2020
1af0634
Install dotnet when running smoke tests (#17208)
pakrym Nov 26, 2020
2e4089b
ADT: add info about object serializer override (#17199)
Nov 26, 2020
e4c4e7f
Add blurb about dist tracing (#17059)
JoshLove-msft Nov 26, 2020
0188a11
Fix EventGrid Readme issue (#17209)
Tianyun-G Nov 26, 2020
56b647a
do not check if there any aquired numbers. Will cover this check in t…
pavelprystinka Nov 27, 2020
c360eba
log azurite stderr. (#17230)
kasobol-msft Nov 30, 2020
8ccda7d
[CODEOWNERS] Add chamons to synapse (#17238)
chamons Nov 30, 2020
e6a2a40
Fix doc comment for CertificatePolicy.Default (#17231)
heaths Nov 30, 2020
84f1cb0
Temporarily disable live test weekly allow-all filter (#17236)
benbp Nov 30, 2020
14bd8d7
ConvertPrebuiltOutputToRecognizedForms moved to ClientCommon (#17185)
maririos Nov 30, 2020
05d8343
Properly create secondary endpoint Uri for Azurite endpoints (#17246)
christothes Dec 1, 2020
7eeb660
[FR] Add AAD tests for every endpoint (#17191)
maririos Dec 1, 2020
82d737c
Use BlobsCheckpointStore in scale monitor (#17241)
pakrym Dec 1, 2020
e0b0f90
Update Redis Enterprise to match Updated Swagger (#17214)
greenms Dec 1, 2020
59dddf2
[Event Hubs Client] Live Test Fixes (#17261)
jsquire Dec 1, 2020
36cfd82
[Communication] - PhoneNumberClient - Adding samples for phone number…
pavelprystinka Dec 1, 2020
e4cea1a
Send metadata header on IMDS probe request. (#15875)
isaacbanner Dec 1, 2020
f29c691
CloudNative.CloudEvents bridge library (#17234)
JoshLove-msft Dec 1, 2020
f4dc2e9
Add Mohit to Search owners list (#17275)
heaths Dec 2, 2020
51ebdb1
Remove abstraction layers from EventHubs WebJobs extensions (#17271)
pakrym Dec 2, 2020
6d5a4b8
Fix to be able to CanGenerateSas and GenerateSas from storage clients…
amnguye Dec 2, 2020
2a29edb
Support moniker specific output folders (#17295)
scbedd Dec 2, 2020
9f79bf5
Update to latest AMQP package version (#17290)
JoshLove-msft Dec 3, 2020
cae31d8
Do not generate reports with no coverage (#17293)
heaths Dec 3, 2020
dfbc7aa
Delete redundant files and point to common scripts (#17292)
sima-zhu Dec 3, 2020
0f2da84
Added support for AccountInfo.IsHierarchicalNamespaceEnabled (#17285)
seanmcc-msft Dec 3, 2020
daa7356
Fix template path for tests.yml (#17198)
Dec 3, 2020
ca1e245
Add a default value for environmentName (#17309)
Dec 3, 2020
7d659d6
Resources SDK version 2020-10 (#17163)
Xynoclafe Dec 3, 2020
3812cd6
ClientCertificateAzureServiceTokenProvider dispose of certificate obj…
danicole Dec 3, 2020
967af1a
Add token credential auth support (#17308)
pakrym Dec 3, 2020
b3549a4
[synapse] Trim resource name to 15 char limit in provisioning (#17310)
chamons Dec 3, 2020
7705656
Sync eng/common directory with azure-sdk-tools for PR 1233 (#17314)
azure-sdk Dec 3, 2020
f9af340
[Communication] - PhoneNumberAdministrationClient - fix next page (#1…
pavelprystinka Dec 3, 2020
6455481
Update AutoRest C# version (#17319)
azure-sdk Dec 4, 2020
d4c97ea
[EventGrid] Small README.md updates (#17313)
ellismg Dec 4, 2020
a987d2d
[Storage] Increase network timeout in tests. (#17323)
kasobol-msft Dec 4, 2020
5e17da8
[EventGrid] Add a cross reference to the docs (#17336)
ellismg Dec 4, 2020
7725658
Various renaming for x-language consistency (#17320)
christothes Dec 4, 2020
d263f23
Enable multiple blank lines StyleCop rules (#17318)
pakrym Dec 4, 2020
cd0117a
Enable track 2 mgmt projects by default (#17324)
heaths Dec 4, 2020
19728c1
Sdk automation script (#17193)
ShivangiReja Dec 4, 2020
af4fa58
Fix sync batch method coverage (#17343)
christothes Dec 4, 2020
1058ca2
re-enable InheritDoc (#17259)
christothes Dec 4, 2020
aabb562
Clean up docs (#17342)
JoshLove-msft Dec 4, 2020
8a7caae
add AAD and improve polling for playback (#17296)
maririos Dec 4, 2020
7abd070
[TA] No locale in links and add functionalities to package descriptio…
maririos Dec 4, 2020
69e32d5
Make pageable results internal (#17348)
pavelprystinka Dec 4, 2020
16ac6c4
[TA] Update service version and some cleanup (#17347)
maririos Dec 4, 2020
294ccd1
[Storage] Bump network timeout, add progress logging. (#17350)
kasobol-msft Dec 4, 2020
8f9dcd1
STG 75 (#17242)
amnguye Dec 4, 2020
680f52a
[FR] Update docstrings (#17345)
maririos Dec 5, 2020
dd0215b
[Event Hubs Client] Credential Refresh Buffer Tweak (#17330)
jsquire Dec 5, 2020
89c9098
[Event Hubs Client] Enable Idempotent Producer Tests (#17316)
jsquire Dec 5, 2020
c170d6d
[Data Lake Performance] Test Scenarios for T2 (#17307)
jsquire Dec 7, 2020
38abad1
Replaced hardcoded true/false with TrueString/FalseString (#17359)
abatishchev Dec 7, 2020
c480d4f
[Event Hubs Client] Sample ReadMe Updates (#17315)
jsquire Dec 7, 2020
aa06376
enable AAD in test resources (#17351)
maririos Dec 7, 2020
63c27a9
Make storage mock clients able to generate sas (#17349)
amnguye Dec 7, 2020
3ec8ef0
Prepare storage for release (#17382)
seanmcc-msft Dec 7, 2020
caef830
Create Azure.Security.Attestation Track 2 Preview SDK (#17159)
LarryOsterman Dec 7, 2020
3fdc7b7
[Storage] Live tests - Wait for RBAC replication. (#17385)
kasobol-msft Dec 7, 2020
ee55027
[Synapse] Update swagger
chamons Dec 7, 2020
2801014
Add legacy checkpoint reading support to EventHubs (#17335)
pakrym Dec 7, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-reportgenerator-globaltool": {
"version": "4.8.0",
"commands": [
"reportgenerator"
]
}
}
}
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ sdk/trafficmanager/Microsoft.Azure.Management.TrafficManager/ @tmsupp
#/<NotInRepo>/ @chlahav

# PRLabel: %Search
/sdk/search/ @brjohnstmsft @arv100kri @bleroy @tg-msft @heaths
/sdk/search/ @brjohnstmsft @arv100kri @bleroy @Mohit-Chakraborty @tg-msft @heaths

# ServiceLabel: %Search %Service Attention
/sdk/search/Microsoft.*/ @brjohnstmsft @arv100kri @bleroy @tjacobhi @markheff @miwelsh
Expand Down Expand Up @@ -562,7 +562,7 @@ sdk/trafficmanager/Microsoft.Azure.Management.TrafficManager/ @tmsupp
/sdk/support/Microsoft.Azure.Management.Support/ @shahbj79 @mit2nil @aygoya @ganganarayanan

# ServiceLabel: %Synapse %Service Attention
/sdk/synapse/ @aim-for-better @idear1203
/sdk/synapse/ @aim-for-better @idear1203 @chamons

# PRLabel: %Tables
/sdk/tables/ @christothes
Expand Down
25 changes: 22 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- Install VS 2019 (Community or higher) and make sure you have the latest updates (https://www.visualstudio.com/).
- Need at least .NET Framework 4.6.1 and 4.7 development tools
- Install the **.NET Core cross-platform development** workloads in VisualStudio
- Install **.NET Core 3.1.301 SDK** for your specific platform. (or a higher version within the 3.1.*** band) (https://dotnet.microsoft.com/download/dotnet-core/3.1)
- Install **.NET Core 5.0.100 SDK** for your specific platform. (or a higher version within the 5.0.*** band) (https://dotnet.microsoft.com/download/dotnet-core/5.0)
- Install the latest version of git (https://git-scm.com/downloads)
- Install [NodeJS](https://nodejs.org/en/) (14.x.x) if you plan to use [C# code generation](https://github.com/Azure/autorest.csharp).

Expand Down Expand Up @@ -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

Expand All @@ -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`
Expand Down
1 change: 0 additions & 1 deletion common/Perf/Azure.Test.Perf/PerfProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ private static async Task Run(Type testType, PerfOptions options)

try
{

try
{
await tests[0].GlobalSetupAsync();
Expand Down
2 changes: 2 additions & 0 deletions common/SmokeTests/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ jobs:
- pwsh: Get-Content ./common/SmokeTests/SmokeTest/SmokeTest.csproj
displayName: Show SmokeTest.csproj

- template: /eng/pipelines/templates/steps/install-dotnet.yml

- pwsh: dotnet restore ./common/SmokeTests/SmokeTest/SmokeTest.csproj
displayName: dotnet restore

Expand Down
4 changes: 2 additions & 2 deletions common/Stress/Azure.Test.Stress/StressMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ private static string FormatTable(IEnumerable<(string Key, object Value)> data)
foreach (var kvp in data)
{
sb.Append(kvp.Key);
sb.Append(":");
sb.Append(':');
for (var i = kvp.Key.Length + 1; i < longestKeyLength + padding + 1; i++)
{
sb.Append(" ");
sb.Append(' ');
}
sb.Append(kvp.Value);
sb.AppendLine();
Expand Down
1 change: 0 additions & 1 deletion common/Stress/Azure.Test.Stress/StressTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ protected static string GetEnvironmentVariable(string name)
throw new InvalidOperationException($"Undefined environment variable {name}");
}
return value;

}
}
}
5 changes: 3 additions & 2 deletions doc/ApiDocGeneration/Generate-Api-Docs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ $DocOutApiDir = "${DocOutDir}/api"
$DocOutHtmlDir = "${DocOutDir}/_site"
$MDocTool = "${BinDirectory}/mdoc/mdoc.exe"
$DocFxTool = "${BinDirectory}/docfx/docfx.exe"
$DocCommonGenDir = "$RepoRoot/eng/common/docgeneration"

if ($LibType -eq 'management') {
$ArtifactName = $ArtifactName.Substring($ArtifactName.LastIndexOf('.Management') + 1)
Expand Down Expand Up @@ -128,7 +129,7 @@ Write-Verbose "Copy over generated yml and other assets"
Copy-Item "${YamlOutDir}/*"-Destination "${DocOutApiDir}" -Recurse -Force
Copy-Item "${DocGenDir}/assets/docfx.json" -Destination "${DocOutDir}" -Recurse -Force
New-Item -Path "${DocOutDir}" -Name templates -ItemType directory
Copy-Item "${DocGenDir}/templates/**" -Destination "${DocOutDir}/templates" -Recurse -Force
Copy-Item "${DocCommonGenDir}/templates/**" -Destination "${DocOutDir}/templates" -Recurse -Force

Write-Verbose "Create Toc for Site Navigation"
New-Item "${DocOutDir}/toc.yml" -Force
Expand All @@ -138,7 +139,7 @@ Write-Verbose "Build Doc Content"
& "${DocFxTool}" build "${DocOutDir}/docfx.json"

Write-Verbose "Copy over site Logo"
Copy-Item "${DocGenDir}/assets/logo.svg" -Destination "${DocOutHtmlDir}" -Recurse -Force
Copy-Item "${DocCommonGenDir}/assets/logo.svg" -Destination "${DocOutHtmlDir}" -Recurse -Force

Write-Verbose "Compress and copy HTML into the staging Area"
Compress-Archive -Path "${DocOutHtmlDir}/*" -DestinationPath "${ArtifactStagingDirectory}/${ArtifactName}/${ArtifactName}.docs.zip" -CompressionLevel Fastest
3 changes: 3 additions & 0 deletions eng/.docsettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ known_content_issues:
- ['sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/README.md', 'azure-sdk-tools/issues/404']
- ['sdk/extensions/Microsoft.Azure.WebJobs.Extensions.Clients/README.md','azure-sdk-tools/issues/404']
- ['sdk/extensions/Microsoft.Extensions.Azure/README.md','#5499']
- ['sdk/eventgrid/Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents/README.md', '#15423']
- ['sdk/eventhub/README.md','azure-sdk-tools/issues/42']
- ['sdk/search/README.md','azure-sdk-tools/issues/42']
- ['sdk/formrecognizer/Azure.AI.FormRecognizer/README.md','#5499']
- ['sdk/formrecognizer/Azure.AI.FormRecognizer/README.md','#11492']
Expand All @@ -156,6 +158,7 @@ known_content_issues:
- ['sdk/storage/Azure.Storage.Blobs.Cryptography/README.md','#11492']
- ['sdk/storage/Azure.Storage.Common/README.md','#11492']
- ['sdk/storage/Azure.Storage.Files.DataLake/README.md','#11492']
- ['sdk/storage/Azure.Storage.Files.DataLake/perf/README.md','#11492']
- ['sdk/storage/Azure.Storage.Files.Shares/README.md','#11492']
- ['sdk/storage/Azure.Storage.Queues/README.md','#11492']
- ['sdk/synapse/Microsoft.Azure.Synapse/README.md','#11492']
Expand Down
8 changes: 4 additions & 4 deletions eng/CodeAnalysis.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@
<Rule Id="SA1502" Action="None" /> <!-- Element should not be on a single line -->
<Rule Id="SA1503" Action="None" /> <!-- Braces should not be omitted -->
<Rule Id="SA1504" Action="None" /> <!-- All accessors should be single-line or multi-line -->
<Rule Id="SA1505" Action="None" /> <!-- Opening braces should not be followed by blank line -->
<Rule Id="SA1505" Action="Warning" /> <!-- Opening braces should not be followed by blank line -->
<Rule Id="SA1506" Action="None" /> <!-- Element documentation headers should not be followed by blank line -->
<Rule Id="SA1507" Action="None" /> <!-- Code should not contain multiple blank lines in a row -->
<Rule Id="SA1508" Action="None" /> <!-- Closing braces should not be preceded by blank line -->
<Rule Id="SA1509" Action="None" /> <!-- Opening braces should not be preceded by blank line -->
<Rule Id="SA1507" Action="Warning" /> <!-- Code should not contain multiple blank lines in a row -->
<Rule Id="SA1508" Action="Warning" /> <!-- Closing braces should not be preceded by blank line -->
<Rule Id="SA1509" Action="Warning" /> <!-- Opening braces should not be preceded by blank line -->
<Rule Id="SA1510" Action="None" /> <!-- Chained statement blocks should not be preceded by blank line -->
<Rule Id="SA1511" Action="None" /> <!-- While-do footer should not be preceded by blank line -->
<Rule Id="SA1512" Action="None" /> <!-- Single-line comments should not be followed by blank line -->
Expand Down
18 changes: 18 additions & 0 deletions eng/CodeCoverage.runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="XPlat Code Coverage" enabled="true">
<Configuration>
<Format>cobertura</Format>
<ExcludeByAttribute>ExcludeFromCodeCoverageAttribute,GeneratedCodeAttribute,Obsolete</ExcludeByAttribute>
<IncludeTestAssembly>false</IncludeTestAssembly>
<SingleHit>false</SingleHit>
<SkipAutoProps>true</SkipAutoProps>
</Configuration>
</DataCollector>
<!-- Enable logging to diagnose test host failures -->
<DataCollector friendlyName="blame" enabled="true" />
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>
89 changes: 83 additions & 6 deletions eng/CodeCoverage.targets
Original file line number Diff line number Diff line change
@@ -1,13 +1,89 @@
<Project>
<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<PackageReference Include="coverlet.msbuild">
<PropertyGroup>
<!-- Conditions for which projects should be covered by default. -->
<_IsCodeCoverable Condition="'$(IsClientLibrary)' == 'true'">true</_IsCodeCoverable>
</PropertyGroup>

<PropertyGroup Condition="'$(CollectCoverage)' == 'true' and '$(_IsCodeCoverable)' == 'true' and '$(IsTestProject)' == 'true' and '$(ExcludeFromCodeCoverage)' != 'true'">
<CodeCoverageDirectory Condition="'$(CodeCoverageDirectory)' == ''">$([System.IO.Path]::GetFullPath("$(MSBuildProjectDirectory)\.."))</CodeCoverageDirectory>
<SkipCoverageReport Condition="'$(SkipCoverageReport)' == '' and ('$(ContinuousIntegrationBuild)' == 'true' or '$(TF_BUILD)' == 'true')">true</SkipCoverageReport>
<VSTestCollect Condition="'$(VSTestCollect)' == ''">XPlat Code Coverage</VSTestCollect>
<VSTestSetting Condition="'$(VSTestSetting)' == ''">$(MSBuildThisFileDirectory)CodeCoverage.runsettings</VSTestSetting>
<_CollectCoverage>true</_CollectCoverage>
<_TestResultsDirectory>$(MSBuildProjectDirectory)\TestResults</_TestResultsDirectory>
</PropertyGroup>

<ItemGroup Condition="'$(_CollectCoverage)' == 'true'">
<!--
Use VSTest integration to work around test host crashes on larger collections:
https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/VSTestIntegration.md
-->
<PackageReference Include="coverlet.collector">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<!-- Allows Collection of Code Coverage for Deterministic Builds
https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/DeterministicBuild.md -->
<!-- Clean up previous TestResults so reports are recent. -->
<Target Name="_CleanPreviousCodeCoverage"
BeforeTargets="VSTest"
Condition="'$(_CollectCoverage)' == 'true'">
<RemoveDir Directories="$(_TestResultsDirectory)" />
</Target>

<!-- Set a variable to indicate that a report can be generated. -->
<Target Name="_SetCoverageCollected"
AfterTargets="VSTest"
Condition="'$(_CollectCoverage)' == 'true'">
<ItemGroup>
<_CoverageFiles Include="$(_TestResultsDirectory)\**\coverage.cobertura.xml" />
</ItemGroup>
<PropertyGroup>
<_CoverageCollected Condition="'@(_CoverageFiles)' != ''">true</_CoverageCollected>
</PropertyGroup>

<!-- Indicate to the pipeline a report can be generated. -->
<Message Importance="high"
Condition="'$(_CoverageCollected)' == 'true' and '$(TF_BUILD)' == 'true'"
Text="##vso[task.setvariable variable=coverage.collected]true" />
</Target>

<!-- Should be similar to what's in the pipelines, though generate a full HTML report. -->
<Target Name="GenerateCodeCoverageReport"
AfterTargets="VSTest"
DependsOnTargets="_SetCoverageCollected"
Condition="'$(_CollectCoverage)' == 'true' and '$(SkipCoverageReport)' != 'true' and '$(_CoverageCollected)' == 'true'">
<PropertyGroup>
<CoverageReportCommandLine>dotnet tool run reportgenerator --</CoverageReportCommandLine>
<CoverageReportCommandLine>$(CoverageReportCommandLine) "-reports:$(_TestResultsDirectory)\**\coverage.cobertura.xml"</CoverageReportCommandLine>
<CoverageReportCommandLine>$(CoverageReportCommandLine) -reporttypes:Html</CoverageReportCommandLine>
<CoverageReportCommandLine>$(CoverageReportCommandLine) "-targetdir:$(_TestResultsDirectory)"</CoverageReportCommandLine>
<CoverageReportCommandLine>$(CoverageReportCommandLine) "-filefilters:+$(CodeCoverageDirectory)\**"</CoverageReportCommandLine>
</PropertyGroup>
<Exec Command="$(CoverageReportCommandLine)"
IgnoreExitCode="true"
StandardErrorImportance="high"
StandardOutputImportance="low" />
</Target>

<Target Name="_ValidateSourceFileNames"
BeforeTargets="CoreBuild"
Condition="'$(_IsCodeCoverable)' == 'true'">
<ItemGroup>
<!-- Prevent https://github.com/Azure/azure-sdk-for-net/issues/17164 from becoming an issue further in the build process -->
<_ContainsCurlyBraces Include="@(Compile)" Condition="$([MSBuild]::ValueOrDefault('%(Directory)%(Filename)', '').Contains('{')) or $([MSBuild]::ValueOrDefault('%(Directory)%(Filename)', '').Contains('}'))" />
</ItemGroup>
<Error
Text="File name '%(_ContainsCurlyBraces.FullPath)' cannot contain { or }; remove type parameters from the file name, or change {T} to OfT and disable SA1649 if the class has a non-generic counterpart (https://github.com/Azure/azure-sdk-for-net/issues/17164)."
Condition="'@(_ContainsCurlyBraces)' != ''" />
</Target>

<!--
Allows Collection of Code Coverage for Deterministic Builds:
https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/DeterministicBuild.md

This needs to be available in all projects.
-->
<ItemGroup>
<SourceRoot Include="$(NuGetPackageRoot)" />
</ItemGroup>
Expand All @@ -17,7 +93,8 @@
Returns="@(_LocalTopLevelSourceRoot)"
Condition="'$(DeterministicSourcePaths)' == 'true'">
<ItemGroup>
<_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/>
<_LocalTopLevelSourceRoot Include="@(SourceRoot)"
Condition="'%(SourceRoot.NestedRoot)' == ''"/>
</ItemGroup>
</Target>
</Project>
</Project>
17 changes: 14 additions & 3 deletions eng/Directory.Build.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
CA2231; <!-- Override Equality operators -->
CA2225; <!-- Provide alternative to implicit operators -->
CA1714; <!-- Flags should have plural names -->
CA1062; <!-- Public parameter should be checked for null -->
CA1031; <!-- Don't catch generic exceptions -->
CA2000; <!-- Call dispose on IDisposable objects -->
CA2012; <!-- ValueTask should only be awaited once - conflicts with EnsureCompleted check -->
</NoWarn>

<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand All @@ -51,7 +55,7 @@
<GenerateAPIListing Condition="'$(IsShippingClientLibrary)' == 'true'">true</GenerateAPIListing>
<UpdateSourceOnBuild Condition="'$(UpdateSourceOnBuild)' == ''">$(AZURE_DEV_UPDATESOURCESONBUILD)</UpdateSourceOnBuild>
<PowerShellExe Condition="'$(PowerShellExe)' == ''">pwsh</PowerShellExe>
<CoverletOutputFormat Condition="'$(CoverletOutputFormat)' == '' and '$(CollectCoverage)' == 'true'">cobertura</CoverletOutputFormat>
<InheritDocEnabled>true</InheritDocEnabled>
</PropertyGroup>

<PropertyGroup Condition="'$(IsShippingClientLibrary)' == 'true' and '$(TF_BUILD)' == 'true'">
Expand All @@ -68,6 +72,12 @@
</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(InheritDocEnabled)' != 'false' and '$(TargetFramework)'=='netstandard2.0'">
<NoWarn>
$(NoWarn);IDT001<!-- InheritDoc related to malformed XML in netstandard.xml -->
</NoWarn>
</PropertyGroup>

<!-- CodeAnalysis RuleSet -->
<PropertyGroup Condition="'$(IsClientLibrary)' == 'true'">
<CodeAnalysisRuleSet>$(RepoEngPath)\CodeAnalysis.ruleset</CodeAnalysisRuleSet>
Expand All @@ -85,8 +95,9 @@

<PropertyGroup Condition="'$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true' or '$(IsSamplesProject)' == 'true' or '$(IsPerfProject)' == 'true' or '$(IsStressProject)' == 'true'">
<IsPackable>false</IsPackable>
<RequiredTargetFrameworks>netcoreapp2.1</RequiredTargetFrameworks>
<RequiredTargetFrameworks Condition="'$(OS)' == 'Windows_NT'">netcoreapp2.1;net461</RequiredTargetFrameworks>
<RequiredTargetFrameworks>netcoreapp2.1;net5.0</RequiredTargetFrameworks>
<!-- Also test net461 on Windows; it's listed first so that coverage reports are for netcoreapp2.1 (the "primary"). -->
<RequiredTargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net461;netcoreapp2.1;net5.0</RequiredTargetFrameworks>
</PropertyGroup>

<Import Project="$(RepoRoot)/sdk/core/Azure.Core/src/Azure.Core.props" Condition="'$(IsMgmtClientLibrary)' == 'true'"/>
Expand Down
Loading