diff --git a/Directory.Build.props b/Directory.Build.props
index 1d8854a6ba..94e7a2ac6d 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -45,18 +45,7 @@
preview
true
-
- $(NoWarn);CA1416;RS0037;CS1570;CS1572;CS1573;CS1574;CS1591
+ $(NoWarn);CA1416;RS0037
diff --git a/Directory.Build.targets b/Directory.Build.targets
index d38dee58b5..5aee4dd768 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -1,6 +1,10 @@
-
+
+
+ <_NetFrameworkHostedCompilersVersion Condition="'$(_NetFrameworkHostedCompilersVersion)' == ''">4.11.0-3.24280.3
+
+
-
+
https://github.com/dotnet/arcade
- 7507f80c8db285bbc9939c1dff522a761cf4edc0
+ 4a7d983f833d6b86365ea1b2b4d6ee72fbdbf944
@@ -62,9 +62,9 @@
https://github.com/dotnet/symreader-converter
c5ba7c88f92e2dde156c324a8c8edc04d9fa4fe0
-
+
https://github.com/dotnet/arcade
- 7507f80c8db285bbc9939c1dff522a761cf4edc0
+ 4a7d983f833d6b86365ea1b2b4d6ee72fbdbf944
diff --git a/eng/Versions.props b/eng/Versions.props
index 42c8c210f9..79ce373819 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -66,9 +66,10 @@
17.9.0
- 3.3.1
- 3.3.1
+ 3.4.3
+ 3.4.3
1.0.3-preview
+
2.4.2
2.4.5
2.4.2
@@ -81,9 +82,9 @@
These versions need to be "statically" readable because we read this file as xml in our build and tests.
-->
- [3.3.1]
- [3.3.1]
- [3.2.2]
+ [3.4.3]
+ [3.4.3]
+ [3.3.1]
[2.2.10]
[2.2.10]
[1.4.0]
@@ -91,9 +92,9 @@
See Invoke-TestAssetsBuild in scripts/build.ps1. Exact versions are used to avoid Nuget substituting them by closest match, if we make a typo.
These versions need to be "statically" readable because we read this file as xml in our build and tests. -->
- [17.10.0-release-24177-07]
- [17.9.0]
- [17.8.0]
+ [17.10.0]
+ [17.10.0]
+ [17.9.0]
[17.6.2]
[16.11.0]
[15.9.2]
diff --git a/eng/common/SetupNugetSources.ps1 b/eng/common/SetupNugetSources.ps1
index c07f6a5260..2b0a5c9e66 100644
--- a/eng/common/SetupNugetSources.ps1
+++ b/eng/common/SetupNugetSources.ps1
@@ -1,32 +1,31 @@
# This script adds internal feeds required to build commits that depend on internal package sources. For instance,
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables
# disabled internal Maestro (darc-int*) feeds.
-#
-# Optionally, this script also adds a credential entry for each of the internal feeds if supplied. This credential
-# is added via the standard environment variable VSS_NUGET_EXTERNAL_FEED_ENDPOINTS. See
-# https://github.com/microsoft/artifacts-credprovider/tree/v1.1.1?tab=readme-ov-file#environment-variables for more details
+#
+# Optionally, this script also adds a credential entry for each of the internal feeds if supplied.
#
# See example call for this script below.
#
# - task: PowerShell@2
-# displayName: Setup Internal Feeds
+# displayName: Setup Private Feeds Credentials
# condition: eq(variables['Agent.OS'], 'Windows_NT')
# inputs:
# filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
-# arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config
-# - task: NuGetAuthenticate@1
-#
+# arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
+# env:
+# Token: $(dn-bot-dnceng-artifact-feeds-rw)
+#
# Note that the NuGetAuthenticate task should be called after SetupNugetSources.
# This ensures that:
# - Appropriate creds are set for the added internal feeds (if not supplied to the scrupt)
-# - The credential provider is installed
+# - The credential provider is installed.
#
# This logic is also abstracted into enable-internal-sources.yml.
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)][string]$ConfigFile,
- [string]$Password
+ $Password
)
$ErrorActionPreference = "Stop"
@@ -35,23 +34,12 @@ Set-StrictMode -Version 2.0
. $PSScriptRoot\tools.ps1
-$feedEndpoints = $null
-
-# If a credential is provided, ensure that we don't overwrite the current set of
-# credentials that may have been provided by a previous call to the credential provider.
-if ($Password -and $null -ne $env:VSS_NUGET_EXTERNAL_FEED_ENDPOINTS) {
- $feedEndpoints = $env:VSS_NUGET_EXTERNAL_FEED_ENDPOINTS | ConvertFrom-Json
-} elseif ($Password) {
- $feedEndpoints = @{ endpointCredentials = @() }
-}
-
# Add source entry to PackageSources
-function AddPackageSource($sources, $SourceName, $SourceEndPoint, $pwd) {
+function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Username, $pwd) {
$packageSource = $sources.SelectSingleNode("add[@key='$SourceName']")
- if ($null -eq $packageSource)
+ if ($packageSource -eq $null)
{
- Write-Host "`tAdding package source" $SourceName
$packageSource = $doc.CreateElement("add")
$packageSource.SetAttribute("key", $SourceName)
$packageSource.SetAttribute("value", $SourceEndPoint)
@@ -61,33 +49,63 @@ function AddPackageSource($sources, $SourceName, $SourceEndPoint, $pwd) {
Write-Host "Package source $SourceName already present."
}
- if ($pwd) {
- $feedEndpoints.endpointCredentials = AddCredential -endpointCredentials $feedEndpoints.endpointCredentials -source $SourceEndPoint -pwd $pwd
- }
+ AddCredential -Creds $creds -Source $SourceName -Username $Username -pwd $pwd
}
-# Add a new feed endpoint credential
-function AddCredential([array]$endpointCredentials, $source, $pwd) {
- $endpointCredentials += @{
- endpoint = $source;
- password = $pwd
+# Add a credential node for the specified source
+function AddCredential($creds, $source, $username, $pwd) {
+ # If no cred supplied, don't do anything.
+ if (!$pwd) {
+ return;
}
- return $endpointCredentials
+
+ # Looks for credential configuration for the given SourceName. Create it if none is found.
+ $sourceElement = $creds.SelectSingleNode($Source)
+ if ($sourceElement -eq $null)
+ {
+ $sourceElement = $doc.CreateElement($Source)
+ $creds.AppendChild($sourceElement) | Out-Null
+ }
+
+ # Add the node to the credential if none is found.
+ $usernameElement = $sourceElement.SelectSingleNode("add[@key='Username']")
+ if ($usernameElement -eq $null)
+ {
+ $usernameElement = $doc.CreateElement("add")
+ $usernameElement.SetAttribute("key", "Username")
+ $sourceElement.AppendChild($usernameElement) | Out-Null
+ }
+ $usernameElement.SetAttribute("value", $Username)
+
+ # Add the to the credential if none is found.
+ # Add it as a clear text because there is no support for encrypted ones in non-windows .Net SDKs.
+ # -> https://github.com/NuGet/Home/issues/5526
+ $passwordElement = $sourceElement.SelectSingleNode("add[@key='ClearTextPassword']")
+ if ($passwordElement -eq $null)
+ {
+ $passwordElement = $doc.CreateElement("add")
+ $passwordElement.SetAttribute("key", "ClearTextPassword")
+ $sourceElement.AppendChild($passwordElement) | Out-Null
+ }
+
+ $passwordElement.SetAttribute("value", $pwd)
}
-function InsertMaestroInternalFeedCredentials($Sources, $pwd) {
- $maestroInternalSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]")
+function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Username, $pwd) {
+ $maestroPrivateSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]")
- ForEach ($PackageSource in $maestroInternalSources) {
- Write-Host "`tAdding credential for Maestro's feed:" $PackageSource.Key
- $feedEndpoints.endpointCredentials = AddCredential -endpointCredentials $feedEndpoints.endpointCredentials -source $PackageSource.value -pwd $pwd
+ Write-Host "Inserting credentials for $($maestroPrivateSources.Count) Maestro's private feeds."
+
+ ForEach ($PackageSource in $maestroPrivateSources) {
+ Write-Host "`tInserting credential for Maestro's feed:" $PackageSource.Key
+ AddCredential -Creds $creds -Source $PackageSource.Key -Username $Username -pwd $pwd
}
}
-function EnableInternalPackageSources($DisabledPackageSources) {
- $maestroInternalSources = $DisabledPackageSources.SelectNodes("add[contains(@key,'darc-int')]")
- ForEach ($DisabledPackageSource in $maestroInternalSources) {
- Write-Host "`tEnsuring internal source '$($DisabledPackageSource.key)' is enabled by deleting it from disabledPackageSource"
+function EnablePrivatePackageSources($DisabledPackageSources) {
+ $maestroPrivateSources = $DisabledPackageSources.SelectNodes("add[contains(@key,'darc-int')]")
+ ForEach ($DisabledPackageSource in $maestroPrivateSources) {
+ Write-Host "`tEnsuring private source '$($DisabledPackageSource.key)' is enabled by deleting it from disabledPackageSource"
# Due to https://github.com/NuGet/Home/issues/10291, we must actually remove the disabled entries
$DisabledPackageSources.RemoveChild($DisabledPackageSource)
}
@@ -105,27 +123,38 @@ $doc.Load($filename)
# Get reference to or create one if none exist already
$sources = $doc.DocumentElement.SelectSingleNode("packageSources")
-if ($null -eq $sources) {
+if ($sources -eq $null) {
$sources = $doc.CreateElement("packageSources")
$doc.DocumentElement.AppendChild($sources) | Out-Null
}
+$creds = $null
+if ($Password) {
+ # Looks for a node. Create it if none is found.
+ $creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials")
+ if ($creds -eq $null) {
+ $creds = $doc.CreateElement("packageSourceCredentials")
+ $doc.DocumentElement.AppendChild($creds) | Out-Null
+ }
+}
+
# Check for disabledPackageSources; we'll enable any darc-int ones we find there
$disabledSources = $doc.DocumentElement.SelectSingleNode("disabledPackageSources")
-if ($null -ne $disabledSources) {
+if ($disabledSources -ne $null) {
Write-Host "Checking for any darc-int disabled package sources in the disabledPackageSources node"
- EnableInternalPackageSources -DisabledPackageSources $disabledSources
+ EnablePrivatePackageSources -DisabledPackageSources $disabledSources
}
-if ($Password) {
- InsertMaestroInternalFeedCredentials -Sources $sources -pwd $Password
-}
+$userName = "dn-bot"
+
+# Insert credential nodes for Maestro's private feeds
+InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Username $userName -pwd $Password
# 3.1 uses a different feed url format so it's handled differently here
$dotnet31Source = $sources.SelectSingleNode("add[@key='dotnet3.1']")
-if ($null -ne $dotnet31Source) {
- AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v3/index.json" -pwd $Password
- AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v3/index.json" -pwd $Password
+if ($dotnet31Source -ne $null) {
+ AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password
+ AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password
}
$dotnetVersions = @('5','6','7','8')
@@ -133,18 +162,10 @@ $dotnetVersions = @('5','6','7','8')
foreach ($dotnetVersion in $dotnetVersions) {
$feedPrefix = "dotnet" + $dotnetVersion;
$dotnetSource = $sources.SelectSingleNode("add[@key='$feedPrefix']")
- if ($dotnetSource) {
- AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedprefix-internal/nuget/v3/index.json" -pwd $Password
- AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/v3/index.json" -pwd $Password
+ if ($dotnetSource -ne $null) {
+ AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password
+ AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password
}
}
$doc.Save($filename)
-
-# If any credentials were added or altered, update the VSS_NUGET_EXTERNAL_FEED_ENDPOINTS environment variable
-if ($null -ne $feedEndpoints) {
- # ci is set to true so vso logging commands will be used.
- $ci = $true
- Write-PipelineSetVariable -Name 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' -Value $($feedEndpoints | ConvertTo-Json) -IsMultiJobVariable $false
- Write-PipelineSetVariable -Name 'NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED' -Value "False" -IsMultiJobVariable $false
-}
\ No newline at end of file
diff --git a/eng/common/SetupNugetSources.sh b/eng/common/SetupNugetSources.sh
index 16c1e29ea3..b493479a1d 100644
--- a/eng/common/SetupNugetSources.sh
+++ b/eng/common/SetupNugetSources.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-# This script adds internal feeds required to build commits that depend on intenral package sources. For instance,
+# This script adds internal feeds required to build commits that depend on internal package sources. For instance,
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables
# disabled internal Maestro (darc-int*) feeds.
#
diff --git a/eng/common/core-templates/job/job.yml b/eng/common/core-templates/job/job.yml
index 7df5852797..c732bee9f4 100644
--- a/eng/common/core-templates/job/job.yml
+++ b/eng/common/core-templates/job/job.yml
@@ -24,12 +24,11 @@ parameters:
enablePublishTestResults: false
enablePublishUsingPipelines: false
enableBuildRetry: false
- disableComponentGovernance: ''
- componentGovernanceIgnoreDirectories: ''
mergeTestResults: false
testRunTitle: ''
testResultsFormat: ''
name: ''
+ componentGovernanceSteps: []
preSteps: []
artifactPublishSteps: []
runAsPublic: false
@@ -170,17 +169,8 @@ jobs:
uploadRichNavArtifacts: ${{ coalesce(parameters.richCodeNavigationUploadArtifacts, false) }}
continueOnError: true
- - template: /eng/common/core-templates/steps/component-governance.yml
- parameters:
- is1ESPipeline: ${{ parameters.is1ESPipeline }}
- ${{ if eq(parameters.disableComponentGovernance, '') }}:
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.runAsPublic, 'false'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/dotnet/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/microsoft/'), eq(variables['Build.SourceBranch'], 'refs/heads/main'))) }}:
- disableComponentGovernance: false
- ${{ else }}:
- disableComponentGovernance: true
- ${{ else }}:
- disableComponentGovernance: ${{ parameters.disableComponentGovernance }}
- componentGovernanceIgnoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }}
+ - ${{ each step in parameters.componentGovernanceSteps }}:
+ - ${{ step }}
- ${{ if eq(parameters.enableMicrobuild, 'true') }}:
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
@@ -190,14 +180,6 @@ jobs:
continueOnError: ${{ parameters.continueOnError }}
env:
TeamName: $(_TeamName)
- - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.enableSbom, 'true')) }}:
- - template: /eng/common/core-templates/steps/generate-sbom.yml
- parameters:
- is1ESPipeline: ${{ parameters.is1ESPipeline }}
- PackageVersion: ${{ parameters.packageVersion}}
- BuildDropPath: ${{ parameters.buildDropPath }}
- IgnoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }}
- publishArtifacts: false
# Publish test results
- ${{ if or(and(eq(parameters.enablePublishTestResults, 'true'), eq(parameters.testResultsFormat, '')), eq(parameters.testResultsFormat, 'xunit')) }}:
diff --git a/eng/common/core-templates/job/publish-build-assets.yml b/eng/common/core-templates/job/publish-build-assets.yml
index 8fe9299542..d99a1a3b28 100644
--- a/eng/common/core-templates/job/publish-build-assets.yml
+++ b/eng/common/core-templates/job/publish-build-assets.yml
@@ -87,13 +87,15 @@ jobs:
- task: NuGetAuthenticate@1
- - task: PowerShell@2
+ - task: AzureCLI@2
displayName: Publish Build Assets
inputs:
- filePath: eng\common\sdk-task.ps1
+ azureSubscription: "Darc: Maestro Production"
+ scriptType: ps
+ scriptLocation: scriptPath
+ scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1
arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet
/p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests'
- /p:BuildAssetRegistryToken=$(MaestroAccessToken)
/p:MaestroApiEndpoint=https://maestro.dot.net
/p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }}
/p:OfficialBuildId=$(Build.BuildNumber)
@@ -153,14 +155,16 @@ jobs:
PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }}
is1ESPipeline: ${{ parameters.is1ESPipeline }}
- - task: PowerShell@2
+ - task: AzureCLI@2
displayName: Publish Using Darc
inputs:
- filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1
+ azureSubscription: "Darc: Maestro Production"
+ scriptType: ps
+ scriptLocation: scriptPath
+ scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1
arguments: -BuildId $(BARBuildId)
-PublishingInfraVersion 3
-AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)'
- -MaestroToken '$(MaestroApiAccessToken)'
-WaitPublishingFinish true
-ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}'
-SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}'
diff --git a/eng/common/core-templates/job/source-index-stage1.yml b/eng/common/core-templates/job/source-index-stage1.yml
index 8328e52ab1..945c1c19e8 100644
--- a/eng/common/core-templates/job/source-index-stage1.yml
+++ b/eng/common/core-templates/job/source-index-stage1.yml
@@ -69,23 +69,11 @@ jobs:
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: AzureCLI@2
- displayName: Get stage 1 auth token
+ displayName: Log in to Azure and upload stage1 artifacts to source index
inputs:
azureSubscription: 'SourceDotNet Stage1 Publish'
addSpnToEnvironment: true
scriptType: 'ps'
scriptLocation: 'inlineScript'
inlineScript: |
- echo "##vso[task.setvariable variable=ARM_CLIENT_ID]$env:servicePrincipalId"
- echo "##vso[task.setvariable variable=ARM_ID_TOKEN]$env:idToken"
- echo "##vso[task.setvariable variable=ARM_TENANT_ID]$env:tenantId"
-
- - script: |
- echo "Client ID: $(ARM_CLIENT_ID)"
- echo "ID Token: $(ARM_ID_TOKEN)"
- echo "Tenant ID: $(ARM_TENANT_ID)"
- az login --service-principal -u $(ARM_CLIENT_ID) --tenant $(ARM_TENANT_ID) --allow-no-subscriptions --federated-token $(ARM_ID_TOKEN)
- displayName: "Login to Azure"
-
- - script: $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name) -s netsourceindexstage1 -b stage1
- displayName: Upload stage1 artifacts to source index
+ $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name) -s netsourceindexstage1 -b stage1
diff --git a/eng/common/core-templates/post-build/common-variables.yml b/eng/common/core-templates/post-build/common-variables.yml
index b9ede10bf0..d5627a994a 100644
--- a/eng/common/core-templates/post-build/common-variables.yml
+++ b/eng/common/core-templates/post-build/common-variables.yml
@@ -8,8 +8,6 @@ variables:
# Default Maestro++ API Endpoint and API Version
- name: MaestroApiEndPoint
value: "https://maestro.dot.net"
- - name: MaestroApiAccessToken
- value: $(MaestroAccessToken)
- name: MaestroApiVersion
value: "2020-02-20"
diff --git a/eng/common/core-templates/post-build/post-build.yml b/eng/common/core-templates/post-build/post-build.yml
index fb15c40c03..20924366b8 100644
--- a/eng/common/core-templates/post-build/post-build.yml
+++ b/eng/common/core-templates/post-build/post-build.yml
@@ -300,14 +300,16 @@ stages:
- task: NuGetAuthenticate@1
- - task: PowerShell@2
+ - task: AzureCLI@2
displayName: Publish Using Darc
inputs:
- filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1
+ azureSubscription: "Darc: Maestro Production"
+ scriptType: ps
+ scriptLocation: scriptPath
+ scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1
arguments: -BuildId $(BARBuildId)
-PublishingInfraVersion ${{ parameters.publishingInfraVersion }}
-AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)'
- -MaestroToken '$(MaestroApiAccessToken)'
-WaitPublishingFinish true
-ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}'
-SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}'
diff --git a/eng/common/core-templates/post-build/setup-maestro-vars.yml b/eng/common/core-templates/post-build/setup-maestro-vars.yml
index 8d56b57267..f7602980db 100644
--- a/eng/common/core-templates/post-build/setup-maestro-vars.yml
+++ b/eng/common/core-templates/post-build/setup-maestro-vars.yml
@@ -15,19 +15,20 @@ steps:
artifactName: ReleaseConfigs
checkDownloadedFiles: true
- - task: PowerShell@2
+ - task: AzureCLI@2
name: setReleaseVars
displayName: Set Release Configs Vars
inputs:
- targetType: inline
- pwsh: true
- script: |
+ azureSubscription: "Darc: Maestro Production"
+ scriptType: pscore
+ scriptLocation: inlineScript
+ inlineScript: |
try {
if (!$Env:PromoteToMaestroChannels -or $Env:PromoteToMaestroChannels.Trim() -eq '') {
$Content = Get-Content $(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt
$BarId = $Content | Select -Index 0
- $Channels = $Content | Select -Index 1
+ $Channels = $Content | Select -Index 1
$IsStableBuild = $Content | Select -Index 2
$AzureDevOpsProject = $Env:System_TeamProject
@@ -35,15 +36,16 @@ steps:
$AzureDevOpsBuildId = $Env:Build_BuildId
}
else {
- $buildApiEndpoint = "${Env:MaestroApiEndPoint}/api/builds/${Env:BARBuildId}?api-version=${Env:MaestroApiVersion}"
+ . $(Build.SourcesDirectory)\eng\common\tools.ps1
+ $darc = Get-Darc
+ $buildInfo = & $darc get-build `
+ --id ${{ parameters.BARBuildId }} `
+ --extended `
+ --output-format json `
+ --ci `
+ | convertFrom-Json
- $apiHeaders = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]'
- $apiHeaders.Add('Accept', 'application/json')
- $apiHeaders.Add('Authorization',"Bearer ${Env:MAESTRO_API_TOKEN}")
-
- $buildInfo = try { Invoke-WebRequest -Method Get -Uri $buildApiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" }
-
- $BarId = $Env:BARBuildId
+ $BarId = ${{ parameters.BARBuildId }}
$Channels = $Env:PromoteToMaestroChannels -split ","
$Channels = $Channels -join "]["
$Channels = "[$Channels]"
@@ -69,6 +71,4 @@ steps:
exit 1
}
env:
- MAESTRO_API_TOKEN: $(MaestroApiAccessToken)
- BARBuildId: ${{ parameters.BARBuildId }}
PromoteToMaestroChannels: ${{ parameters.PromoteToChannelIds }}
diff --git a/eng/common/core-templates/steps/component-governance.yml b/eng/common/core-templates/steps/component-governance.yml
index df449a34c1..cf0649aa95 100644
--- a/eng/common/core-templates/steps/component-governance.yml
+++ b/eng/common/core-templates/steps/component-governance.yml
@@ -2,7 +2,8 @@ parameters:
disableComponentGovernance: false
componentGovernanceIgnoreDirectories: ''
is1ESPipeline: false
-
+ displayName: 'Component Detection'
+
steps:
- ${{ if eq(parameters.disableComponentGovernance, 'true') }}:
- script: echo "##vso[task.setvariable variable=skipComponentGovernanceDetection]true"
@@ -10,5 +11,6 @@ steps:
- ${{ if ne(parameters.disableComponentGovernance, 'true') }}:
- task: ComponentGovernanceComponentDetection@0
continueOnError: true
+ displayName: ${{ parameters.displayName }}
inputs:
- ignoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }}
\ No newline at end of file
+ ignoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }}
diff --git a/eng/common/core-templates/steps/enable-internal-sources.yml b/eng/common/core-templates/steps/enable-internal-sources.yml
index 80deddafb1..64f881bffc 100644
--- a/eng/common/core-templates/steps/enable-internal-sources.yml
+++ b/eng/common/core-templates/steps/enable-internal-sources.yml
@@ -6,30 +6,42 @@ parameters:
- name: is1ESPipeline
type: boolean
default: false
+# Legacy parameters to allow for PAT usage
+- name: legacyCredential
+ type: string
+ default: ''
steps:
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- # If running on dnceng (internal project), just use the default behavior for NuGetAuthenticate.
- # If running on DevDiv, NuGetAuthenticate is not really an option. It's scoped to a single feed, and we have many feeds that
- # may be added. Instead, we'll use the traditional approach (add cred to nuget.config), but use an account token.
- - ${{ if eq(variables['System.TeamProject'], 'internal') }}:
+ - ${{ if ne(parameters.legacyCredential, '') }}:
- task: PowerShell@2
displayName: Setup Internal Feeds
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
- arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config
- - task: NuGetAuthenticate@1
+ arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
+ env:
+ Token: ${{ parameters.legacyCredential }}
+ # If running on dnceng (internal project), just use the default behavior for NuGetAuthenticate.
+ # If running on DevDiv, NuGetAuthenticate is not really an option. It's scoped to a single feed, and we have many feeds that
+ # may be added. Instead, we'll use the traditional approach (add cred to nuget.config), but use an account token.
- ${{ else }}:
- - template: /eng/common/templates/steps/get-federated-access-token.yml
- parameters:
- federatedServiceConnection: ${{ parameters.nugetFederatedServiceConnection }}
- outputVariableName: 'dnceng-artifacts-feeds-read-access-token'
- - task: PowerShell@2
- displayName: Setup Internal Feeds
- inputs:
- filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
- arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $(dnceng-artifacts-feeds-read-access-token)
- # This is required in certain scenarios to install the ADO credential provider.
- # It installed by default in some msbuild invocations (e.g. VS msbuild), but needs to be installed for others
- # (e.g. dotnet msbuild).
- - task: NuGetAuthenticate@1
+ - ${{ if eq(variables['System.TeamProject'], 'internal') }}:
+ - task: PowerShell@2
+ displayName: Setup Internal Feeds
+ inputs:
+ filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
+ arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config
+ - ${{ else }}:
+ - template: /eng/common/templates/steps/get-federated-access-token.yml
+ parameters:
+ federatedServiceConnection: ${{ parameters.nugetFederatedServiceConnection }}
+ outputVariableName: 'dnceng-artifacts-feeds-read-access-token'
+ - task: PowerShell@2
+ displayName: Setup Internal Feeds
+ inputs:
+ filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
+ arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $(dnceng-artifacts-feeds-read-access-token)
+ # This is required in certain scenarios to install the ADO credential provider.
+ # It installed by default in some msbuild invocations (e.g. VS msbuild), but needs to be installed for others
+ # (e.g. dotnet msbuild).
+ - task: NuGetAuthenticate@1
diff --git a/eng/common/core-templates/steps/source-build.yml b/eng/common/core-templates/steps/source-build.yml
index 16c778d92c..2915d29bb7 100644
--- a/eng/common/core-templates/steps/source-build.yml
+++ b/eng/common/core-templates/steps/source-build.yml
@@ -121,7 +121,9 @@ steps:
# a nupkg cache of input packages (a local feed).
# This path must match the upstream cache path in property 'CurrentRepoSourceBuiltNupkgCacheDir'
# in src\Microsoft.DotNet.Arcade.Sdk\tools\SourceBuild\SourceBuildArcade.targets
-- task: ComponentGovernanceComponentDetection@0
- displayName: Component Detection (Exclude upstream cache)
- inputs:
- ignoreDirectories: '$(Build.SourcesDirectory)/artifacts/sb/src/artifacts/obj/source-built-upstream-cache'
+- template: /eng/common/core-templates/steps/component-governance.yml
+ parameters:
+ displayName: Component Detection (Exclude upstream cache)
+ is1ESPipeline: ${{ parameters.is1ESPipeline }}
+ componentGovernanceIgnoreDirectories: '$(Build.SourcesDirectory)/artifacts/sb/src/artifacts/obj/source-built-upstream-cache'
+ disableComponentGovernance: ${{ eq(variables['System.TeamProject'], 'public') }}
diff --git a/eng/common/cross/arm/sources.list.bionic b/eng/common/cross/arm/sources.list.bionic
deleted file mode 100644
index 2109557409..0000000000
--- a/eng/common/cross/arm/sources.list.bionic
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
diff --git a/eng/common/cross/arm/sources.list.focal b/eng/common/cross/arm/sources.list.focal
deleted file mode 100644
index 4de2600c17..0000000000
--- a/eng/common/cross/arm/sources.list.focal
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse
diff --git a/eng/common/cross/arm/sources.list.jammy b/eng/common/cross/arm/sources.list.jammy
deleted file mode 100644
index 6bb0453029..0000000000
--- a/eng/common/cross/arm/sources.list.jammy
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse
diff --git a/eng/common/cross/arm/sources.list.jessie b/eng/common/cross/arm/sources.list.jessie
deleted file mode 100644
index 4d142ac9b1..0000000000
--- a/eng/common/cross/arm/sources.list.jessie
+++ /dev/null
@@ -1,3 +0,0 @@
-# Debian (sid) # UNSTABLE
-deb http://ftp.debian.org/debian/ sid main contrib non-free
-deb-src http://ftp.debian.org/debian/ sid main contrib non-free
diff --git a/eng/common/cross/arm/sources.list.xenial b/eng/common/cross/arm/sources.list.xenial
deleted file mode 100644
index 56fbb36a59..0000000000
--- a/eng/common/cross/arm/sources.list.xenial
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
diff --git a/eng/common/cross/arm/sources.list.zesty b/eng/common/cross/arm/sources.list.zesty
deleted file mode 100644
index ea2c14a787..0000000000
--- a/eng/common/cross/arm/sources.list.zesty
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
diff --git a/eng/common/cross/arm64/sources.list.bionic b/eng/common/cross/arm64/sources.list.bionic
deleted file mode 100644
index 2109557409..0000000000
--- a/eng/common/cross/arm64/sources.list.bionic
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
diff --git a/eng/common/cross/arm64/sources.list.buster b/eng/common/cross/arm64/sources.list.buster
deleted file mode 100644
index 7194ac64a9..0000000000
--- a/eng/common/cross/arm64/sources.list.buster
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://deb.debian.org/debian buster main
-deb-src http://deb.debian.org/debian buster main
-
-deb http://deb.debian.org/debian-security/ buster/updates main
-deb-src http://deb.debian.org/debian-security/ buster/updates main
-
-deb http://deb.debian.org/debian buster-updates main
-deb-src http://deb.debian.org/debian buster-updates main
-
-deb http://deb.debian.org/debian buster-backports main contrib non-free
-deb-src http://deb.debian.org/debian buster-backports main contrib non-free
diff --git a/eng/common/cross/arm64/sources.list.focal b/eng/common/cross/arm64/sources.list.focal
deleted file mode 100644
index 4de2600c17..0000000000
--- a/eng/common/cross/arm64/sources.list.focal
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse
diff --git a/eng/common/cross/arm64/sources.list.jammy b/eng/common/cross/arm64/sources.list.jammy
deleted file mode 100644
index 6bb0453029..0000000000
--- a/eng/common/cross/arm64/sources.list.jammy
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse
diff --git a/eng/common/cross/arm64/sources.list.stretch b/eng/common/cross/arm64/sources.list.stretch
deleted file mode 100644
index 0e12157743..0000000000
--- a/eng/common/cross/arm64/sources.list.stretch
+++ /dev/null
@@ -1,12 +0,0 @@
-deb http://deb.debian.org/debian stretch main
-deb-src http://deb.debian.org/debian stretch main
-
-deb http://deb.debian.org/debian-security/ stretch/updates main
-deb-src http://deb.debian.org/debian-security/ stretch/updates main
-
-deb http://deb.debian.org/debian stretch-updates main
-deb-src http://deb.debian.org/debian stretch-updates main
-
-deb http://deb.debian.org/debian stretch-backports main contrib non-free
-deb-src http://deb.debian.org/debian stretch-backports main contrib non-free
-
diff --git a/eng/common/cross/arm64/sources.list.xenial b/eng/common/cross/arm64/sources.list.xenial
deleted file mode 100644
index 56fbb36a59..0000000000
--- a/eng/common/cross/arm64/sources.list.xenial
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
diff --git a/eng/common/cross/arm64/sources.list.zesty b/eng/common/cross/arm64/sources.list.zesty
deleted file mode 100644
index ea2c14a787..0000000000
--- a/eng/common/cross/arm64/sources.list.zesty
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
diff --git a/eng/common/cross/armel/sources.list.jessie b/eng/common/cross/armel/sources.list.jessie
deleted file mode 100644
index 3d9c3059d8..0000000000
--- a/eng/common/cross/armel/sources.list.jessie
+++ /dev/null
@@ -1,3 +0,0 @@
-# Debian (jessie) # Stable
-deb http://ftp.debian.org/debian/ jessie main contrib non-free
-deb-src http://ftp.debian.org/debian/ jessie main contrib non-free
diff --git a/eng/common/cross/armv6/sources.list.bookworm b/eng/common/cross/armv6/sources.list.bookworm
deleted file mode 100644
index 1016113526..0000000000
--- a/eng/common/cross/armv6/sources.list.bookworm
+++ /dev/null
@@ -1,2 +0,0 @@
-deb http://raspbian.raspberrypi.org/raspbian/ bookworm main contrib non-free rpi
-deb-src http://raspbian.raspberrypi.org/raspbian/ bookworm main contrib non-free rpi
diff --git a/eng/common/cross/armv6/sources.list.buster b/eng/common/cross/armv6/sources.list.buster
deleted file mode 100644
index f27fc4fb34..0000000000
--- a/eng/common/cross/armv6/sources.list.buster
+++ /dev/null
@@ -1,2 +0,0 @@
-deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
-deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh
index 7455dcb6af..eb1a908046 100644
--- a/eng/common/cross/build-rootfs.sh
+++ b/eng/common/cross/build-rootfs.sh
@@ -30,7 +30,8 @@ __IllumosArch=arm7
__HaikuArch=arm
__QEMUArch=arm
__UbuntuArch=armhf
-__UbuntuRepo="http://ports.ubuntu.com/"
+__UbuntuRepo=
+__UbuntuSuites="updates security backports"
__LLDB_Package="liblldb-3.9-dev"
__SkipUnmount=0
@@ -129,6 +130,7 @@ __AlpineKeys='
616db30d:MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAnpUpyWDWjlUk3smlWeA0\nlIMW+oJ38t92CRLHH3IqRhyECBRW0d0aRGtq7TY8PmxjjvBZrxTNDpJT6KUk4LRm\na6A6IuAI7QnNK8SJqM0DLzlpygd7GJf8ZL9SoHSH+gFsYF67Cpooz/YDqWrlN7Vw\ntO00s0B+eXy+PCXYU7VSfuWFGK8TGEv6HfGMALLjhqMManyvfp8hz3ubN1rK3c8C\nUS/ilRh1qckdbtPvoDPhSbTDmfU1g/EfRSIEXBrIMLg9ka/XB9PvWRrekrppnQzP\nhP9YE3x/wbFc5QqQWiRCYyQl/rgIMOXvIxhkfe8H5n1Et4VAorkpEAXdsfN8KSVv\nLSMazVlLp9GYq5SUpqYX3KnxdWBgN7BJoZ4sltsTpHQ/34SXWfu3UmyUveWj7wp0\nx9hwsPirVI00EEea9AbP7NM2rAyu6ukcm4m6ATd2DZJIViq2es6m60AE6SMCmrQF\nwmk4H/kdQgeAELVfGOm2VyJ3z69fQuywz7xu27S6zTKi05Qlnohxol4wVb6OB7qG\nLPRtK9ObgzRo/OPumyXqlzAi/Yvyd1ZQk8labZps3e16bQp8+pVPiumWioMFJDWV\nGZjCmyMSU8V6MB6njbgLHoyg2LCukCAeSjbPGGGYhnKLm1AKSoJh3IpZuqcKCk5C\n8CM1S15HxV78s9dFntEqIokCAwEAAQ==
'
__Keyring=
+__KeyringFile="/usr/share/keyrings/ubuntu-archive-keyring.gpg"
__SkipSigCheck=0
__UseMirror=0
@@ -162,6 +164,7 @@ while :; do
__UbuntuArch=armel
__UbuntuRepo="http://ftp.debian.org/debian/"
__CodeName=jessie
+ __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg"
;;
armv6)
__BuildArch=armv6
@@ -169,10 +172,12 @@ while :; do
__QEMUArch=arm
__UbuntuRepo="http://raspbian.raspberrypi.org/raspbian/"
__CodeName=buster
+ __KeyringFile="/usr/share/keyrings/raspbian-archive-keyring.gpg"
__LLDB_Package="liblldb-6.0-dev"
+ __UbuntuSuites=
- if [[ -e "/usr/share/keyrings/raspbian-archive-keyring.gpg" ]]; then
- __Keyring="--keyring /usr/share/keyrings/raspbian-archive-keyring.gpg"
+ if [[ -e "$__KeyringFile" ]]; then
+ __Keyring="--keyring $__KeyringFile"
fi
;;
riscv64)
@@ -181,13 +186,8 @@ while :; do
__AlpinePackages="${__AlpinePackages// lldb-dev/}"
__QEMUArch=riscv64
__UbuntuArch=riscv64
- __UbuntuRepo="http://deb.debian.org/debian"
__UbuntuPackages="${__UbuntuPackages// libunwind8-dev/}"
unset __LLDB_Package
-
- if [[ -e "/usr/share/keyrings/debian-archive-keyring.gpg" ]]; then
- __Keyring="--keyring /usr/share/keyrings/debian-archive-keyring.gpg --include=debian-archive-keyring"
- fi
;;
ppc64le)
__BuildArch=ppc64le
@@ -288,8 +288,17 @@ while :; do
__CodeName=jammy
fi
;;
+ noble) # Ubuntu 24.04
+ if [[ "$__CodeName" != "jessie" ]]; then
+ __CodeName=noble
+ fi
+ if [[ -n "$__LLDB_Package" ]]; then
+ __LLDB_Package="liblldb-18-dev"
+ fi
+ ;;
jessie) # Debian 8
__CodeName=jessie
+ __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg"
if [[ -z "$__UbuntuRepo" ]]; then
__UbuntuRepo="http://ftp.debian.org/debian/"
@@ -298,6 +307,7 @@ while :; do
stretch) # Debian 9
__CodeName=stretch
__LLDB_Package="liblldb-6.0-dev"
+ __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg"
if [[ -z "$__UbuntuRepo" ]]; then
__UbuntuRepo="http://ftp.debian.org/debian/"
@@ -306,6 +316,7 @@ while :; do
buster) # Debian 10
__CodeName=buster
__LLDB_Package="liblldb-6.0-dev"
+ __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg"
if [[ -z "$__UbuntuRepo" ]]; then
__UbuntuRepo="http://ftp.debian.org/debian/"
@@ -313,6 +324,7 @@ while :; do
;;
bullseye) # Debian 11
__CodeName=bullseye
+ __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg"
if [[ -z "$__UbuntuRepo" ]]; then
__UbuntuRepo="http://ftp.debian.org/debian/"
@@ -320,6 +332,7 @@ while :; do
;;
bookworm) # Debian 12
__CodeName=bookworm
+ __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg"
if [[ -z "$__UbuntuRepo" ]]; then
__UbuntuRepo="http://ftp.debian.org/debian/"
@@ -327,6 +340,7 @@ while :; do
;;
sid) # Debian sid
__CodeName=sid
+ __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg"
if [[ -z "$__UbuntuRepo" ]]; then
__UbuntuRepo="http://ftp.debian.org/debian/"
@@ -436,6 +450,10 @@ fi
__UbuntuPackages+=" ${__LLDB_Package:-}"
+if [[ -z "$__UbuntuRepo" ]]; then
+ __UbuntuRepo="http://ports.ubuntu.com/"
+fi
+
if [[ -n "$__LLVM_MajorVersion" ]]; then
__UbuntuPackages+=" libclang-common-${__LLVM_MajorVersion}${__LLVM_MinorVersion:+.$__LLVM_MinorVersion}-dev"
fi
@@ -732,8 +750,18 @@ elif [[ -n "$__CodeName" ]]; then
fi
# shellcheck disable=SC2086
+ echo running debootstrap "--variant=minbase" $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo"
debootstrap "--variant=minbase" $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo"
- cp "$__CrossDir/$__BuildArch/sources.list.$__CodeName" "$__RootfsDir/etc/apt/sources.list"
+
+ mkdir -p "$__RootfsDir/etc/apt/sources.list.d/"
+ cat > "$__RootfsDir/etc/apt/sources.list.d/$__CodeName.sources" <
/// The field or property member that is promised to be not-null.
///
- public MemberNotNullAttribute(string member) => Members = new[] { member };
+ public MemberNotNullAttribute(string member) => Members = [member];
/// Initializes the attribute with the list of field and property members.
///
@@ -122,7 +122,7 @@ internal sealed class MemberNotNullWhenAttribute : Attribute
public MemberNotNullWhenAttribute(bool returnValue, string member)
{
ReturnValue = returnValue;
- Members = new[] { member };
+ Members = [member];
}
/// Initializes the attribute with the specified return value condition and list of field and property members.
diff --git a/src/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector/EventLogDataCollector.cs b/src/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector/EventLogDataCollector.cs
index 6d93832971..9296983499 100644
--- a/src/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector/EventLogDataCollector.cs
+++ b/src/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector/EventLogDataCollector.cs
@@ -326,7 +326,7 @@ protected override void Dispose(bool disposing)
private static ISet ParseCommaSeparatedList(string commaSeparatedList)
{
ISet strings = new HashSet();
- string[] items = commaSeparatedList.Split(new char[] { ',' });
+ string[] items = commaSeparatedList.Split([',']);
foreach (string item in items)
{
strings.Add(item.Trim());
diff --git a/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask2.cs b/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask2.cs
index 1443725e62..cbc866d928 100644
--- a/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask2.cs
+++ b/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask2.cs
@@ -48,7 +48,7 @@ public class VSTestTask2 : ToolTask, ITestTask
protected override Encoding StandardOutputEncoding => _disableUtf8ConsoleEncoding ? base.StandardOutputEncoding : Encoding.UTF8;
private readonly string _messageSplitter = "||||";
- private readonly string[] _messageSplitterArray = new[] { "||||" };
+ private readonly string[] _messageSplitterArray = ["||||"];
private readonly string _ansiReset = "\x1b[39;49m";
private readonly bool _disableUtf8ConsoleEncoding;
@@ -271,7 +271,7 @@ private bool TryGetMessage(string singleLine, out string name, out string?[] dat
}
name = string.Empty;
- data = Array.Empty();
+ data = [];
return false;
}
diff --git a/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs b/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs
index b3e59ba1c5..f64f20374e 100644
--- a/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs
+++ b/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs
@@ -334,7 +334,7 @@ public int LaunchCustomHost(TestProcessStartInfo testProcessStartInfo, Cancellat
// Even if TP has a timeout here, there is no way TP can abort or stop the thread/task that is hung in IDE or LUT
// Even if TP can abort the API somehow, TP is essentially putting IDEs or Clients in inconsistent state without having info on
// Since the IDEs own user-UI-experience here, TP will let the custom host launch as much time as IDEs define it for their users
- WaitHandle.WaitAny(new WaitHandle[] { waitHandle, cancellationToken.WaitHandle });
+ WaitHandle.WaitAny([waitHandle, cancellationToken.WaitHandle]);
cancellationToken.ThrowTestPlatformExceptionIfCancellationRequested();
@@ -387,7 +387,7 @@ public bool AttachDebuggerToProcess(AttachDebuggerInfo attachDebuggerInfo, Cance
_communicationManager.SendMessage(MessageType.EditorAttachDebugger2, payload);
}
- WaitHandle.WaitAny(new WaitHandle[] { waitHandle, cancellationToken.WaitHandle });
+ WaitHandle.WaitAny([waitHandle, cancellationToken.WaitHandle]);
cancellationToken.ThrowTestPlatformExceptionIfCancellationRequested();
onAttachDebuggerAckRecieved = null;
diff --git a/src/Microsoft.TestPlatform.Client/DesignMode/IDesignModeClient.cs b/src/Microsoft.TestPlatform.Client/DesignMode/IDesignModeClient.cs
index 1a21066235..a8b8c023c6 100644
--- a/src/Microsoft.TestPlatform.Client/DesignMode/IDesignModeClient.cs
+++ b/src/Microsoft.TestPlatform.Client/DesignMode/IDesignModeClient.cs
@@ -20,6 +20,7 @@ public interface IDesignModeClient : IDisposable
/// Setups client based on port
///
/// port number to connect
+ /// test request manager
void ConnectToClientAndProcessRequests(int port, ITestRequestManager testRequestManager);
///
diff --git a/src/Microsoft.TestPlatform.Client/Discovery/DiscoveryRequest.cs b/src/Microsoft.TestPlatform.Client/Discovery/DiscoveryRequest.cs
index 9a2e655868..530a5d82f3 100644
--- a/src/Microsoft.TestPlatform.Client/Discovery/DiscoveryRequest.cs
+++ b/src/Microsoft.TestPlatform.Client/Discovery/DiscoveryRequest.cs
@@ -33,6 +33,7 @@ public sealed class DiscoveryRequest : IDiscoveryRequest, ITestDiscoveryEventsHa
/// The Request Data instance providing services and data for discovery
/// Discovery criterion.
/// Discovery manager instance.
+ /// Logger manager instance.
internal DiscoveryRequest(IRequestData requestData, DiscoveryCriteria criteria, IProxyDiscoveryManager discoveryManager, ITestLoggerManager loggerManager)
: this(requestData, criteria, discoveryManager, loggerManager, JsonDataSerializer.Instance)
{
@@ -44,6 +45,7 @@ internal DiscoveryRequest(IRequestData requestData, DiscoveryCriteria criteria,
/// The Request Data instance providing services and data for discovery
/// Discovery criterion.
/// Discovery manager instance.
+ /// Logger manager instance.
/// Data Serializer
internal DiscoveryRequest(
IRequestData requestData,
diff --git a/src/Microsoft.TestPlatform.Client/RequestHelper/ITestRequestManager.cs b/src/Microsoft.TestPlatform.Client/RequestHelper/ITestRequestManager.cs
index 291d69954f..758c63a6f0 100644
--- a/src/Microsoft.TestPlatform.Client/RequestHelper/ITestRequestManager.cs
+++ b/src/Microsoft.TestPlatform.Client/RequestHelper/ITestRequestManager.cs
@@ -92,7 +92,7 @@ void StartTestSession(
/// Stops a test session.
///
///
- /// The stop test session payload.
+ /// The stop test session payload.
/// The events handler.
/// Protocol related information.
void StopTestSession(
diff --git a/src/Microsoft.TestPlatform.Client/TestPlatform.cs b/src/Microsoft.TestPlatform.Client/TestPlatform.cs
index 45ee1303a1..56a1dea9c2 100644
--- a/src/Microsoft.TestPlatform.Client/TestPlatform.cs
+++ b/src/Microsoft.TestPlatform.Client/TestPlatform.cs
@@ -231,6 +231,7 @@ private void AddExtensionAssemblies(string? runSettings, TestAdapterLoadingStrat
///
///
/// The list of sources.
+ /// Adapter loading strategy
private void AddLoggerAssembliesFromSource(IEnumerable sources, TestAdapterLoadingStrategy strategy)
{
// Skip discovery unless we're using the default behavior, or NextToSource is specified.
@@ -283,7 +284,7 @@ private static void AddExtensionAssembliesFromExtensionDirectory()
TestAdapterLoadingStrategy strategy = runConfiguration.TestAdapterLoadingStrategy;
FileHelper fileHelper = new();
- IEnumerable defaultExtensionPaths = Enumerable.Empty();
+ IEnumerable defaultExtensionPaths = [];
// Explicit adapter loading
if (strategy.HasFlag(TestAdapterLoadingStrategy.Explicit))
@@ -354,7 +355,7 @@ private static IEnumerable ExpandAdaptersWithExplicitStrategy(string pat
{
if (!strategy.HasFlag(TestAdapterLoadingStrategy.Explicit))
{
- return Enumerable.Empty();
+ return [];
}
if (fileHelper.Exists(path))
@@ -377,7 +378,7 @@ private static IEnumerable ExpandAdaptersWithExplicitStrategy(string pat
}
EqtTrace.Warning($"{nameof(TestPlatform)}.{nameof(ExpandAdaptersWithExplicitStrategy)} AdapterPath Not Found: {path}");
- return Enumerable.Empty();
+ return [];
}
private static IEnumerable ExpandAdaptersWithDefaultStrategy(string path, IFileHelper fileHelper)
@@ -388,7 +389,7 @@ private static IEnumerable ExpandAdaptersWithDefaultStrategy(string path
{
EqtTrace.Warning($"{nameof(TestPlatform)}.{nameof(ExpandAdaptersWithDefaultStrategy)} AdapterPath Not Found: {path}");
- return Enumerable.Empty();
+ return [];
}
return fileHelper.EnumerateFiles(
diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionManager.cs b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionManager.cs
index 055d3d0e39..5fdaf63c00 100644
--- a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionManager.cs
+++ b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionManager.cs
@@ -79,6 +79,8 @@ internal class DataCollectionManager : IDataCollectionManager
///
/// The message Sink.
///
+ /// request data
+ /// telemetry reporter
internal DataCollectionManager(IMessageSink messageSink, IRequestData requestData, ITelemetryReporter telemetryReporter) : this(new DataCollectionAttachmentManager(), messageSink, new DataCollectionTelemetryManager(requestData), telemetryReporter)
{
}
@@ -92,6 +94,8 @@ internal class DataCollectionManager : IDataCollectionManager
///
/// The message Sink.
///
+ /// telemetry manager
+ /// telemetry reporter
///
/// The constructor is not public because the factory method should be used to get instances of this class.
///
@@ -136,6 +140,8 @@ private DataCollectorExtensionManager DataCollectorExtensionManager
///
/// The message sink.
///
+ /// request data
+ /// telemetry reporter
///
/// The .
///
diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/Interfaces/IDataCollectionAttachmentManager.cs b/src/Microsoft.TestPlatform.Common/DataCollection/Interfaces/IDataCollectionAttachmentManager.cs
index adda6c450e..bcc92420e9 100644
--- a/src/Microsoft.TestPlatform.Common/DataCollection/Interfaces/IDataCollectionAttachmentManager.cs
+++ b/src/Microsoft.TestPlatform.Common/DataCollection/Interfaces/IDataCollectionAttachmentManager.cs
@@ -36,7 +36,7 @@ internal interface IDataCollectionAttachmentManager
/// The data collection context.
///
///
- /// The .
+ /// The .
///
List GetAttachments(DataCollectionContext dataCollectionContext);
diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/DataCollectionExtensionManager.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/DataCollectionExtensionManager.cs
index 2d3485ecc0..2fa6b1f1c5 100644
--- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/DataCollectionExtensionManager.cs
+++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/DataCollectionExtensionManager.cs
@@ -111,6 +111,7 @@ public DataCollectorMetadata(string extension, string friendlyName)
///
///
/// The friendly Name.
+ ///
///
/// Indicates if the current data collector registers an attachment processor
///
diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestDiscoveryExtensionManager.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestDiscoveryExtensionManager.cs
index f64c566eea..885b279e55 100644
--- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestDiscoveryExtensionManager.cs
+++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestDiscoveryExtensionManager.cs
@@ -141,6 +141,8 @@ internal class TestDiscovererMetadata : ITestDiscovererCapabilities
///
/// The file Extensions.
/// The default Executor Uri.
+ /// Type of the assembly.
+ /// True when the discoverer is based on directories.
public TestDiscovererMetadata(IReadOnlyCollection? fileExtensions, string? defaultExecutorUri, AssemblyType assemblyType = default, bool isDirectoryBased = false)
{
if (fileExtensions != null && fileExtensions.Count > 0)
diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginCache.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginCache.cs
index 40ca9a1cf3..b7301292e3 100644
--- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginCache.cs
+++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginCache.cs
@@ -82,6 +82,7 @@ internal set
/// Gets a list of all extension paths filtered by input string.
///
/// Pattern to filter extension paths.
+ /// True when default extensions should be skipped.
public List GetExtensionPaths(string endsWithPattern, bool skipDefaultExtensions = false)
{
var extensions = GetFilteredExtensions(_filterableExtensionPaths, endsWithPattern);
@@ -115,7 +116,7 @@ public List GetExtensionPaths(string endsWithPattern, bool skipDefaultEx
/// Pattern used to select files using String.EndsWith
///
///
- /// The . of test plugin info.
+ /// The . of test plugin info.
///
public Dictionary? DiscoverTestExtensions(
string endsWithPattern)
@@ -306,7 +307,7 @@ internal IEnumerable DefaultExtensionPaths
/// Type of extension.
///
///
- /// The .
+ /// The .
///
internal Dictionary GetTestExtensions(
string extensionAssembly,
diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs
index 360d29bb92..5c0cdf8354 100644
--- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs
+++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs
@@ -117,6 +117,7 @@ private static void GetTestExtensionsFromFiles(
///
/// Assembly to check for test extension availability
/// Test extensions collection to add to.
+ /// File path of the assembly.
///
/// Type of Test Plugin Information.
///
@@ -201,6 +202,7 @@ private static void GetTestExtensionsFromAssembly(Assem
///
/// Test extensions collection to add to.
///
+ /// File path of the assembly.
private static void GetTestExtensionFromType(
Type type,
Type extensionType,
diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensions.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensions.cs
index e1f6c01ebc..5e5055af02 100644
--- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensions.cs
+++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensions.cs
@@ -176,7 +176,7 @@ internal static void AddExtensionTelemetry(
/// The info about new extensions discovered
///
///
- /// The of extensions discovered
+ /// The of extensions discovered
///
internal Dictionary? AddExtension(Dictionary? newExtensions)
where TPluginInfo : TestPluginInformation
@@ -415,7 +415,7 @@ internal void InvalidateCache()
///
///
///
- /// The . of extensions discovered in assembly
+ /// The . of extensions discovered in assembly
///
internal static Dictionary GetExtensionsDiscoveredFromAssembly(
Dictionary? extensionCollection,
diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/VSExtensionManager.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/VSExtensionManager.cs
index cec8312fe0..d4e5224d26 100644
--- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/VSExtensionManager.cs
+++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/VSExtensionManager.cs
@@ -85,7 +85,7 @@ private IEnumerable GetTestExtensionsInternal(string extensionType)
var resolutionPaths = installContext.GetVisualStudioCommonLocations(vsInstallPath);
using (var assemblyResolver = new AssemblyResolver(resolutionPaths))
{
- var settingsManager = SettingsManagerType.GetMethod("CreateForApplication", new Type[] { typeof(string) })?.Invoke(null, new object[] { installContext.GetVisualStudioPath(vsInstallPath) });
+ var settingsManager = SettingsManagerType.GetMethod("CreateForApplication", [typeof(string)])?.Invoke(null, [installContext.GetVisualStudioPath(vsInstallPath)]);
if (settingsManager == null)
{
EqtTrace.Warning("VSExtensionManager : Unable to create settings manager");
@@ -99,8 +99,8 @@ private IEnumerable GetTestExtensionsInternal(string extensionType)
if (extensionManager != null)
{
- installedExtensions = ExtensionManagerServiceType.GetMethod("GetEnabledExtensionContentLocations", new Type[] { typeof(string) })?.Invoke(
- extensionManager, new object[] { extensionType }) as IEnumerable;
+ installedExtensions = ExtensionManagerServiceType.GetMethod("GetEnabledExtensionContentLocations", [typeof(string)])?.Invoke(
+ extensionManager, [extensionType]) as IEnumerable;
}
else
{
diff --git a/src/Microsoft.TestPlatform.Common/Filtering/Condition.cs b/src/Microsoft.TestPlatform.Common/Filtering/Condition.cs
index c333120b49..6d112c3fd3 100644
--- a/src/Microsoft.TestPlatform.Common/Filtering/Condition.cs
+++ b/src/Microsoft.TestPlatform.Common/Filtering/Condition.cs
@@ -167,7 +167,7 @@ internal bool Evaluate(Func propertyValueProvider)
}
///
- /// Returns a condition object after parsing input string of format 'Operation'
+ /// Returns a condition object after parsing input string of format 'Operation'
///
internal static Condition Parse(string? conditionString)
{
diff --git a/src/Microsoft.TestPlatform.Common/Filtering/FilterExpression.cs b/src/Microsoft.TestPlatform.Common/Filtering/FilterExpression.cs
index 417d10fae4..249b1b5916 100644
--- a/src/Microsoft.TestPlatform.Common/Filtering/FilterExpression.cs
+++ b/src/Microsoft.TestPlatform.Common/Filtering/FilterExpression.cs
@@ -19,7 +19,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.Filtering;
///
/// Represents an expression tree.
/// Supports:
-/// Logical Operators: &, |
+/// Logical Operators: &, |
/// Equality Operators: =, !=
/// Parenthesis (, ) for grouping.
///
@@ -41,7 +41,7 @@ internal class FilterExpression
private readonly FilterExpression? _right;
///
- /// If logical expression is using logical And ('&') operator.
+ /// If logical expression is using logical And ('&') operator.
///
private readonly bool _areJoinedByAnd;
@@ -122,7 +122,7 @@ private static void ProcessOperator(Stack filterStack, Operato
if (null == properties)
{
// if null, initialize to empty list so that invalid properties can be found.
- properties = Enumerable.Empty();
+ properties = [];
}
return IterateFilterExpression((current, result) =>
@@ -132,7 +132,7 @@ private static void ProcessOperator(Stack filterStack, Operato
{
var valid = current._condition.ValidForProperties(properties, propertyProvider);
// If it's not valid will add it to the function's return array.
- return !valid ? new string[1] { current._condition.Name } : null;
+ return !valid ? [current._condition.Name] : null;
}
// Concatenate the children node's result to get their parent result.
diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/ITestEngine.cs b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/ITestEngine.cs
index eb40e4328c..d249244586 100644
--- a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/ITestEngine.cs
+++ b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/ITestEngine.cs
@@ -20,8 +20,9 @@ public interface ITestEngine
///
/// The request data for providing discovery services and data.
///
- /// Test host manager for the current test discovery.
/// The discovery criteria.
+ /// Details of every source.
+ /// Logger of warnings.
///
/// An IProxyDiscoveryManager object that can do discovery.
IProxyDiscoveryManager GetDiscoveryManager(
@@ -38,7 +39,8 @@ IProxyDiscoveryManager GetDiscoveryManager(
///
/// The request data for providing common execution services and data.
///
- /// Test host manager for the current test run.
+ /// Details of every source.
+ /// Logger of warnings.
/// Test run criteria of the current test run.
///
/// An IProxyExecutionManager object that can do execution.
@@ -59,6 +61,8 @@ IProxyExecutionManager GetExecutionManager(
///
/// Test session criteria of the current test session.
///
+ /// Details of every source.
+ /// Logger of warnings.
///
/// An IProxyTestSessionManager object that can manage test sessions.
IProxyTestSessionManager? GetTestSessionManager(
diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/IDataCollectorAttachmentsProcessorsFactory.cs b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/IDataCollectorAttachmentsProcessorsFactory.cs
index 250e3460a5..ef1b3f1228 100644
--- a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/IDataCollectorAttachmentsProcessorsFactory.cs
+++ b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/IDataCollectorAttachmentsProcessorsFactory.cs
@@ -17,7 +17,7 @@ internal interface IDataCollectorAttachmentsProcessorsFactory
///
/// Creates and return a list of available attachments processor
///
- /// List of invoked data collectors
+ /// List of invoked data collectors
/// Message logger
/// List of attachments processors
DataCollectorAttachmentProcessor[] Create(InvokedDataCollector[]? invokedDataCollectors, IMessageLogger logger);
diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ITestRunAttachmentsProcessingManager.cs b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ITestRunAttachmentsProcessingManager.cs
index b04cfc66e5..7bb7692c15 100644
--- a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ITestRunAttachmentsProcessingManager.cs
+++ b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ITestRunAttachmentsProcessingManager.cs
@@ -19,6 +19,7 @@ internal interface ITestRunAttachmentsProcessingManager
/// Processes attachments and provides results through handler
///
/// RunSettings
+ /// Data in the request.
/// Collection of attachments
/// Collection of invoked data collectors
/// EventHandler for handling test run attachments processing event
@@ -29,6 +30,7 @@ internal interface ITestRunAttachmentsProcessingManager
/// Processes attachments
///
/// RunSettings
+ /// Data in the request.
/// Collection of attachments
/// Collection of invoked data collectors
/// Cancellation token
diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IDiscoveryManager.cs b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IDiscoveryManager.cs
index c3c2ffdae2..73fc09bdac 100644
--- a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IDiscoveryManager.cs
+++ b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IDiscoveryManager.cs
@@ -16,6 +16,7 @@ public interface IDiscoveryManager
/// Initializes the discovery manager.
///
/// The path to additional extensions.
+ /// The discovery handler.
void Initialize(IEnumerable pathToAdditionalExtensions, ITestDiscoveryEventsHandler2? eventHandler);
///
diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IExecutionManager.cs b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IExecutionManager.cs
index 15ca486b19..37f67bab5a 100644
--- a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IExecutionManager.cs
+++ b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IExecutionManager.cs
@@ -17,6 +17,7 @@ public interface IExecutionManager
/// Initializes the execution manager.
///
/// The path to additional extensions.
+ /// Handler of test messages.
void Initialize(IEnumerable pathToAdditionalExtensions, ITestMessageEventHandler? testMessageEventsHandler);
///
@@ -48,12 +49,12 @@ public interface IExecutionManager
///
/// Cancel the test execution.
///
- /// EventHandler for handling execution events from Engine.
+ /// EventHandler for handling execution events from Engine.
void Cancel(IInternalTestRunEventsHandler testRunEventsHandler);
///
/// Aborts the test execution.
///
- /// EventHandler for handling execution events from Engine.
+ /// EventHandler for handling execution events from Engine.
void Abort(IInternalTestRunEventsHandler testRunEventsHandler);
}
diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/ITestDiscovererCapabilities.cs b/src/Microsoft.TestPlatform.Common/Interfaces/ITestDiscovererCapabilities.cs
index 0d755333da..4a867e366f 100644
--- a/src/Microsoft.TestPlatform.Common/Interfaces/ITestDiscovererCapabilities.cs
+++ b/src/Microsoft.TestPlatform.Common/Interfaces/ITestDiscovererCapabilities.cs
@@ -29,7 +29,7 @@ public interface ITestDiscovererCapabilities
AssemblyType AssemblyType { get; }
///
- /// if the discoverer plugin is decorated with ,
+ /// if the discoverer plugin is decorated with ObjectDirectoryBasedTestDiscovererAttribute/>,
/// otherwise.
///
bool IsDirectoryBased { get; }
diff --git a/src/Microsoft.TestPlatform.Common/RunSettings.cs b/src/Microsoft.TestPlatform.Common/RunSettings.cs
index 5568afa46d..42eadcd8a4 100644
--- a/src/Microsoft.TestPlatform.Common/RunSettings.cs
+++ b/src/Microsoft.TestPlatform.Common/RunSettings.cs
@@ -80,7 +80,7 @@ public void LoadSettingsXml(string settings)
}
using var stringReader = new StringReader(settings);
- var reader = XmlReader.Create(stringReader, XmlRunSettingsUtilities.ReaderSettings);
+ using var reader = XmlReader.Create(stringReader, XmlRunSettingsUtilities.ReaderSettings);
ValidateAndSaveSettings(reader);
}
@@ -91,7 +91,7 @@ public void LoadSettingsXml(string settings)
public void InitializeSettingsProviders(string settings)
{
using var stringReader = new StringReader(settings);
- var reader = XmlReader.Create(stringReader, XmlRunSettingsUtilities.ReaderSettings);
+ using var reader = XmlReader.Create(stringReader, XmlRunSettingsUtilities.ReaderSettings);
ReadRunSettings(reader);
}
diff --git a/src/Microsoft.TestPlatform.Common/Utilities/AssemblyResolver.cs b/src/Microsoft.TestPlatform.Common/Utilities/AssemblyResolver.cs
index 6181dcd5b4..6682231730 100644
--- a/src/Microsoft.TestPlatform.Common/Utilities/AssemblyResolver.cs
+++ b/src/Microsoft.TestPlatform.Common/Utilities/AssemblyResolver.cs
@@ -40,7 +40,7 @@ internal class AssemblyResolver : IDisposable
private readonly IAssemblyLoadContext _platformAssemblyLoadContext;
- private static readonly string[] SupportedFileExtensions = { ".dll", ".exe" };
+ private static readonly string[] SupportedFileExtensions = [".dll", ".exe"];
///
/// Initializes a new instance of the class.
diff --git a/src/Microsoft.TestPlatform.Common/Utilities/FakesUtilities.cs b/src/Microsoft.TestPlatform.Common/Utilities/FakesUtilities.cs
index c493b0c380..0193c4ebb4 100644
--- a/src/Microsoft.TestPlatform.Common/Utilities/FakesUtilities.cs
+++ b/src/Microsoft.TestPlatform.Common/Utilities/FakesUtilities.cs
@@ -90,6 +90,7 @@ public static string GenerateFakesSettingsForRunConfiguration(string[] sources,
///
/// runsettings
/// test sources
+ /// version of the framework
/// true if runSettings was modified; false otherwise.
private static bool TryAddFakesDataCollectorSettings(
XmlDocument runSettings,
@@ -231,7 +232,7 @@ private static void EnsureSettingsNode(XmlDocument settings, TestRunSettings set
{
var assembly = LoadTestPlatformAssembly();
var type = assembly?.GetType(ConfiguratorAssemblyQualifiedName, false);
- var method = type?.GetMethod(NetFrameworkConfiguratorMethodName, new Type[] { typeof(IEnumerable) });
+ var method = type?.GetMethod(NetFrameworkConfiguratorMethodName, [typeof(IEnumerable)]);
if (method != null)
{
return (Func, string>)method.CreateDelegate(typeof(Func, string>));
@@ -251,7 +252,7 @@ private static void EnsureSettingsNode(XmlDocument settings, TestRunSettings set
{
var assembly = LoadTestPlatformAssembly();
var type = assembly?.GetType(ConfiguratorAssemblyQualifiedName, false, false);
- var method = type?.GetMethod(CrossPlatformConfiguratorMethodName, new Type[] { typeof(IDictionary) });
+ var method = type?.GetMethod(CrossPlatformConfiguratorMethodName, [typeof(IDictionary)]);
if (method != null)
{
return (Func, DataCollectorSettings>)method.CreateDelegate(typeof(Func, DataCollectorSettings>));
diff --git a/src/Microsoft.TestPlatform.Common/Utilities/InstallationContext.cs b/src/Microsoft.TestPlatform.Common/Utilities/InstallationContext.cs
index 6c0c0bebaa..4783921204 100644
--- a/src/Microsoft.TestPlatform.Common/Utilities/InstallationContext.cs
+++ b/src/Microsoft.TestPlatform.Common/Utilities/InstallationContext.cs
@@ -48,13 +48,13 @@ public string GetVisualStudioPath(string visualStudioDirectory)
[SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Part of the public API")]
public string[] GetVisualStudioCommonLocations(string visualStudioDirectory)
{
- return new[]
- {
+ return
+ [
Path.Combine(visualStudioDirectory, PrivateAssembliesDirName),
Path.Combine(visualStudioDirectory, PublicAssembliesDirName),
Path.Combine(visualStudioDirectory, "CommonExtensions", "Microsoft", "TestWindow"),
Path.Combine(visualStudioDirectory, "CommonExtensions", "Microsoft", "TeamFoundation", "Team Explorer"),
visualStudioDirectory
- };
+ ];
}
}
diff --git a/src/Microsoft.TestPlatform.Common/Utilities/MetadataReaderHelper.cs b/src/Microsoft.TestPlatform.Common/Utilities/MetadataReaderHelper.cs
index e515ab5950..a8a6887df7 100644
--- a/src/Microsoft.TestPlatform.Common/Utilities/MetadataReaderHelper.cs
+++ b/src/Microsoft.TestPlatform.Common/Utilities/MetadataReaderHelper.cs
@@ -42,7 +42,7 @@ internal static class MetadataReaderExtensionsHelper
{
private const string TestExtensionTypesAttributeV2 = "Microsoft.VisualStudio.TestPlatform.TestExtensionTypesV2Attribute";
private static readonly ConcurrentDictionary AssemblyCache = new();
- private static readonly Type[] EmptyTypeArray = new Type[0];
+ private static readonly Type[] EmptyTypeArray = [];
public static Type[] DiscoverTestExtensionTypesV2Attribute(Assembly loadedAssembly, string assemblyFilePath)
=> AssemblyCache.GetOrAdd(assemblyFilePath, DiscoverTestExtensionTypesV2AttributeInternal(loadedAssembly, assemblyFilePath));
diff --git a/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsProviderExtensions.cs b/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsProviderExtensions.cs
index aa691c27d8..4e87b120cc 100644
--- a/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsProviderExtensions.cs
+++ b/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsProviderExtensions.cs
@@ -89,7 +89,7 @@ public static void UpdateRunSettingsNode(this IRunSettingsProvider runSettingsPr
///
/// Matches with test run parameter node pattern and returns that match.
///
- ///
+ ///
///
///
public static Match GetTestRunParameterNodeMatch(this IRunSettingsProvider _, string node)
diff --git a/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs b/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs
index a66a6ec57b..97376c5f05 100644
--- a/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs
+++ b/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs
@@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
-using System.Linq;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities;
@@ -170,18 +169,17 @@ private static bool GetTreatNoTestsAsError(RunConfiguration? runConfiguration)
/// Gets the test adapters path from the run configuration
///
/// Test run settings
- /// True to return null, if adapter paths is not set.
/// Test adapters paths
public static IEnumerable GetTestAdaptersPaths(string? runSettings)
{
var runConfiguration = XmlRunSettingsUtilities.GetRunConfigurationNode(runSettings);
- IEnumerable testAdaptersPaths = Enumerable.Empty();
+ IEnumerable testAdaptersPaths = [];
if (runConfiguration != null)
{
if (runConfiguration.TestAdaptersPathsSet)
{
- testAdaptersPaths = runConfiguration.TestAdaptersPaths.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
+ testAdaptersPaths = runConfiguration.TestAdaptersPaths.Split([';'], StringSplitOptions.RemoveEmptyEntries);
}
}
diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionTestCaseEventHandler.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionTestCaseEventHandler.cs
index e472ee3eba..483bf64db1 100644
--- a/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionTestCaseEventHandler.cs
+++ b/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionTestCaseEventHandler.cs
@@ -35,6 +35,7 @@ internal DataCollectionTestCaseEventHandler(IMessageSink messageSink)
///
/// Initializes a new instance of the class.
///
+ /// Sink for messages
/// Communication manager implementation.
/// Data collection manager implementation.
/// Serializer for serialization and deserialization of the messages.
diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/IDataCollectionTestCaseEventSender.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/IDataCollectionTestCaseEventSender.cs
index 6a0efce3ce..1e650f4c21 100644
--- a/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/IDataCollectionTestCaseEventSender.cs
+++ b/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/IDataCollectionTestCaseEventSender.cs
@@ -46,7 +46,7 @@ public interface IDataCollectionTestCaseEventSender
/// The args containing info about TestResult event.
///
///
- /// The Collection of TestCase attachments.
+ /// The Collection of TestCase attachments.
///
Collection? SendTestCaseEnd(TestCaseEndEventArgs e);
diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/ITestRequestHandler.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/ITestRequestHandler.cs
index ff2b72de40..f7f5ec0994 100644
--- a/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/ITestRequestHandler.cs
+++ b/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/ITestRequestHandler.cs
@@ -91,7 +91,7 @@ public interface ITestRequestHandler : IDisposable
///
/// Attach debugger to an already running process.
///
- /// Process ID of the process to which the debugger should be attached.
+ /// Process ID and tfm of the process to which the debugger should be attached.
/// if the debugger was successfully attached to the requested process, otherwise.
bool AttachDebuggerToProcess(AttachDebuggerInfo attachDebuggerInfo);
}
diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/Serialization/TestObjectConverter.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/Serialization/TestObjectConverter.cs
index f7fabcdbf7..fdc615a411 100644
--- a/src/Microsoft.TestPlatform.CommunicationUtilities/Serialization/TestObjectConverter.cs
+++ b/src/Microsoft.TestPlatform.CommunicationUtilities/Serialization/TestObjectConverter.cs
@@ -102,12 +102,12 @@ internal class TestObjectConverter7 : JsonConverter
{
// Empty is not present everywhere
#pragma warning disable CA1825 // Avoid zero-length array allocations
- private static readonly object[] EmptyObjectArray = new object[0];
+ private static readonly object[] EmptyObjectArray = [];
#pragma warning restore CA1825 // Avoid zero-length array allocations
public TestObjectConverter7()
{
- TestPropertyCtor = typeof(TestProperty).GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[0], null);
+ TestPropertyCtor = typeof(TestProperty).GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, [], null);
}
///
diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/TestRequestSender.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/TestRequestSender.cs
index ad0b614463..89f7369dbd 100644
--- a/src/Microsoft.TestPlatform.CommunicationUtilities/TestRequestSender.cs
+++ b/src/Microsoft.TestPlatform.CommunicationUtilities/TestRequestSender.cs
@@ -217,7 +217,7 @@ public bool WaitForRequestHandlerConnection(int connectionTimeout, CancellationT
// Wait until either connection is successful, handled by connected.WaitHandle
// or operation is canceled, handled by cancellationToken.WaitHandle
// or testhost exits unexpectedly, handled by clientExited.WaitHandle
- var waitIndex = WaitHandle.WaitAny(new WaitHandle[] { _connected.WaitHandle, cancellationToken.WaitHandle, _clientExited.WaitHandle }, connectionTimeout);
+ var waitIndex = WaitHandle.WaitAny([_connected.WaitHandle, cancellationToken.WaitHandle, _clientExited.WaitHandle], connectionTimeout);
EqtTrace.Verbose("TestRequestSender.WaitForRequestHandlerConnection: waiting took {0} ms, with timeout {1} ms, and result {2}, which is {3}.", sw.ElapsedMilliseconds, connectionTimeout, waitIndex, waitIndex == 0 ? "success" : "failure");
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/CommandLineArgumentsHelper.cs b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/CommandLineArgumentsHelper.cs
index 6d59b3b1e9..c7d703b878 100644
--- a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/CommandLineArgumentsHelper.cs
+++ b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/CommandLineArgumentsHelper.cs
@@ -61,6 +61,7 @@ public static int GetIntArgFromDict(IDictionary argsDictionary,
///
/// Dictionary of all arguments Ex: { "--port":"12312", "--parentprocessid":"2312" }
/// The full name for required argument. Ex: "--port"
+ /// The output value.
/// Value of the argument.
/// Thrown if value of an argument is not an integer.
public static bool TryGetIntArgFromDict(IDictionary argsDictionary, string fullname, out int value)
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/FileHelper.cs b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/FileHelper.cs
index 6b75f6b8a1..7179155386 100644
--- a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/FileHelper.cs
+++ b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/FileHelper.cs
@@ -50,7 +50,7 @@ public IEnumerable EnumerateFiles(
{
if (endsWithSearchPatterns == null || endsWithSearchPatterns.Length == 0)
{
- return Enumerable.Empty();
+ return [];
}
var files = Directory.EnumerateFiles(directory, "*", searchOption);
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/Interfaces/IFileHelper.cs b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/Interfaces/IFileHelper.cs
index 1d61a75296..fb26029518 100644
--- a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/Interfaces/IFileHelper.cs
+++ b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/Interfaces/IFileHelper.cs
@@ -132,6 +132,7 @@ public interface IFileHelper
///
/// The directory path.
///
+ /// If we should delete recursively.
void DeleteDirectory(string directoryPath, bool recursive);
///
@@ -152,7 +153,6 @@ public interface IFileHelper
///
/// Get temporary file path
///
- ///
public string GetTempPath();
///
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/AttachmentsProcessing/DataCollectorAttachmentProcessorAppDomain.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/AttachmentsProcessing/DataCollectorAttachmentProcessorAppDomain.cs
index 28ef57dbd8..744b346976 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/AttachmentsProcessing/DataCollectorAttachmentProcessorAppDomain.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/AttachmentsProcessing/DataCollectorAttachmentProcessorAppDomain.cs
@@ -63,7 +63,7 @@ public DataCollectorAttachmentProcessorAppDomain(InvokedDataCollector invokedDat
false,
BindingFlags.Default,
null,
- new[] { _pipeShutdownMessagePrefix },
+ [_pipeShutdownMessagePrefix],
null,
null);
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/InProcessProxyDiscoveryManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/InProcessProxyDiscoveryManager.cs
index a416e5a2f6..093664b8c7 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/InProcessProxyDiscoveryManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/InProcessProxyDiscoveryManager.cs
@@ -74,7 +74,7 @@ public void DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEve
var discoveryCompeleteEventsArg = new DiscoveryCompleteEventArgs(-1, true);
- eventHandler.HandleDiscoveryComplete(discoveryCompeleteEventsArg, Enumerable.Empty());
+ eventHandler.HandleDiscoveryComplete(discoveryCompeleteEventsArg, []);
}
});
}
@@ -103,7 +103,7 @@ public void Abort(ITestDiscoveryEventsHandler2 eventHandler)
private void InitializeExtensions(IEnumerable sources)
{
- var extensionsFromSource = _testHostManager.GetTestPlatformExtensions(sources, Enumerable.Empty());
+ var extensionsFromSource = _testHostManager.GetTestPlatformExtensions(sources, []);
if (extensionsFromSource.Any())
{
TestPluginCache.Instance.UpdateExtensions(extensionsFromSource, false);
@@ -111,7 +111,7 @@ private void InitializeExtensions(IEnumerable sources)
// We don't need to pass list of extension as we are running inside vstest.console and
// it will use TestPluginCache of vstest.console
- _discoveryManager.Initialize(Enumerable.Empty(), null);
+ _discoveryManager.Initialize([], null);
}
public void InitializeDiscovery(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler, bool skipDefaultAdapters)
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/InProcessProxyexecutionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/InProcessProxyexecutionManager.cs
index 27def5dde1..9ac60d0d1f 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/InProcessProxyexecutionManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/InProcessProxyexecutionManager.cs
@@ -28,7 +28,7 @@ internal class InProcessProxyExecutionManager : IProxyExecutionManager
public bool IsInitialized { get; private set; }
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
///
/// The test Host Manager.
@@ -135,7 +135,7 @@ public void Close()
private void InitializeExtensions(IEnumerable sources)
{
- var extensionsFromSource = _testHostManager.GetTestPlatformExtensions(sources, Enumerable.Empty());
+ var extensionsFromSource = _testHostManager.GetTestPlatformExtensions(sources, []);
if (extensionsFromSource.Any())
{
TestPluginCache.Instance.UpdateExtensions(extensionsFromSource, false);
@@ -143,7 +143,7 @@ private void InitializeExtensions(IEnumerable sources)
// We don't need to pass list of extension as we are running inside vstest.console and
// it will use TestPluginCache of vstest.console
- _executionManager.Initialize(Enumerable.Empty(), null);
+ _executionManager.Initialize([], null);
}
public void InitializeTestRun(TestRunCriteria testRunCriteria, IInternalTestRunEventsHandler eventHandler)
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs
index df2ef9133a..9003a84790 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs
@@ -312,7 +312,7 @@ private void ClearCompletedSlot(TManager completedManager)
private static string GetSourcesForSlotExpensive(ParallelOperationManager.Slot slot)
{
- return string.Join(", ", (slot.Work as DiscoveryCriteria)?.Sources ?? (slot.Work as TestRunCriteria)?.Sources ?? Array.Empty());
+ return string.Join(", ", (slot.Work as DiscoveryCriteria)?.Sources ?? (slot.Work as TestRunCriteria)?.Sources ?? []);
}
public void DoActionOnAllManagers(Action action, bool doActionsInParallel = false)
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs
index 7b871e4e91..417b619585 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs
@@ -222,7 +222,7 @@ private List> SplitToWorkloads(Disco
if (!_isParallel && testhostProviderInfo.Shared)
{
// Create one big source batch that will be single workload for single testhost.
- sourceBatches = new List { group.Select(w => w.Work).ToArray() };
+ sourceBatches = [group.Select(w => w.Work).ToArray()];
}
else
{
@@ -260,7 +260,9 @@ static DiscoveryCriteria NewDiscoveryCriteriaFromSourceAndSettings(IEnumerable
- /// Proxy discovery manager instance.
+ /// Proxy discovery manager instance.
+ /// Discovery events handler.
+ /// Discovery criteria a parameters.
private Task InitializeDiscoverTestsOnConcurrentManager(IProxyDiscoveryManager proxyDiscoveryManager, ITestDiscoveryEventsHandler2 eventHandler, DiscoveryCriteria discoveryCriteria)
{
// Kick off another discovery task for the next source
@@ -279,7 +281,11 @@ private Task InitializeDiscoverTestsOnConcurrentManager(IProxyDiscoveryManager p
/// Triggers the discovery for the next data object on the concurrent discoverer
/// Each concurrent discoverer calls this method, once its completed working on previous data
///
- /// Proxy discovery manager instance.
+ ///
+ ///
+ ///
+ ///
+ ///
private void DiscoverTestsOnConcurrentManager(
IProxyDiscoveryManager proxyDiscoveryManager,
ITestDiscoveryEventsHandler2 eventHandler,
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyExecutionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyExecutionManager.cs
index b586cfe934..c020d44d85 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyExecutionManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyExecutionManager.cs
@@ -261,7 +261,7 @@ private List> SplitToWorkloads(TestRun
if (!_isParallel && testhostProviderInfo.Shared)
{
// Create one big batch of testcases that will be single workload for single testhost.
- testCaseBatches = new List { group.SelectMany(w => sourceToTestCasesMap[w.Work]).ToArray() };
+ testCaseBatches = [group.SelectMany(w => sourceToTestCasesMap[w.Work]).ToArray()];
}
else
{
@@ -319,7 +319,7 @@ private List> SplitToWorkloads(TestRun
if (!_isParallel && testhostProviderInfo.Shared)
{
// Create one big source batch that will be single workload for single testhost.
- sourceBatches = new List { group.Select(w => w.Work).ToArray() };
+ sourceBatches = [group.Select(w => w.Work).ToArray()];
}
else
{
@@ -418,7 +418,6 @@ private Task PrepareTestRunOnConcurrentManager(IProxyExecutionManager proxyExecu
/// Triggers the execution for the next data object on the concurrent executor
/// Each concurrent executor calls this method, once its completed working on previous data
///
- /// Proxy execution manager instance.
/// True, if execution triggered
private void StartTestRunOnConcurrentManager(
IProxyExecutionManager proxyExecutionManager,
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs
index caa2643b24..a20d68a7c2 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs
@@ -95,6 +95,8 @@ public ProxyDiscoveryManager(
///
/// The request sender.
/// Test host manager instance.
+ /// Framework of the manager.
+ /// Aggregator of discovery data.
/// The data serializer.
/// The file helper.
internal ProxyDiscoveryManager(
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManager.cs
index 23cb164489..42442f0735 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManager.cs
@@ -100,6 +100,7 @@ public ProxyExecutionManager(
///
/// Test request sender instance.
/// Test host manager for this proxy.
+ /// Framework of testhost
public ProxyExecutionManager(
IRequestData requestData,
ITestRequestSender requestSender,
@@ -126,6 +127,7 @@ public ProxyExecutionManager(
/// The request data for common services and data for run.
/// Request sender instance.
/// Test host manager instance.
+ /// Framework of testhost
/// Data serializer instance.
/// File helper instance.
internal ProxyExecutionManager(
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManagerWithDataCollection.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManagerWithDataCollection.cs
index 31cfbc1c20..f6fcaa00b4 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManagerWithDataCollection.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManagerWithDataCollection.cs
@@ -33,6 +33,7 @@ internal class ProxyExecutionManagerWithDataCollection : ProxyExecutionManager
///
/// Test host manager for this operation.
///
+ /// Framework of the testhost.
///
/// The proxy Data Collection Manager.
///
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs
index 59a5f68a47..8c47267c76 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs
@@ -1,3 +1,4 @@
+
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
@@ -58,6 +59,7 @@ public class ProxyOperationManager
/// Request data instance.
/// Request sender instance.
/// Test host manager instance.
+ /// Testhost manager framework
public ProxyOperationManager(
IRequestData? requestData,
ITestRequestSender requestSender,
@@ -78,6 +80,7 @@ public ProxyOperationManager(
/// Request data instance.
/// Request sender instance.
/// Test host manager instance.
+ /// Testhost manager framework
/// The base proxy.
public ProxyOperationManager(
IRequestData? requestData,
@@ -395,6 +398,7 @@ public virtual TestProcessStartInfo UpdateTestProcessStartInfo(TestProcessStartI
///
///
/// Run settings string.
+ /// Message logger.
///
/// The run settings after removing non-required nodes.
public string? RemoveNodesFromRunsettingsIfRequired(string? runsettingsXml, Action logMessage)
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManagerWithDataCollection.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManagerWithDataCollection.cs
index 1eac8f3d94..3ff84390ed 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManagerWithDataCollection.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManagerWithDataCollection.cs
@@ -29,6 +29,7 @@ public class ProxyOperationManagerWithDataCollection : ProxyOperationManager
/// The request data.
/// The request sender.
/// The test host manager.
+ /// Framework of the testhost.
/// The data collection proxy.
public ProxyOperationManagerWithDataCollection(
IRequestData requestData,
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs
index 947c1bad04..232a31145e 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs
@@ -543,7 +543,7 @@ private bool InitializeLoggerByType(string assemblyQualifiedName, string codeBas
// Create logger instance
var constructorInfo = loggerType?.GetConstructor(Type.EmptyTypes);
- var logger = constructorInfo?.Invoke(new object[] { });
+ var logger = constructorInfo?.Invoke([]);
// Handle logger null scenario.
if (logger == null)
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DataCollectionTestRunEventsHandler.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DataCollectionTestRunEventsHandler.cs
index 11440b5b15..cc522a6f6b 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DataCollectionTestRunEventsHandler.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DataCollectionTestRunEventsHandler.cs
@@ -41,6 +41,7 @@ internal class DataCollectionTestRunEventsHandler : IInternalTestRunEventsHandle
///
/// The proxy Data Collection Manager.
///
+ /// Cancellation token
public DataCollectionTestRunEventsHandler(IInternalTestRunEventsHandler baseTestRunEventsHandler, IProxyDataCollectionManager proxyDataCollectionManager, CancellationToken cancellationToken)
: this(baseTestRunEventsHandler, proxyDataCollectionManager, JsonDataSerializer.Instance, cancellationToken)
{
@@ -58,6 +59,7 @@ public DataCollectionTestRunEventsHandler(IInternalTestRunEventsHandler baseTest
///
/// The data Serializer.
///
+ /// Cancellation token.
public DataCollectionTestRunEventsHandler(IInternalTestRunEventsHandler baseTestRunEventsHandler, IProxyDataCollectionManager proxyDataCollectionManager, IDataSerializer dataSerializer, CancellationToken cancellationToken)
{
_proxyDataCollectionManager = proxyDataCollectionManager;
@@ -196,7 +198,7 @@ public bool AttachDebuggerToProcess(AttachDebuggerInfo attachDebuggerInfo)
/// The run context attachments.
///
///
- /// The .
+ /// The .
///
[return: NotNullIfNotNull("originalAttachmentSets")]
[return: NotNullIfNotNull("newAttachments")]
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollectionExtensionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollectionExtensionManager.cs
index 89917eaa08..dcd5a59ca1 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollectionExtensionManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollectionExtensionManager.cs
@@ -50,6 +50,7 @@ internal class InProcDataCollectionExtensionManager
///
/// The default code base to be used by in-proc data collector
///
+ /// The cache of test plugins.
public InProcDataCollectionExtensionManager(string? runSettings, ITestEventsPublisher testEventsPublisher, string? defaultCodeBase, TestPluginCache testPluginCache)
: this(runSettings, testEventsPublisher, defaultCodeBase, testPluginCache, new FileHelper())
{ }
@@ -90,12 +91,6 @@ protected InProcDataCollectionExtensionManager(string? runSettings, ITestEventsP
///
/// Creates data collector instance based on datacollector settings provided.
///
- ///
- /// Settings to be used for creating DataCollector.
- ///
- ///
- /// TypeInfo of datacollector.
- ///
///
/// The .
///
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs
index f8cdcf9837..ee4dd85be0 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs
@@ -57,12 +57,13 @@ public InProcDataCollector(
///
///
///
- ///
+ ///
///
///
///
///
///
+ ///
internal InProcDataCollector(string codeBase, string assemblyQualifiedName, Type interfaceType, string? configXml, IAssemblyLoadContext assemblyLoadContext, TestPluginCache testPluginCache)
{
_configXml = configXml;
@@ -79,7 +80,7 @@ internal InProcDataCollector(string codeBase, string assemblyQualifiedName, Type
// Coverlet collector is consumed as nuget package we need to add assemblies directory to resolver to correctly load references.
TPDebug.Assert(Path.IsPathRooted(codeBase), "Absolute path expected");
- testPluginCache.AddResolverSearchDirectories(new string[] { Path.GetDirectoryName(codeBase)! });
+ testPluginCache.AddResolverSearchDirectories([Path.GetDirectoryName(codeBase)!]);
}
else
{
@@ -112,24 +113,24 @@ public void LoadDataCollector(IDataCollectionSink inProcDataCollectionSink)
/// Arguments for the method
public void TriggerInProcDataCollectionMethod(string methodName, InProcDataCollectionArgs methodArg)
{
- var methodInfo = GetMethodInfoFromType(_dataCollectorObject?.GetType(), methodName, new[] { methodArg.GetType() });
+ var methodInfo = GetMethodInfoFromType(_dataCollectorObject?.GetType(), methodName, [methodArg.GetType()]);
if (methodName.Equals(Constants.TestSessionStartMethodName))
{
var testSessionStartArgs = (TestSessionStartArgs)methodArg;
testSessionStartArgs.Configuration = _configXml!;
- methodInfo?.Invoke(_dataCollectorObject, new object[] { testSessionStartArgs });
+ methodInfo?.Invoke(_dataCollectorObject, [testSessionStartArgs]);
}
else
{
- methodInfo?.Invoke(_dataCollectorObject, new object[] { methodArg });
+ methodInfo?.Invoke(_dataCollectorObject, [methodArg]);
}
}
private static void InitializeDataCollector(object? obj, IDataCollectionSink inProcDataCollectionSink)
{
- var initializeMethodInfo = GetMethodInfoFromType(obj?.GetType(), "Initialize", new Type[] { typeof(IDataCollectionSink) });
- initializeMethodInfo?.Invoke(obj, new object[] { inProcDataCollectionSink });
+ var initializeMethodInfo = GetMethodInfoFromType(obj?.GetType(), "Initialize", [typeof(IDataCollectionSink)]);
+ initializeMethodInfo?.Invoke(obj, [inProcDataCollectionSink]);
}
private static MethodInfo? GetMethodInfoFromType(Type? type, string funcName, Type[] argumentTypes)
@@ -140,7 +141,7 @@ private static void InitializeDataCollector(object? obj, IDataCollectionSink inP
private static object? CreateObjectFromType(Type? type)
{
var constructorInfo = type?.GetConstructor(Type.EmptyTypes);
- object? obj = constructorInfo?.Invoke(new object[] { });
+ object? obj = constructorInfo?.Invoke([]);
return obj;
}
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyOutOfProcDataCollectionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyOutOfProcDataCollectionManager.cs
index 8ae2a30f3c..4596d38202 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyOutOfProcDataCollectionManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyOutOfProcDataCollectionManager.cs
@@ -32,8 +32,8 @@ internal class ProxyOutOfProcDataCollectionManager
///
/// The data collection test case event sender.
///
- ///
- /// The data collection test case event manager.
+ ///
+ /// Test events publisher.
///
public ProxyOutOfProcDataCollectionManager(IDataCollectionTestCaseEventSender dataCollectionTestCaseEventSender, ITestEventsPublisher testEventsPublisher)
{
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscovererEnumerator.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscovererEnumerator.cs
index 418d5a32d4..882e06fcbd 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscovererEnumerator.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscovererEnumerator.cs
@@ -45,6 +45,7 @@ internal class DiscovererEnumerator
///
/// The request data for providing discovery services and data.
/// The discovery result cache.
+ /// Cancellation token.
public DiscovererEnumerator(IRequestData requestData, DiscoveryResultCache discoveryResultCache, CancellationToken token)
: this(requestData, discoveryResultCache, TestPlatformEventSource.Instance, token)
{
@@ -346,6 +347,7 @@ private static void SetAdapterLoggingSettings(IMessageLogger messageLogger, IRun
/// The extension assembly.
/// The sources.
/// The logger instance.
+ /// Assembly properties
/// The map between an extension type and a source.
internal static Dictionary, IEnumerable>? GetDiscovererToSourcesMap(
string extensionAssembly,
@@ -448,7 +450,7 @@ private static void SetAdapterLoggingSettings(IMessageLogger messageLogger, IRun
/// Get assembly type to sources map.
///
/// Sources.
- /// Assembly type.
+ /// Assembly properties.
/// Sources with matching assembly type.
private static IDictionary> GetAssemblyTypeToSoucesMap(IEnumerable sources, IAssemblyProperties assemblyProperties)
{
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryManager.cs
index 7651367a15..d572894568 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryManager.cs
@@ -71,6 +71,7 @@ protected DiscoveryManager(IRequestData requestData, ITestPlatformEventSource te
/// Initializes the discovery manager.
///
/// The path to additional extensions.
+ /// Handler of discovery events.
public void Initialize(IEnumerable? pathToAdditionalExtensions, ITestDiscoveryEventsHandler2? eventHandler)
{
// Clear the request data metrics left over from a potential previous run.
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs
index 4600200c39..87c19a472e 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs
@@ -619,7 +619,7 @@ private void RaiseTestRunComplete(
UpdateTestCaseSourceToPackage(lastChunkTestResults, null, out lastChunkTestResults, out _);
}
- var testRunChangedEventArgs = new TestRunChangedEventArgs(runStats, lastChunkTestResults, Enumerable.Empty());
+ var testRunChangedEventArgs = new TestRunChangedEventArgs(runStats, lastChunkTestResults, []);
// Adding Metrics along with Test Run Complete Event Args
Collection? attachments = FrameworkHandle?.Attachments;
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/ExecutionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/ExecutionManager.cs
index a8a53fefa7..04c0065d76 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/ExecutionManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/ExecutionManager.cs
@@ -49,6 +49,7 @@ public ExecutionManager(IRequestData requestData)
/// Initializes a new instance of the class.
///
/// Test platform event source.
+ /// Request data
protected ExecutionManager(ITestPlatformEventSource testPlatformEventSource, IRequestData requestData)
{
_testPlatformEventSource = testPlatformEventSource;
@@ -61,6 +62,7 @@ protected ExecutionManager(ITestPlatformEventSource testPlatformEventSource, IRe
/// Initializes the execution manager.
///
/// The path to additional extensions.
+ /// Handler of test messages
public void Initialize(IEnumerable? pathToAdditionalExtensions, ITestMessageEventHandler? testMessageEventsHandler)
{
// Clear the request data metrics left over from a potential previous run.
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithSources.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithSources.cs
index 36c157c4c1..98fe1799f1 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithSources.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithSources.cs
@@ -48,7 +48,6 @@ public RunTestsWithSources(IRequestData requestData, Dictionary
///
///
- ///
internal RunTestsWithSources(IRequestData requestData, Dictionary> adapterSourceMap, string? package, string? runSettings, TestExecutionContext testExecutionContext, ITestCaseEventsHandler? testCaseEventsHandler, IInternalTestRunEventsHandler testRunEventsHandler, Dictionary, IEnumerable>? executorUriVsSourceList)
: base(requestData, package, runSettings, testExecutionContext, testCaseEventsHandler, testRunEventsHandler, TestPlatformEventSource.Instance)
{
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithTests.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithTests.cs
index 291e7a5671..17cf101666 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithTests.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithTests.cs
@@ -34,7 +34,7 @@ public RunTestsWithTests(IRequestData requestData, IEnumerable testCas
///
///
/// The user input test source(package) if it differ from actual test source otherwise null.
- ///
+ ///
///
///
///
@@ -131,7 +131,7 @@ private static Dictionary, List> GetExecutorVsTestC
}
else
{
- testList = new List { test };
+ testList = [test];
result.Add(executorUriExtensionTuple, testList);
}
}
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/PostProcessing/PostProcessingTestRunAttachmentsProcessingEventsHandler.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/PostProcessing/PostProcessingTestRunAttachmentsProcessingEventsHandler.cs
index 686a83d0d0..668f5d4cf4 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/PostProcessing/PostProcessingTestRunAttachmentsProcessingEventsHandler.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/PostProcessing/PostProcessingTestRunAttachmentsProcessingEventsHandler.cs
@@ -4,7 +4,6 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
-using System.Linq;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
@@ -50,7 +49,7 @@ public void HandleProcessedAttachmentsChunk(IEnumerable attachmen
public void HandleTestRunAttachmentsProcessingComplete(TestRunAttachmentsProcessingCompleteEventArgs attachmentsProcessingCompleteEventArgs, IEnumerable? lastChunk)
{
- foreach (var attachment in lastChunk ?? Enumerable.Empty())
+ foreach (var attachment in lastChunk ?? [])
{
_attachmentsSet.Add(attachment);
}
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/TestSession/ProxyTestSessionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/TestSession/ProxyTestSessionManager.cs
index 74e2e22db1..ccb312023b 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/TestSession/ProxyTestSessionManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/TestSession/ProxyTestSessionManager.cs
@@ -76,6 +76,7 @@ private enum TestSessionState
/// The test session criteria.
/// The testhost count.
/// The proxy creator.
+ /// Runtime providers.
public ProxyTestSessionManager(
StartTestSessionCriteria criteria,
int maxTesthostCount,
diff --git a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/BlameCollector.cs b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/BlameCollector.cs
index 1f3f483d29..b3bcbf9d99 100644
--- a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/BlameCollector.cs
+++ b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/BlameCollector.cs
@@ -91,6 +91,7 @@ public BlameCollector()
///
/// Filehelper instance.
///
+ /// Process helper instance.
internal BlameCollector(
IBlameReaderWriter blameReaderWriter,
IProcessDumpUtility processDumpUtility,
@@ -356,7 +357,7 @@ private void ValidateAndAddCrashProcessDumpParameters(XmlElement collectDumpNode
&& !string.Equals(attribute.Value, Constants.FalseConfigurationValue, StringComparison.OrdinalIgnoreCase))
|| !bool.TryParse(attribute.Value, out _collectDumpAlways))
{
- _logger.LogWarning(_context.SessionDataCollectionContext, FormatBlameParameterValueIncorrectMessage(attribute, new[] { Constants.TrueConfigurationValue, Constants.FalseConfigurationValue }));
+ _logger.LogWarning(_context.SessionDataCollectionContext, FormatBlameParameterValueIncorrectMessage(attribute, [Constants.TrueConfigurationValue, Constants.FalseConfigurationValue]));
}
break;
diff --git a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Interfaces/IProcessDumpUtility.cs b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Interfaces/IProcessDumpUtility.cs
index a5a559197d..121fc0ffee 100644
--- a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Interfaces/IProcessDumpUtility.cs
+++ b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Interfaces/IProcessDumpUtility.cs
@@ -36,6 +36,7 @@ public interface IProcessDumpUtility
///
/// Collect the dump on process exit even if there is no exception
///
+ /// Action to log a warning.
void StartTriggerBasedProcessDump(int processId, string testResultsDirectory, bool isFullDump, string targetFramework, bool collectAlways, Action logWarning);
///
diff --git a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/NetClientCrashDumper.cs b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/NetClientCrashDumper.cs
index 333a123a21..f705eadf19 100644
--- a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/NetClientCrashDumper.cs
+++ b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/NetClientCrashDumper.cs
@@ -35,7 +35,7 @@ public IEnumerable GetDumpFiles(bool _)
{
return _fileHelper.DirectoryExists(_outputDirectory)
? _fileHelper.GetFiles(_outputDirectory, "*_crashdump*.dmp", SearchOption.AllDirectories)
- : Array.Empty();
+ : [];
}
public void WaitForDumpToFinish()
diff --git a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcDumpDumper.cs b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcDumpDumper.cs
index a4130d6d2c..1c6e39a935 100644
--- a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcDumpDumper.cs
+++ b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcDumpDumper.cs
@@ -241,7 +241,7 @@ public IEnumerable GetDumpFiles(bool processCrashed)
{
var allDumps = _fileHelper.DirectoryExists(_outputDirectory)
? _fileHelper.GetFiles(_outputDirectory, "*_crashdump*.dmp", SearchOption.AllDirectories)
- : Array.Empty();
+ : [];
// We are always collecting dump on exit even when collectAlways option is false, to make sure we collect
// dump for Environment.FailFast. So there always can be a dump if the process already exited. In most cases
diff --git a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcessDumpUtility.cs b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcessDumpUtility.cs
index fc42574303..e5eb1be159 100644
--- a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcessDumpUtility.cs
+++ b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcessDumpUtility.cs
@@ -60,7 +60,7 @@ public IEnumerable GetDumpFiles(bool warnOnNoDumpFiles, bool processCras
IEnumerable hangDumps = _fileHelper.DirectoryExists(_hangDumpDirectory)
? _fileHelper.GetFiles(_hangDumpDirectory, "*_hangdump*.dmp", SearchOption.TopDirectoryOnly)
- : Array.Empty();
+ : [];
var foundDumps = new List();
foreach (var dumpPath in crashDumps.Concat(hangDumps))
diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestResult.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestResult.cs
index d2ca29bae7..07c66ea347 100644
--- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestResult.cs
+++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestResult.cs
@@ -212,12 +212,18 @@ internal class TestResult : ITestResult, IXmlTestStore
///
/// The run id.
///
- ///
- /// The test.
+ /// Execution id.
+ /// Parent execution id.
+ /// Result name.
+ ///
+ /// The test id.
///
///
/// The outcome.
///
+ ///
+ ///
+ ///
public TestResult(
Guid runId,
Guid testId,
diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/TrxLogger.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/TrxLogger.cs
index bcef64a85f..7809c0acd1 100644
--- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/TrxLogger.cs
+++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/TrxLogger.cs
@@ -342,11 +342,11 @@ internal void TestRunCompleteHandler(object? sender, TestRunCompleteEventArgs e)
helper.SaveIEnumerable(_entries.Values, rootElement, "TestEntries", ".", "TestEntry", parameters);
// Save default categories
- List categories = new()
- {
+ List categories =
+ [
TestListCategory.UncategorizedResults,
TestListCategory.AllResults
- };
+ ];
helper.SaveList(categories, rootElement, "TestLists", ".", "TestList", parameters);
// Save summary
@@ -357,7 +357,7 @@ internal void TestRunCompleteHandler(object? sender, TestRunCompleteEventArgs e)
TestResultOutcome = ChangeTestOutcomeIfNecessary(TestResultOutcome);
- List errorMessages = new();
+ List errorMessages = [];
List collectorEntries = _converter.ToCollectionEntries(e.AttachmentSets, LoggerTestRun, _testResultsDirPath);
IList resultFiles = _converter.ToResultFiles(e.AttachmentSets, LoggerTestRun, _testResultsDirPath, errorMessages);
@@ -591,7 +591,7 @@ private void CreateTestRun()
///
///
///
- ///
+ ///
/// Trx test element
private ITestElement GetOrCreateTestElement(Guid executionId, Guid parentExecutionId, TestType testType, ITestElement? parentTestElement, ObjectModel.TestResult rockSteadyTestResult)
{
diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/Converter.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/Converter.cs
index bddab2bb64..5967dbb202 100644
--- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/Converter.cs
+++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/Converter.cs
@@ -43,7 +43,7 @@ public Converter(IFileHelper fileHelper, TrxFileHelper trxFileHelper)
///
///
///
- ///
+ ///
///
///
/// Trx test element
@@ -278,10 +278,10 @@ public static List GetCustomPropertyValueFromTestCase(TestCase testCase,
if (customProperty != null)
{
var cateogryValues = (string[]?)testCase.GetPropertyValue(customProperty);
- return cateogryValues != null ? cateogryValues.ToList() : Enumerable.Empty().ToList();
+ return cateogryValues != null ? cateogryValues.ToList() : [];
}
- return Enumerable.Empty().ToList();
+ return [];
}
///
diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/TrxFileHelper.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/TrxFileHelper.cs
index 58b2f6df05..8104df9806 100644
--- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/TrxFileHelper.cs
+++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/TrxFileHelper.cs
@@ -183,7 +183,7 @@ public static string MakePathRelative(string path, string basePath)
path = Path.GetFullPath(path);
basePath = Path.GetFullPath(basePath);
- char[] delimiters = new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
+ char[] delimiters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
basePath = basePath.TrimEnd(delimiters);
path = path.TrimEnd(delimiters);
diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/XML/XmlPersistence.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/XML/XmlPersistence.cs
index 8808c57314..1bae61bb92 100644
--- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/XML/XmlPersistence.cs
+++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/XML/XmlPersistence.cs
@@ -706,7 +706,7 @@ private static string ReplaceInvalidCharacterWithUniCodeEscapeSequence(Match mat
}
else
{
- string[] parts = location.Split(new char[] { '/' }, 2);
+ string[] parts = location.Split(['/'], 2);
string firstPart = parts[0];
XmlNode? firstChild = LocationToXmlNode(xml, firstPart);
@@ -805,7 +805,7 @@ private string ProcessXPathQuery(string queryIn)
}
// fix the empty namespaces to a temp prefix, so xpath query can understand them
- string[] parts = queryIn.Split(new char[] { '/' }, StringSplitOptions.None);
+ string[] parts = queryIn.Split(['/'], StringSplitOptions.None);
StringBuilder query = new();
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestExecutor.cs b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestExecutor.cs
index 2b043cd81f..785a65ac16 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestExecutor.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestExecutor.cs
@@ -19,7 +19,7 @@ public interface ITestExecutor
///
/// Tests to be run.
/// Context to use when executing the tests.
- /// Handle to the framework to record results and to do framework operations.
+ /// Handle to the framework to record results and to do framework operations.
void RunTests(IEnumerable? tests, IRunContext? runContext, IFrameworkHandle? frameworkHandle);
///
@@ -27,7 +27,7 @@ public interface ITestExecutor
///
/// Path to test container files to look for tests in.
/// Context to use when executing the tests.
- /// Handle to the framework to record results and to do framework operations.
+ /// Handle to the framework to record results and to do framework operations.
void RunTests(IEnumerable? sources, IRunContext? runContext, IFrameworkHandle? frameworkHandle);
///
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Events/TestRunCompleteEventArgs.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Events/TestRunCompleteEventArgs.cs
index 8ae21a7809..58a6b412b2 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Client/Events/TestRunCompleteEventArgs.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Events/TestRunCompleteEventArgs.cs
@@ -58,7 +58,7 @@ public TestRunCompleteEventArgs(
/// Specifies whether the test run is aborted.
/// Specifies the error encountered during the execution of the test run.
/// Attachment sets associated with the run.
- /// Invoked data collectors
+ /// Invoked data collectors
/// Time elapsed in just running tests
public TestRunCompleteEventArgs(
ITestRunStatistics? stats,
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/FilterOptions.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/FilterOptions.cs
index 86c40e5b77..7c087014c9 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Client/FilterOptions.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Client/FilterOptions.cs
@@ -20,7 +20,7 @@ public class FilterOptions
public string? FilterRegEx { get; set; }
///
- /// Gets or sets the optional regular expression replacement string. When this property is set,
+ /// Gets or sets the optional regular expression replacement string. When this property is set,
/// will be called upon property value instead of before matching.
///
[DataMember]
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/IInternalTestRunEventsHandler.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/IInternalTestRunEventsHandler.cs
index b35e59c2cc..58023601b0 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/IInternalTestRunEventsHandler.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/IInternalTestRunEventsHandler.cs
@@ -39,7 +39,7 @@ public interface IInternalTestRunEventsHandler : ITestMessageEventHandler
///
/// Attach debugger to an already running process.
///
- /// Process ID of the process to which the debugger should be attached.
+ /// Process ID of the process and tfm to which the debugger should be attached.
/// if the debugger was successfully attached to the requested process, otherwise.
bool AttachDebuggerToProcess(AttachDebuggerInfo attachDebuggerInfo);
}
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestPlatform.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestPlatform.cs
index edebdbce74..789a84d3f3 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestPlatform.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestPlatform.cs
@@ -38,6 +38,8 @@ void UpdateExtensions(
/// Providing common services and data for discovery.
/// Specifies the discovery parameters.
/// Test platform options.
+ /// Details of each dll (source).
+ /// Logger to use for warnings.
///
/// A DiscoveryRequest object.
IDiscoveryRequest CreateDiscoveryRequest(
@@ -54,6 +56,8 @@ IDiscoveryRequest CreateDiscoveryRequest(
/// Providing common services and data for execution.
/// Specifies the test run criteria.
/// Test platform options.
+ /// Details of each dll (source).
+ /// Logger to use for warnings.
///
/// A RunRequest object.
ITestRunRequest CreateTestRunRequest(
@@ -72,6 +76,8 @@ ITestRunRequest CreateTestRunRequest(
///
/// Specifies the start test session criteria.
/// Events handler for handling session events.
+ /// Details of each dll (source).
+ /// Logger to use for warnings.
///
/// True if the operation succeeded, false otherwise.
bool StartTestSession(
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestRunAttachmentsProcessingEventsHandler.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestRunAttachmentsProcessingEventsHandler.cs
index c586949c2d..be41a6689c 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestRunAttachmentsProcessingEventsHandler.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestRunAttachmentsProcessingEventsHandler.cs
@@ -14,7 +14,7 @@ public interface ITestRunAttachmentsProcessingEventsHandler : ITestMessageEventH
/// Dispatch TestRunAttachmentsProcessingComplete event to listeners.
///
/// AttachmentsProcessing Complete event args.
- /// Last set of processed attachment sets.
+ /// Last set of processed attachment sets.
void HandleTestRunAttachmentsProcessingComplete(TestRunAttachmentsProcessingCompleteEventArgs attachmentsProcessingCompleteEventArgs, IEnumerable? lastChunk);
///
diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Common/RequestId.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Common/RequestId.cs
index 583f2882c8..0f882551bd 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Common/RequestId.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Common/RequestId.cs
@@ -133,7 +133,7 @@ public int CompareTo(object? obj)
RequestId? other = obj as RequestId;
return other == null
- ? throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.Resources.Common_ObjectMustBeOfType, new object[] { typeof(RequestId).Name }), nameof(obj))
+ ? throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.Resources.Common_ObjectMustBeOfType, [typeof(RequestId).Name]), nameof(obj))
: Id.CompareTo(other.Id);
}
diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionRunSettings.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionRunSettings.cs
index 42f179557a..ef4d693cac 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionRunSettings.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionRunSettings.cs
@@ -183,8 +183,9 @@ public static DataCollectionRunSettings CreateDataCollectionRunSettings(
///
/// The reader.
///
+ /// Name of the datacollector.
///
- /// The .
+ /// The .
///
///
///
diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectorSettings.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectorSettings.cs
index dbc436744d..bedb92e5ba 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectorSettings.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectorSettings.cs
@@ -137,7 +137,7 @@ public XmlElement ToXml(string dataCollectorName)
/// The reader.
///
///
- /// The .
+ /// The .
///
///
/// Settings exception
diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/SessionEvents.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/SessionEvents.cs
index bd5cd80fb5..773f3bd6b4 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/SessionEvents.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/SessionEvents.cs
@@ -49,6 +49,7 @@ public SessionStartEventArgs(IDictionary properties)
///
/// Context information for the session
///
+ /// Properties for the session.
public SessionStartEventArgs(DataCollectionContext context, IDictionary properties)
: base(context)
{
diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/TransferInformation/FileTransferInformation.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/TransferInformation/FileTransferInformation.cs
index 9f691969a4..45aed5c42c 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/TransferInformation/FileTransferInformation.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/TransferInformation/FileTransferInformation.cs
@@ -60,7 +60,7 @@ public FileTransferInformation(DataCollectionContext context, string path, bool
// Make sure the file exists.
if (!_fileHelper.Exists(path))
{
- throw new FileNotFoundException(string.Format(CultureInfo.CurrentCulture, Resources.Resources.Common_FileNotExist, new object[] { path }), path);
+ throw new FileNotFoundException(string.Format(CultureInfo.CurrentCulture, Resources.Resources.Common_FileNotExist, [path]), path);
}
// Make sure the path we have is a full path (not relative).
diff --git a/src/Microsoft.TestPlatform.ObjectModel/DefaultExecutorUriAttribute.cs b/src/Microsoft.TestPlatform.ObjectModel/DefaultExecutorUriAttribute.cs
index 754881f19a..2e7fd6c0cc 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/DefaultExecutorUriAttribute.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/DefaultExecutorUriAttribute.cs
@@ -14,7 +14,7 @@ public sealed class DefaultExecutorUriAttribute : Attribute
///
/// Initializes with the Uri of the executor.
///
- /// The Uri of the executor
+ /// The Uri of the executor
public DefaultExecutorUriAttribute(string executorUri)
{
ValidateArg.NotNullOrWhiteSpace(executorUri, nameof(executorUri));
diff --git a/src/Microsoft.TestPlatform.ObjectModel/DirectoryBasedTestDiscovererAttribute.cs b/src/Microsoft.TestPlatform.ObjectModel/DirectoryBasedTestDiscovererAttribute.cs
index 8ebfc8c0be..0114d5afe7 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/DirectoryBasedTestDiscovererAttribute.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/DirectoryBasedTestDiscovererAttribute.cs
@@ -6,7 +6,7 @@
namespace Microsoft.VisualStudio.TestPlatform.ObjectModel;
///
-/// This attribute is applied to s. It indicates the test discoverer discovers tests
+/// This attribute is applied to s. It indicates the test discoverer discovers tests
/// present inside a directory (as opposed to the which indicates that the
/// discoverer discovers tests present in files with a specified extension).
///
diff --git a/src/Microsoft.TestPlatform.ObjectModel/InvokedDataCollector.cs b/src/Microsoft.TestPlatform.ObjectModel/InvokedDataCollector.cs
index 89d8ef2b61..9422e8e491 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/InvokedDataCollector.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/InvokedDataCollector.cs
@@ -12,6 +12,7 @@ public sealed class InvokedDataCollector : IEquatable
/// Initialize an InvokedDataCollector
///
/// Data collector Uri
+ /// Friendly name of the datacollector.
/// Data collector assembly qualified name
/// Data collector file path
/// True if data collector registers an attachment processor
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Navigation/DiaSession.cs b/src/Microsoft.TestPlatform.ObjectModel/Navigation/DiaSession.cs
index d247c22514..1130173962 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Navigation/DiaSession.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Navigation/DiaSession.cs
@@ -20,7 +20,7 @@ public class DiaSession : INavigationSession
///
/// Characters that should be stripped off the end of test names.
///
- private static readonly char[] TestNameStripChars = { '(', ')', ' ' };
+ private static readonly char[] TestNameStripChars = ['(', ')', ' '];
///
/// The symbol reader.
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/DefaultFrameworkMappings.cs b/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/DefaultFrameworkMappings.cs
index b1492de902..cc943d021a 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/DefaultFrameworkMappings.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/DefaultFrameworkMappings.cs
@@ -11,7 +11,8 @@ internal sealed class DefaultFrameworkMappings : IFrameworkMappings
{
private static Lazy[]> IdentifierSynonymsLazy = new(() =>
{
- return new[]{
+ return
+ [
// .NET
new KeyValuePair("NETFramework", FrameworkConstants.FrameworkIdentifiers.Net),
new KeyValuePair(".NET", FrameworkConstants.FrameworkIdentifiers.Net),
@@ -31,8 +32,8 @@ internal sealed class DefaultFrameworkMappings : IFrameworkMappings
new KeyValuePair("XamarinPlayStationThree", FrameworkConstants.FrameworkIdentifiers.XamarinPlayStation3),
new KeyValuePair("Xamarin.PlayStationFour", FrameworkConstants.FrameworkIdentifiers.XamarinPlayStation4),
new KeyValuePair("XamarinPlayStationFour", FrameworkConstants.FrameworkIdentifiers.XamarinPlayStation4),
- new KeyValuePair("XamarinPlayStationVita", FrameworkConstants.FrameworkIdentifiers.XamarinPlayStationVita),
- };
+ new KeyValuePair("XamarinPlayStationVita", FrameworkConstants.FrameworkIdentifiers.XamarinPlayStationVita)
+ ];
});
public IEnumerable> IdentifierSynonyms
@@ -45,8 +46,8 @@ public IEnumerable> IdentifierSynonyms
private static readonly Lazy[]> IdentifierShortNamesLazy = new(() =>
{
- return new[]
- {
+ return
+ [
new KeyValuePair(FrameworkConstants.FrameworkIdentifiers.NetCoreApp, "netcoreapp"),
new KeyValuePair(FrameworkConstants.FrameworkIdentifiers.NetStandardApp, "netstandardapp"),
new KeyValuePair(FrameworkConstants.FrameworkIdentifiers.NetStandard, "netstandard"),
@@ -79,8 +80,8 @@ public IEnumerable> IdentifierSynonyms
new KeyValuePair(FrameworkConstants.FrameworkIdentifiers.WinRT, "winrt"), // legacy
new KeyValuePair(FrameworkConstants.FrameworkIdentifiers.UAP, "uap"),
new KeyValuePair(FrameworkConstants.FrameworkIdentifiers.Tizen, "tizen"),
- new KeyValuePair(FrameworkConstants.FrameworkIdentifiers.NanoFramework, "netnano"),
- };
+ new KeyValuePair(FrameworkConstants.FrameworkIdentifiers.NanoFramework, "netnano")
+ ];
});
public IEnumerable> IdentifierShortNames
@@ -93,14 +94,14 @@ public IEnumerable> IdentifierShortNames
private static readonly Lazy ProfileShortNamesLazy = new(() =>
{
- return new[]
- {
+ return
+ [
new FrameworkSpecificMapping(FrameworkConstants.FrameworkIdentifiers.Net, "Client", "Client"),
new FrameworkSpecificMapping(FrameworkConstants.FrameworkIdentifiers.Net, "CF", "CompactFramework"),
new FrameworkSpecificMapping(FrameworkConstants.FrameworkIdentifiers.Net, "Full", string.Empty),
new FrameworkSpecificMapping(FrameworkConstants.FrameworkIdentifiers.Silverlight, "WP", "WindowsPhone"),
- new FrameworkSpecificMapping(FrameworkConstants.FrameworkIdentifiers.Silverlight, "WP71", "WindowsPhone71"),
- };
+ new FrameworkSpecificMapping(FrameworkConstants.FrameworkIdentifiers.Silverlight, "WP71", "WindowsPhone71")
+ ];
});
public IEnumerable ProfileShortNames
@@ -113,8 +114,8 @@ public IEnumerable ProfileShortNames
private static readonly Lazy[]> EquivalentFrameworksLazy = new(() =>
{
- return new[]
- {
+ return
+ [
// UAP 0.0 <-> UAP 10.0
new KeyValuePair(
new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.UAP, FrameworkConstants.EmptyVersion),
@@ -219,8 +220,8 @@ public IEnumerable ProfileShortNames
// dnxcore50 <-> aspnetcore50
new KeyValuePair(
FrameworkConstants.CommonFrameworks.DnxCore50,
- FrameworkConstants.CommonFrameworks.AspNetCore50),
- };
+ FrameworkConstants.CommonFrameworks.AspNetCore50)
+ ];
});
public IEnumerable> EquivalentFrameworks
@@ -233,14 +234,14 @@ public IEnumerable> EquivalentFrame
private static readonly Lazy EquivalentProfilesLazy = new(() =>
{
- return new[]
- {
+ return
+ [
// The client profile, for the purposes of NuGet, is the same as the full framework
new FrameworkSpecificMapping(FrameworkConstants.FrameworkIdentifiers.Net, "Client", string.Empty),
new FrameworkSpecificMapping(FrameworkConstants.FrameworkIdentifiers.Net, "Full", string.Empty),
new FrameworkSpecificMapping(FrameworkConstants.FrameworkIdentifiers.Silverlight, "WindowsPhone71", "WindowsPhone"),
- new FrameworkSpecificMapping(FrameworkConstants.FrameworkIdentifiers.WindowsPhone, "WindowsPhone71", "WindowsPhone"),
- };
+ new FrameworkSpecificMapping(FrameworkConstants.FrameworkIdentifiers.WindowsPhone, "WindowsPhone71", "WindowsPhone")
+ ];
});
public IEnumerable EquivalentProfiles
@@ -253,8 +254,8 @@ public IEnumerable EquivalentProfiles
private static readonly Lazy[]> SubSetFrameworksLazy = new(() =>
{
- return new[]
- {
+ return
+ [
// .NET is a subset of DNX
new KeyValuePair(
FrameworkConstants.FrameworkIdentifiers.Net,
@@ -269,7 +270,7 @@ public IEnumerable EquivalentProfiles
new KeyValuePair(
FrameworkConstants.FrameworkIdentifiers.NetStandard,
FrameworkConstants.FrameworkIdentifiers.NetStandardApp)
- };
+ ];
});
public IEnumerable> SubSetFrameworks
@@ -553,13 +554,13 @@ private static IEnumerable CreateGenerationAndS
private static readonly Lazy NonPackageBasedFrameworkPrecedenceLazy = new(() =>
{
- return new[]
- {
+ return
+ [
FrameworkConstants.FrameworkIdentifiers.Net,
FrameworkConstants.FrameworkIdentifiers.NetCore,
FrameworkConstants.FrameworkIdentifiers.Windows,
FrameworkConstants.FrameworkIdentifiers.WindowsPhoneApp
- };
+ ];
});
public IEnumerable NonPackageBasedFrameworkPrecedence
@@ -572,13 +573,13 @@ public IEnumerable NonPackageBasedFrameworkPrecedence
private static readonly Lazy PackageBasedFrameworkPrecedenceLazy = new(() =>
{
- return new[]
- {
+ return
+ [
FrameworkConstants.FrameworkIdentifiers.NetCoreApp,
FrameworkConstants.FrameworkIdentifiers.NetStandardApp,
FrameworkConstants.FrameworkIdentifiers.NetStandard,
FrameworkConstants.FrameworkIdentifiers.NetPlatform
- };
+ ];
});
public IEnumerable PackageBasedFrameworkPrecedence
@@ -591,8 +592,8 @@ public IEnumerable PackageBasedFrameworkPrecedence
private static readonly Lazy EquivalentFrameworkPrecedenceLazy = new(() =>
{
- return new[]
- {
+ return
+ [
FrameworkConstants.FrameworkIdentifiers.Windows,
FrameworkConstants.FrameworkIdentifiers.NetCore,
FrameworkConstants.FrameworkIdentifiers.WinRT,
@@ -605,7 +606,7 @@ public IEnumerable PackageBasedFrameworkPrecedence
FrameworkConstants.FrameworkIdentifiers.Dnx,
FrameworkConstants.FrameworkIdentifiers.AspNet
- };
+ ];
});
public IEnumerable EquivalentFrameworkPrecedence
@@ -618,10 +619,10 @@ public IEnumerable EquivalentFrameworkPrecedence
private static readonly Lazy[]> ShortNameReplacementsLazy = new(() =>
{
- return new[]
- {
+ return
+ [
new KeyValuePair(FrameworkConstants.CommonFrameworks.DotNet50, FrameworkConstants.CommonFrameworks.DotNet)
- };
+ ];
});
public IEnumerable> ShortNameReplacements
@@ -634,10 +635,10 @@ public IEnumerable> ShortNameReplac
private static readonly Lazy[]> FullNameReplacementsLazy = new(() =>
{
- return new[]
- {
+ return
+ [
new KeyValuePair(FrameworkConstants.CommonFrameworks.DotNet, FrameworkConstants.CommonFrameworks.DotNet50)
- };
+ ];
});
public IEnumerable> FullNameReplacements
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/DefaultPortableFrameworkMappings.cs b/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/DefaultPortableFrameworkMappings.cs
index d36320d326..bcb22c4a3e 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/DefaultPortableFrameworkMappings.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/DefaultPortableFrameworkMappings.cs
@@ -32,8 +32,8 @@ internal class DefaultPortableFrameworkMappings : IPortableFrameworkMappings
var wpa81 = FrameworkConstants.CommonFrameworks.WPA81;
- return new[]
- {
+ return
+ [
// v4.6
CreateProfileFrameworks(31, win81, wp81),
CreateProfileFrameworks(32, win81, wpa81),
@@ -82,8 +82,8 @@ internal class DefaultPortableFrameworkMappings : IPortableFrameworkMappings
CreateProfileFrameworks(255, net45, sl5, win8, wpa81),
CreateProfileFrameworks(328, net4, sl5, win8, wpa81, wp8),
CreateProfileFrameworks(336, net403, sl5, win8, wpa81, wp8),
- CreateProfileFrameworks(344, net45, sl5, win8, wpa81, wp8),
- };
+ CreateProfileFrameworks(344, net45, sl5, win8, wpa81, wp8)
+ ];
});
public IEnumerable> ProfileFrameworks
@@ -101,9 +101,9 @@ private static KeyValuePair CreateProfileFrameworks(int p
// profiles that also support monotouch1+monoandroid1
private static readonly int[] ProfilesWithOptionalFrameworks =
- {
- 5, 6, 7, 14, 19, 24, 37, 42, 44, 47, 49, 78, 92, 102, 111, 136, 147, 151, 158, 225, 255, 259, 328, 336, 344
- };
+ [
+ 5, 6, 7, 14, 19, 24, 37, 42, 44, 47, 49, 78, 92, 102, 111, 136, 147, 151, 158, 225, 255, 259, 328, 336, 344
+ ];
private static readonly Lazy>> ProfileOptionalFrameworksLazy = new(() =>
{
@@ -135,8 +135,8 @@ public IEnumerable> ProfileOptionalFramework
private static readonly Lazy[]> CompatibilityMappingsLazy = new(() =>
{
- return new[]
- {
+ return
+ [
CreateStandardMapping(7, FrameworkConstants.CommonFrameworks.NetStandard11),
CreateStandardMapping(31, FrameworkConstants.CommonFrameworks.NetStandard10),
CreateStandardMapping(32, FrameworkConstants.CommonFrameworks.NetStandard12),
@@ -148,7 +148,7 @@ public IEnumerable> ProfileOptionalFramework
CreateStandardMapping(151, FrameworkConstants.CommonFrameworks.NetStandard12),
CreateStandardMapping(157, FrameworkConstants.CommonFrameworks.NetStandard10),
CreateStandardMapping(259, FrameworkConstants.CommonFrameworks.NetStandard10)
- };
+ ];
});
public IEnumerable> CompatibilityMappings
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/FrameworkNameProvider.cs b/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/FrameworkNameProvider.cs
index 4c810b6564..1a52d91003 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/FrameworkNameProvider.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/FrameworkNameProvider.cs
@@ -341,7 +341,7 @@ private HashSet RemoveDuplicateFramework(IEnumerable RemoveDuplicateFramework(IEnumerable
- /// Get all equivalent frameworks including the given framework
- ///
+ ///
+ /// Get all equivalent frameworks including the given framework
+ ///
private HashSet GetAllEquivalentFrameworks(NuGetFramework framework)
{
- // Loop through the frameworks, all frameworks that are not in results yet
- // will be added to toProcess to get the equivalent frameworks
+ // Loop through the frameworks, all frameworks that are not in results yet
+ // will be added to toProcess to get the equivalent frameworks
var toProcess = new Stack();
var results = new HashSet();
@@ -486,7 +486,7 @@ public bool TryGetPortableFrameworks(string shortPortableProfiles, [NotNullWhen(
throw new ArgumentNullException(nameof(shortPortableProfiles));
}
- var shortNames = shortPortableProfiles.Split(new char[] { '+' }, StringSplitOptions.RemoveEmptyEntries);
+ var shortNames = shortPortableProfiles.Split(['+'], StringSplitOptions.RemoveEmptyEntries);
var result = new List();
foreach (var name in shortNames)
@@ -545,7 +545,7 @@ public bool TryGetPortableFrameworks(string profile, bool includeOptional, [NotN
return true;
}
- frameworks = Enumerable.Empty();
+ frameworks = [];
return false;
}
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/FrameworkReducer.cs b/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/FrameworkReducer.cs
index 097ee2f7ac..9c2ab2fd57 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/FrameworkReducer.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/FrameworkReducer.cs
@@ -442,7 +442,7 @@ private IEnumerable ExplodePortableFramework(NuGetFramework pcl,
if (!_mappings.TryGetPortableFrameworks(pcl.Profile, includeOptional, out IEnumerable? frameworks))
{
Debug.Fail("Unable to get portable frameworks from: " + pcl.ToString());
- frameworks = Enumerable.Empty();
+ frameworks = [];
}
return frameworks;
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/NuGetFrameworkFactory.cs b/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/NuGetFrameworkFactory.cs
index 6d5329f20d..019fde8102 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/NuGetFrameworkFactory.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/NuGetFrameworkFactory.cs
@@ -136,7 +136,7 @@ internal static NuGetFramework ParseComponents(string targetFrameworkMoniker, st
return result;
}
- private static readonly char[] CommaSeparator = new char[] { ',' };
+ private static readonly char[] CommaSeparator = [','];
private static string[] GetParts(string targetPlatformMoniker)
{
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/NuGetFrameworkUtility.cs b/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/NuGetFrameworkUtility.cs
index b5367a43b5..b01fe1ab34 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/NuGetFrameworkUtility.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Nuget.Frameworks/NuGetFrameworkUtility.cs
@@ -27,6 +27,7 @@ internal static class NuGetFrameworkUtility
/// project target framework
/// retrieves the framework from the group
/// framework mappings
+ /// compatibility provider
public static T? GetNearest(IEnumerable items,
NuGetFramework framework,
IFrameworkNameProvider frameworkMappings,
@@ -66,6 +67,8 @@ internal static class NuGetFrameworkUtility
///
/// framework specific groups or items
/// project target framework
+ /// framework mappings
+ /// compatibility provider
public static T? GetNearest(IEnumerable items,
NuGetFramework framework,
IFrameworkNameProvider frameworkMappings,
diff --git a/src/Microsoft.TestPlatform.ObjectModel/RegistryFreeActivationContext.cs b/src/Microsoft.TestPlatform.ObjectModel/RegistryFreeActivationContext.cs
index 6ab0cd3b74..2558cb3d39 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/RegistryFreeActivationContext.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/RegistryFreeActivationContext.cs
@@ -113,6 +113,7 @@ private void DeactivateContext()
}
}
+///
/// ActivationContextNativeMethods class needed for registry-free context
///
internal static class ActivationContextNativeMethods
diff --git a/src/Microsoft.TestPlatform.ObjectModel/TestCase.cs b/src/Microsoft.TestPlatform.ObjectModel/TestCase.cs
index d949ede703..b9c260fb9f 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/TestCase.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/TestCase.cs
@@ -339,7 +339,7 @@ public static class TestCaseProperties
public static readonly TestProperty LineNumber = TestProperty.Register("TestCase.LineNumber", LineNumberLabel, typeof(int), TestPropertyAttributes.Hidden, typeof(TestCase));
internal static TestProperty[] Properties { get; } =
- {
+ [
CodeFilePath,
DisplayName,
ExecutorUri,
@@ -347,7 +347,7 @@ public static class TestCaseProperties
Id,
LineNumber,
Source
- };
+ ];
private static bool ValidateName(object? value)
{
diff --git a/src/Microsoft.TestPlatform.ObjectModel/TestProperty/CustomKeyValueConverter.cs b/src/Microsoft.TestPlatform.ObjectModel/TestProperty/CustomKeyValueConverter.cs
index b1baf611a5..75f4742a45 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/TestProperty/CustomKeyValueConverter.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/TestProperty/CustomKeyValueConverter.cs
@@ -45,7 +45,7 @@ public override bool CanConvertFrom(ITypeDescriptorContext? context, Type source
using var stream = new MemoryStream(Encoding.Unicode.GetBytes(data));
// Converting Json data to array of KeyValuePairs with duplicate keys.
var listOfTraitObjects = _serializer.ReadObject(stream) as TraitObject[];
- return listOfTraitObjects?.Select(trait => new KeyValuePair(trait.Key, trait.Value)).ToArray() ?? new KeyValuePair[0];
+ return listOfTraitObjects?.Select(trait => new KeyValuePair(trait.Key, trait.Value)).ToArray() ?? [];
}
return null;
diff --git a/src/Microsoft.TestPlatform.ObjectModel/TestResult.cs b/src/Microsoft.TestPlatform.ObjectModel/TestResult.cs
index 35838f1b31..7e9c33c528 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/TestResult.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/TestResult.cs
@@ -320,7 +320,7 @@ public static class TestResultProperties
public static readonly TestProperty ErrorStackTrace = TestProperty.Register("TestResult.ErrorStackTrace", Resources.Resources.TestResultPropertyErrorStackTraceLabel, typeof(string), typeof(TestResult));
#endif
internal static TestProperty[] Properties { get; } =
- {
+ [
ComputerName,
DisplayName,
Duration,
@@ -329,7 +329,7 @@ public static class TestResultProperties
ErrorStackTrace,
Outcome,
StartTime
- };
+ ];
private static bool ValidateOutcome(object? value)
{
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyLoadWorker.cs b/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyLoadWorker.cs
index 545e3bcfad..aefba93a27 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyLoadWorker.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyLoadWorker.cs
@@ -96,7 +96,7 @@ internal static string GetTargetFrameworkStringFromAssembly(Assembly assembly)
AssemblyName[] assemblies = a.GetReferencedAssemblies();
return assemblies == null || assemblies.Length == 0
- ? (new string[0])
+ ? ([])
: (from assembly in assemblies
select assembly.FullName).ToArray();
}
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Utilities/FilterHelper.cs b/src/Microsoft.TestPlatform.ObjectModel/Utilities/FilterHelper.cs
index 7056264d71..f2f6239863 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Utilities/FilterHelper.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Utilities/FilterHelper.cs
@@ -11,11 +11,11 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities;
public static class FilterHelper
{
public const char EscapeCharacter = '\\';
- private static readonly char[] SpecialCharacters = { '\\', '(', ')', '&', '|', '=', '!', '~' };
+ private static readonly char[] SpecialCharacters = ['\\', '(', ')', '&', '|', '=', '!', '~'];
private static readonly HashSet SpecialCharactersSet = new(SpecialCharacters);
///
- /// Escapes a set of special characters for filter (%, (, ), &, |, =, !, ~) by replacing them with their escape sequences.
+ /// Escapes a set of special characters for filter (%, (, ), &, |, =, !, ~) by replacing them with their escape sequences.
///
/// The input string that contains the text to convert.
/// A string of characters with special characters converted to their escaped form.
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Utilities/Sha1Helper.cs b/src/Microsoft.TestPlatform.ObjectModel/Utilities/Sha1Helper.cs
index f424fbba41..7b2a249fa3 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Utilities/Sha1Helper.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Utilities/Sha1Helper.cs
@@ -44,17 +44,17 @@ internal class Sha1Implementation
///
/// A sequence of logical functions to be used in SHA-1.
- /// Each f(t), 0 <= t <= 79, operates on three 32-bit words B, C, D and produces a 32-bit word as output.
+ /// Each f(t), 0 <= t <= 79, operates on three 32-bit words B, C, D and produces a 32-bit word as output.
///
- /// Function index. 0 <= t <= 79
+ /// Function index. 0 <= t <= 79
/// Word B
/// Word C
/// Word D
///
- /// f(t;B,C,D) = (B AND C) OR ((NOT B) AND D) ( 0 <= t <= 19)
- /// f(t;B,C,D) = B XOR C XOR D (20 <= t <= 39)
- /// f(t;B,C,D) = (B AND C) OR (B AND D) OR (C AND D) (40 <= t <= 59)
- /// f(t;B,C,D) = B XOR C XOR D (60 <= t <= 79)
+ /// f(t;B,C,D) = (B AND C) OR ((NOT B) AND D) ( 0 <= t <= 19)
+ /// f(t;B,C,D) = B XOR C XOR D (20 <= t <= 39)
+ /// f(t;B,C,D) = (B AND C) OR (B AND D) OR (C AND D) (40 <= t <= 59)
+ /// f(t;B,C,D) = B XOR C XOR D (60 <= t <= 79)
///
private static uint F(int t, uint b, uint c, uint d)
{
@@ -73,10 +73,10 @@ private static uint F(int t, uint b, uint c, uint d)
///
/// Word index.
///
- /// K(t) = 0x5A827999 ( 0 <= t <= 19)
- /// K(t) = 0x6ED9EBA1 (20 <= t <= 39)
- /// K(t) = 0x8F1BBCDC (40 <= t <= 59)
- /// K(t) = 0xCA62C1D6 (60 <= t <= 79)
+ /// K(t) = 0x5A827999 ( 0 <= t <= 19)
+ /// K(t) = 0x6ED9EBA1 (20 <= t <= 39)
+ /// K(t) = 0x8F1BBCDC (40 <= t <= 59)
+ /// K(t) = 0xCA62C1D6 (60 <= t <= 79)
///
private static uint K(int t)
{
@@ -95,8 +95,8 @@ private static uint K(int t)
/// The circular left shift operation.
///
/// An uint word.
- /// 0 <= n < 32
- /// S^n(X) = (X << n) OR (X >> 32-n)
+ /// 0 <= n < 32
+ /// S^n(X) = (X << n) OR (X >> 32-n)
private static uint S(uint x, byte n)
{
return n > 32 ? throw new ArgumentOutOfRangeException(nameof(n)) : (x << n) | (x >> (32 - n));
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlReaderUtilities.cs b/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlReaderUtilities.cs
index 833143fe88..02e723b398 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlReaderUtilities.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlReaderUtilities.cs
@@ -42,7 +42,6 @@ public static void SkipToNextElement(this XmlReader reader)
///
/// Reads to the root node of the run settings and verifies that it is a "RunSettings" node.
///
- /// Path to the file.
/// XmlReader for the file.
public static void ReadToRootNode(XmlReader reader)
{
diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/IProcessHelper.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/IProcessHelper.cs
index 6d468d0dd2..0824fd314c 100644
--- a/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/IProcessHelper.cs
+++ b/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/IProcessHelper.cs
@@ -17,10 +17,10 @@ public interface IProcessHelper
/// The full file name of the process.
/// The command-line arguments.
/// The working directory for this process.
- /// Environment variables to set while bootstrapping the process.
+ /// Environment variables to set while bootstrapping the process.
/// Call back for to read error stream data
/// Call back for on process exit
- /// Call back for on process output
+ /// Call back for on process output
/// The process created.
object LaunchProcess(string processPath, string? arguments, string? workingDirectory, IDictionary? envVariables, Action