diff --git a/.gitignore b/.gitignore
index ded1afeca3..9523d94f87 100644
--- a/.gitignore
+++ b/.gitignore
@@ -132,3 +132,8 @@ src/package/sign/sign.nuget.targets
# Vscode files
# ===========================
.vscode/
+
+# ===========================
+# diag log files
+# ===========================
+logs/
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index afcd052d01..5d90790b86 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -63,13 +63,25 @@ jobs:
testResultsFormat: VSTest
testResultsFiles: '**\*.trx'
condition: succeededOrFailed()
-
-- job: Linux
+
+- job:
+ workspace:
+ clean: all
+ strategy:
+ matrix:
+ Ubuntu_18_04:
+ vmImage: ubuntu-18.04
+ pwsh: true
+ macOS_10_15_Catalina:
+ vmImage: macOS-10.15
+ pwsh: true
pool:
- vmImage: 'ubuntu-18.04'
+ vmImage: $[ variables['vmImage'] ]
variables:
buildConfiguration: 'Release'
steps:
- script: ./build.sh -c $(buildConfiguration)
displayName: './build.sh -c $(buildConfiguration)'
+ - script: ./test.sh -c $(buildConfiguration)
+ displayName: './test.sh -c $(buildConfiguration)'
diff --git a/scripts/build.ps1 b/scripts/build.ps1
index 1133f769f8..bed8cb90d8 100644
--- a/scripts/build.ps1
+++ b/scripts/build.ps1
@@ -226,36 +226,6 @@ function Restore-Package
& $dotnetExe restore $env:TP_ROOT_DIR\src\package\external\external.csproj --packages $env:TP_PACKAGES_DIR -v:minimal -warnaserror -p:Version=$TPB_Version
Write-Log ".. .. Restore-Package: Complete."
- # Fixing a problem with procdump package
- # $procdumpFolder = "$env:TP_PACKAGES_DIR\procdump\0.0.1"
- # if (-not (Test-Path "$procdumpFolder\bin") -and -not $CIBuild)
- # {
- # Add-Type -AssemblyName System.IO.Compression.FileSystem
-
- # $zip = $null
- # try {
- # $zip = [System.IO.Compression.ZipFile]::Open("$procdumpFolder\procdump.0.0.1.nupkg", 0)
- # $zip.Entries | Where-Object { $_.FullName.StartsWith("bin/") } | ForEach-Object {
- # $file = "$procdumpFolder\$($_.FullName)"
- # $fi = [System.IO.Path]::GetDirectoryName($file)
- # if (-not (Test-Path $fi)) {
- # New-Item -Type Directory -Path $fi -Force
- # }
-
- # if (-not (Test-Path $file)) {
- # [System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $file, $true)
- # }
- # }
- # }
- # finally
- # {
- # if ($null -ne $zip)
- # {
- # $zip.Dispose()
- # }
- # }
- # }
-
Set-ScriptFailedOnError
Write-Log "Restore-Package: Complete. {$(Get-ElapsedTime($timer))}"
@@ -404,20 +374,26 @@ function Publish-Package
# Copy the .NET core x86 and x64 testhost exes from tempPublish to required folder
New-Item -ItemType directory -Path $testhostCore20PackageX64Dir -Force | Out-Null
- Copy-Item $testhostCore20PackageTempX64Dir\testhost* $testhostCore20PackageX64Dir -Force -recurse
+ Copy-Item $testhostCore20PackageTempX64Dir\testhost* $testhostCore20PackageX64Dir -Force -Recurse
+ Copy-Item $testhostCore20PackageTempX64Dir\Microsoft.TestPlatform.PlatformAbstractions.dll $testhostCore20PackageX64Dir -Force
+
New-Item -ItemType directory -Path $testhostCore20PackageX86Dir -Force | Out-Null
- Copy-Item $testhostCore20PackageTempX86Dir\testhost.x86* $testhostCore20PackageX86Dir -Force -recurse
+ Copy-Item $testhostCore20PackageTempX86Dir\testhost.x86* $testhostCore20PackageX86Dir -Force -Recurse
+ Copy-Item $testhostCore20PackageTempX86Dir\Microsoft.TestPlatform.PlatformAbstractions.dll $testhostCore20PackageX86Dir -Force
New-Item -ItemType directory -Path $testhostCore10PackageX64Dir -Force | Out-Null
- Copy-Item $testhostCore10PackageTempX64Dir\testhost* $testhostCore10PackageX64Dir -Force -recurse
+ Copy-Item $testhostCore10PackageTempX64Dir\testhost* $testhostCore10PackageX64Dir -Force -Recurse
+ Copy-Item $testhostCore20PackageTempX64Dir\Microsoft.TestPlatform.PlatformAbstractions.dll $testhostCore10PackageX64Dir -Force
+
New-Item -ItemType directory -Path $testhostCore10PackageX86Dir -Force | Out-Null
- Copy-Item $testhostCore10PackageTempX86Dir\testhost.x86* $testhostCore10PackageX86Dir -Force -recurse
+ Copy-Item $testhostCore10PackageTempX86Dir\testhost.x86* $testhostCore10PackageX86Dir -Force -Recurse
+ Copy-Item $testhostCore10PackageTempX86Dir\Microsoft.TestPlatform.PlatformAbstractions.dll $testhostCore10PackageX86Dir -Force
# Copy over the Full CLR built testhost package assemblies to the Core CLR and Full CLR package folder.
$coreCLRFull_Dir = "TestHost"
$fullDestDir = Join-Path $coreCLR20PackageDir $coreCLRFull_Dir
New-Item -ItemType directory -Path $fullDestDir -Force | Out-Null
- Copy-Item $testhostFullPackageDir\* $fullDestDir -Force -recurse
+ Copy-Item $testhostFullPackageDir\* $fullDestDir -Force -Recurse
Set-ScriptFailedOnError
@@ -425,7 +401,7 @@ function Publish-Package
Publish-PackageInternal $dataCollectorProject $TPB_TargetFramework472 $fullDestDir
New-Item -ItemType directory -Path $fullCLRPackage451Dir -Force | Out-Null
- Copy-Item $testhostFullPackageDir\* $fullCLRPackage451Dir -Force -recurse
+ Copy-Item $testhostFullPackageDir\* $fullCLRPackage451Dir -Force -Recurse
Set-ScriptFailedOnError
diff --git a/scripts/build/TestPlatform.Dependencies.props b/scripts/build/TestPlatform.Dependencies.props
index ed4fe3e21c..9fe91f412c 100644
--- a/scripts/build/TestPlatform.Dependencies.props
+++ b/scripts/build/TestPlatform.Dependencies.props
@@ -32,7 +32,7 @@
9.0.1
4.7.63
16.9.0-preview-4189539
- 16.9.0-beta.20552.5
+ 16.9.0-beta.20563.1
16.8.0-beta.20420.2
16.0.461
diff --git a/scripts/test.sh b/scripts/test.sh
index d4a7b3f0bf..7c0ded1dc3 100644
--- a/scripts/test.sh
+++ b/scripts/test.sh
@@ -48,7 +48,7 @@ done
#
# Variables
#
-PROJECT_NAME_PATTERNS=**Unit*bin*$CONFIGURATION*netcoreapp1.0*UnitTests*dll
+PROJECT_NAME_PATTERNS=**Unit*bin*$CONFIGURATION*netcoreapp2.1*UnitTests*dll
TP_ROOT_DIR=$(cd "$(dirname "$0")"; pwd -P)
TP_TOOLS_DIR="$TP_ROOT_DIR/tools"
TP_PACKAGES_DIR="$TP_ROOT_DIR/packages"
@@ -67,7 +67,7 @@ DOTNET_CLI_VERSION="latest"
# Build configuration
#
TPB_Solution="TestPlatform.sln"
-TPB_TargetFrameworkCore="netcoreapp2.0"
+TPB_TargetFrameworkCore="netcoreapp2.1"
TPB_Configuration=$CONFIGURATION
TPB_TargetRuntime=$TARGET_RUNTIME
TPB_Verbose=$VERBOSE
@@ -111,7 +111,7 @@ function invoke_test()
local dotnet=$(_get_dotnet_path)
local vstest=$TP_OUT_DIR/$TPB_Configuration/$TPB_TargetFrameworkCore/vstest.console.dll
- find ./test -path $PROJECT_NAME_PATTERNS | xargs --verbose $dotnet $vstest --parallel
+ find ./test -path $PROJECT_NAME_PATTERNS | xargs $dotnet $vstest --parallel --testcasefilter:"TestCategory!=Windows"
}
#
@@ -119,7 +119,7 @@ function invoke_test()
#
_get_dotnet_path()
{
- echo "$TP_TOOLS_DIR/dotnet/dotnet"
+ echo "$TP_TOOLS_DIR/dotnet-linux/dotnet"
}
invoke_test
diff --git a/scripts/verify-nupkgs.ps1 b/scripts/verify-nupkgs.ps1
index 196c02546f..55402d48a8 100644
--- a/scripts/verify-nupkgs.ps1
+++ b/scripts/verify-nupkgs.ps1
@@ -12,7 +12,7 @@ function Verify-Nuget-Packages($packageDirectory)
{
Write-Log "Starting Verify-Nuget-Packages."
$expectedNumOfFiles = @{
- "Microsoft.CodeCoverage" = 43;
+ "Microsoft.CodeCoverage" = 44;
"Microsoft.NET.Test.Sdk" = 18;
"Microsoft.TestPlatform" = 488;
"Microsoft.TestPlatform.Build" = 19;
@@ -20,7 +20,7 @@ function Verify-Nuget-Packages($packageDirectory)
"Microsoft.TestPlatform.Extensions.TrxLogger" = 33;
"Microsoft.TestPlatform.ObjectModel" = 178;
"Microsoft.TestPlatform.Portable" = 566;
- "Microsoft.TestPlatform.TestHost" = 213;
+ "Microsoft.TestPlatform.TestHost" = 212;
"Microsoft.TestPlatform.TranslationLayer" = 121}
$nugetPackages = Get-ChildItem -Filter "*.nupkg" $packageDirectory | % { $_.FullName}
diff --git a/scripts/verify-sign.ps1 b/scripts/verify-sign.ps1
index 3d351e9037..6a3673da07 100644
--- a/scripts/verify-sign.ps1
+++ b/scripts/verify-sign.ps1
@@ -70,6 +70,10 @@ function Verify-Assemblies
elseif ($signature.SignerCertificate.Thumbprint -eq "899FA016DEE8E665FF2A315A1151C43FB96C430B") {
Write-Log "Valid (Prod Signed): $($_.FullName)."
}
+ # Microsoft 3rd Party Application Component
+ elseif ($signature.SignerCertificate.Thumbprint -eq "709133ECC53CBF386F4A5ECB782AEEF499F0F8CA") {
+ Write-Log "Valid (Prod Signed): $($_.FullName)."
+ }
else {
Write-FailLog "Incorrect certificate. File: $($_.FullName). Certificate: $($signature.SignerCertificate.Thumbprint)."
}
diff --git a/src/DataCollectors/TraceDataCollector/VanguardCollector/DynamicCoverageDataCollector.cs b/src/DataCollectors/TraceDataCollector/VanguardCollector/DynamicCoverageDataCollector.cs
index e5e4e94cb0..6f499016c4 100644
--- a/src/DataCollectors/TraceDataCollector/VanguardCollector/DynamicCoverageDataCollector.cs
+++ b/src/DataCollectors/TraceDataCollector/VanguardCollector/DynamicCoverageDataCollector.cs
@@ -51,9 +51,13 @@ public class DynamicCoverageDataCollector : BaseDataCollector
private const string ClrIeDisableCodeSignatureValidationVariable = @"MicrosoftInstrumentationEngine_DisableCodeSignatureValidation";
private const string ClrieFileLogPathVariable = @"MicrosoftInstrumentationEngine_FileLogPath";
+ private const string InjectDotnetAdditionalDepsSettingName = "InjectDotnetAdditionalDeps";
+ private const string VanguardDotnetAdditionalDepsVariable = "VANGUARD_DOTNET_ADDITIONAL_DEPS";
+
private readonly IEnvironment environment;
private bool useClrIeInstrumentationForNetCore;
private bool useClrIeInstrumentationForNetFramework;
+ private bool injectDotnetAdditionalDeps;
///
/// Data collector implementation
@@ -116,6 +120,7 @@ protected override void OnInitialize(XmlElement configurationElement)
{
this.useClrIeInstrumentationForNetCore = IsClrInstrumentationEnabled(configurationElement, ClrIeInstrumentationForNetCoreSettingName, ClrIeInstrumentationForNetCoreVariable);
this.useClrIeInstrumentationForNetFramework = IsClrInstrumentationEnabled(configurationElement, ClrIeInstrumentationForNetFrameworkSettingName, ClrIeInstrumentationForNetFrameworkVariable);
+ this.injectDotnetAdditionalDeps = GetConfigurationValue(configurationElement, InjectDotnetAdditionalDepsSettingName) ?? true;
this.implementation.Initialize(configurationElement, this.DataSink, this.Logger);
this.Events.SessionStart += this.SessionStart;
@@ -177,6 +182,11 @@ protected override IEnumerable> GetEnvironmentVaria
envVaribles.Add(new KeyValuePair(ClrieFileLogPathVariable, Path.Combine(Path.GetTempPath(), this.implementation.GetSessionName(), Guid.NewGuid() + ".log")));
}
+ if (this.injectDotnetAdditionalDeps && !string.IsNullOrEmpty(this.implementation.CodeCoverageDepsJsonFilePath))
+ {
+ envVaribles.Add(new KeyValuePair(VanguardDotnetAdditionalDepsVariable, this.implementation.CodeCoverageDepsJsonFilePath));
+ }
+
if (EqtTrace.IsInfoEnabled)
{
EqtTrace.Info("DynamicCoverageDataCollector.GetEnvironmentVariables: Returning following environment variables: {0}", string.Join(",", envVaribles));
@@ -194,10 +204,9 @@ protected override IEnumerable> GetEnvironmentVaria
/// If CLR IE should be enabled
private static bool IsClrInstrumentationEnabled(XmlElement configurationElement, string configurationSettingName, string environmentVariableName)
{
- XmlElement configurationSetting = configurationElement != null ? configurationElement[configurationSettingName] : null;
- string configurationSettingValue = configurationSetting != null ? configurationSetting.InnerText : null;
+ var clrInstrumentationEnabledByConfiguration = GetConfigurationValue(configurationElement, configurationSettingName);
- if (bool.TryParse(configurationSettingValue, out var clrInstrumentationEnabled) && clrInstrumentationEnabled)
+ if (clrInstrumentationEnabledByConfiguration == true)
{
return true;
}
@@ -211,6 +220,22 @@ private static bool IsClrInstrumentationEnabled(XmlElement configurationElement,
return int.TryParse(environmentVariableValue, out var environmentVariableIntValue) && environmentVariableIntValue > 0;
}
+ ///
+ /// Check flag in configuration
+ ///
+ /// Configuration
+ /// Configuration setting name
+ /// Flag value in configuration. Null if not present.
+ private static bool? GetConfigurationValue(XmlElement configurationElement, string configurationSettingName)
+ {
+ if (bool.TryParse(configurationElement?[configurationSettingName]?.InnerText, out var settingValue))
+ {
+ return settingValue;
+ }
+
+ return null;
+ }
+
///
/// On session end
///
diff --git a/src/DataCollectors/TraceDataCollector/VanguardCollector/DynamicCoverageDataCollectorImpl.cs b/src/DataCollectors/TraceDataCollector/VanguardCollector/DynamicCoverageDataCollectorImpl.cs
index 6d0e0b56ee..5803d0a954 100644
--- a/src/DataCollectors/TraceDataCollector/VanguardCollector/DynamicCoverageDataCollectorImpl.cs
+++ b/src/DataCollectors/TraceDataCollector/VanguardCollector/DynamicCoverageDataCollectorImpl.cs
@@ -33,35 +33,70 @@ internal class DynamicCoverageDataCollectorImpl : IDynamicCoverageDataCollectorI
///
private const string VanguardConfigFileName = "CodeCoverage.config";
+ ///
+ /// File name of deps.json file with reference to Microsoft.VisualStudio.CodeCoverage.Shim.dll.
+ ///
+ private const string CodeCoverageDepsJsonFileName = "CodeCoverage.deps.json";
+
///
/// Name of element for custom coverage filename.
///
private const string CoverageFileSettingName = "CoverageFileName";
+ private const string CodeCoverageDepsJsonTemplate = @"
+{{
+ ""runtimeTarget"": {{
+ ""name"": ""codecoverage"",
+ ""signature"": """"
+ }},
+ ""targets"": {{
+ ""codecoverage"": {{
+ ""Microsoft.VisualStudio.CodeCoverage.Shim/15.0.0.0"": {{
+ ""runtime"": {{
+ ""{0}"": {{ }}
+ }}
+ }}
+ }}
+ }},
+ ""libraries"": {{
+ ""Microsoft.VisualStudio.CodeCoverage.Shim/15.0.0.0"": {{
+ ""type"": ""reference"",
+ ""serviceable"": false,
+ ""sha512"": """"
+ }}
+ }}
+}}
+";
+
///
- /// Coverage file name
+ /// Directory helper
///
- private string coverageFileName;
+ private readonly IDirectoryHelper directoryHelper;
///
- /// Logger
+ /// Profilers location provider
///
- private IDataCollectionLogger logger;
+ private readonly IProfilersLocationProvider profilersLocationProvider;
///
- /// Data sink
+ /// File helper
///
- private TraceCollector.IDataCollectionSink dataSink;
+ private readonly IFileHelper fileHelper;
///
- /// Directory helper
+ /// Coverage file name
///
- private IDirectoryHelper directoryHelper;
+ private string coverageFileName;
///
- /// File helper
+ /// Logger
+ ///
+ private IDataCollectionLogger logger;
+
+ ///
+ /// Data sink
///
- private IFileHelper fileHelper;
+ private TraceCollector.IDataCollectionSink dataSink;
///
/// Folder to store temporary files
@@ -71,17 +106,23 @@ internal class DynamicCoverageDataCollectorImpl : IDynamicCoverageDataCollectorI
private string coverageFilePath;
public DynamicCoverageDataCollectorImpl()
- : this(new Vanguard(), new DirectoryHelper(), new FileHelper())
+ : this(new Vanguard(), new DirectoryHelper(), new FileHelper(), new ProfilersLocationProvider())
{
}
- internal DynamicCoverageDataCollectorImpl(IVanguard vanguard, IDirectoryHelper directoryHelper, IFileHelper fileHelper)
+ internal DynamicCoverageDataCollectorImpl(IVanguard vanguard, IDirectoryHelper directoryHelper, IFileHelper fileHelper, IProfilersLocationProvider profilersLocationProvider)
{
this.Vanguard = vanguard;
this.directoryHelper = directoryHelper;
this.fileHelper = fileHelper;
+ this.profilersLocationProvider = profilersLocationProvider;
}
+ ///
+ /// Gets path to deps.json file with reference to Microsoft.VisualStudio.CodeCoverage.Shim.dll.
+ ///
+ public string CodeCoverageDepsJsonFilePath { get; private set; }
+
///
/// Gets or sets session name
///
@@ -295,9 +336,12 @@ private void PrepareVanguardProcess(XmlElement configurationElement)
?? DynamicCoverageDataCollectorImpl.GetDefaultConfiguration()[ConfigCodeCoverageElementName];
string configurationFileName = Path.Combine(this.sessionDirectory, VanguardConfigFileName);
-
this.fileHelper.WriteAllText(configurationFileName, config.OuterXml);
+ this.CodeCoverageDepsJsonFilePath = Path.Combine(this.sessionDirectory, CodeCoverageDepsJsonFileName);
+ var codeCoverageDepsJsonContent = this.profilersLocationProvider.GetCodeCoverageShimPath()?.Replace(@"\", "/");
+ this.fileHelper.WriteAllText(this.CodeCoverageDepsJsonFilePath, string.Format(CodeCoverageDepsJsonTemplate, codeCoverageDepsJsonContent));
+
EqtTrace.Info("DynamicCoverageDataCollectorImpl.PrepareVanguardProcess: Initializing with config: {0}.", config.OuterXml);
this.Vanguard.Initialize(this.SessionName, configurationFileName, this.logger);
}
diff --git a/src/DataCollectors/TraceDataCollector/VanguardCollector/Interfaces/IDynamicCoverageDataCollectorImpl.cs b/src/DataCollectors/TraceDataCollector/VanguardCollector/Interfaces/IDynamicCoverageDataCollectorImpl.cs
index ef5f53ff70..c87ff56b2a 100644
--- a/src/DataCollectors/TraceDataCollector/VanguardCollector/Interfaces/IDynamicCoverageDataCollectorImpl.cs
+++ b/src/DataCollectors/TraceDataCollector/VanguardCollector/Interfaces/IDynamicCoverageDataCollectorImpl.cs
@@ -14,6 +14,8 @@ namespace Microsoft.VisualStudio.Coverage.Interfaces
///
internal interface IDynamicCoverageDataCollectorImpl : IDisposable
{
+ string CodeCoverageDepsJsonFilePath { get; }
+
string GetSessionName();
void Initialize(
diff --git a/src/DataCollectors/TraceDataCollector/VanguardCollector/Interfaces/IProfilersLocationProvider.cs b/src/DataCollectors/TraceDataCollector/VanguardCollector/Interfaces/IProfilersLocationProvider.cs
index e86d933236..6ca0fb672f 100644
--- a/src/DataCollectors/TraceDataCollector/VanguardCollector/Interfaces/IProfilersLocationProvider.cs
+++ b/src/DataCollectors/TraceDataCollector/VanguardCollector/Interfaces/IProfilersLocationProvider.cs
@@ -49,5 +49,11 @@ internal interface IProfilersLocationProvider
///
/// x64 CLR IE Path
string GetClrInstrumentationEngineX64Path();
+
+ ///
+ /// Get path to Microsoft.VisualStudio.CodeCoverage.Shim library
+ ///
+ /// Path to Microsoft.VisualStudio.CodeCoverage.Shim library
+ string GetCodeCoverageShimPath();
}
}
\ No newline at end of file
diff --git a/src/DataCollectors/TraceDataCollector/VanguardCollector/ProfilersLocationProvider.cs b/src/DataCollectors/TraceDataCollector/VanguardCollector/ProfilersLocationProvider.cs
index 636e8f330e..ce6230879a 100644
--- a/src/DataCollectors/TraceDataCollector/VanguardCollector/ProfilersLocationProvider.cs
+++ b/src/DataCollectors/TraceDataCollector/VanguardCollector/ProfilersLocationProvider.cs
@@ -22,6 +22,7 @@ internal class ProfilersLocationProvider : IProfilersLocationProvider
private const string VanguardX64ProfilerPath = @"amd64\covrun64.dll";
private const string VanguardX86ProfilerConfigPath = @"VanguardInstrumentationProfiler_x86.config";
private const string VanguardX64ProfilerConfigPath = @"amd64\VanguardInstrumentationProfiler_x64.config";
+ private const string VanguardShimPath = @"coreclr\Microsoft.VisualStudio.CodeCoverage.Shim.dll";
///
/// Vanguard executable name
@@ -76,6 +77,12 @@ public string GetClrInstrumentationEngineX64Path()
return this.GetClrInstrumentationEnginePath("x64", ClrIeX64FileName, ClrIeX64InstallDirVariable);
}
+ ///
+ public string GetCodeCoverageShimPath()
+ {
+ return Path.Combine(this.GetVanguardDirectory(), VanguardShimPath);
+ }
+
private string GetClrInstrumentationEnginePath(string arch, string fileName, string environmentVariableName)
{
var installationPath = Environment.GetEnvironmentVariable(environmentVariableName);
diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.cs.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.cs.xlf
index 5436e4ca79..7bc4d376db 100644
--- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.cs.xlf
+++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.cs.xlf
@@ -32,7 +32,7 @@
- Testovací běh pro: {0}({1})
+ Testovací běh pro {0} ({1})
diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.de.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.de.xlf
index 61d4e2dd35..c04090a249 100644
--- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.de.xlf
+++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.de.xlf
@@ -32,7 +32,7 @@
- Testlauf für "{0}" ({1})
+ Testlauf für "{0}" ({1})
diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.es.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.es.xlf
index 83186e7077..25034b6cd5 100644
--- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.es.xlf
+++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.es.xlf
@@ -32,7 +32,7 @@
- Serie de pruebas para {0}({1})
+ Serie de pruebas para {0} ({1})
diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.fr.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.fr.xlf
index 19f6a092a2..1593ef23b8 100644
--- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.fr.xlf
+++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.fr.xlf
@@ -32,7 +32,7 @@
- Série de tests pour {0}({1})
+ Série de tests pour {0} ({1})
diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.it.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.it.xlf
index 3a91eab678..05c0ee99cd 100644
--- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.it.xlf
+++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.it.xlf
@@ -32,7 +32,7 @@
- Esecuzione dei test per {0}({1})
+ Esecuzione dei test per {0} ({1})
diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ja.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ja.xlf
index 3a9e5d0e6c..c15bf9ae7f 100644
--- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ja.xlf
+++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ja.xlf
@@ -32,7 +32,7 @@
- {0}({1}) のテスト実行
+ {0} ({1}) のテスト実行
diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ko.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ko.xlf
index 64998a2d4b..77c6f97d70 100644
--- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ko.xlf
+++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ko.xlf
@@ -32,7 +32,7 @@
- {0}({1})에 대한 테스트 실행
+ {0}({1})에 대한 테스트 실행
diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.pl.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.pl.xlf
index 2f1a0547d0..7b7f7aad39 100644
--- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.pl.xlf
+++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.pl.xlf
@@ -32,7 +32,7 @@
- Przebieg testu dla: {0}({1})
+ Przebieg testu dla: {0} ({1})
diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.pt-BR.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.pt-BR.xlf
index 7a01f64e8d..a5567bbf43 100644
--- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.pt-BR.xlf
+++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.pt-BR.xlf
@@ -32,7 +32,7 @@
- Execução de teste para {0}({1})
+ Execução de teste para {0} ({1})
diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ru.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ru.xlf
index ec259d8377..8a1d1a7427 100644
--- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ru.xlf
+++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ru.xlf
@@ -32,7 +32,7 @@
- Тестовый запуск {0}({1})
+ Тестовый запуск для {0} ({1})
diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.zh-Hans.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.zh-Hans.xlf
index ab3adf93fd..f0bdf3c164 100644
--- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.zh-Hans.xlf
+++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.zh-Hans.xlf
@@ -32,7 +32,7 @@
- {0} 的测试运行({1})
+ {0} ({1})的测试运行
diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.zh-Hant.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.zh-Hant.xlf
index 7d3b92e6d4..0fe930f5b6 100644
--- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.zh-Hant.xlf
+++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.zh-Hant.xlf
@@ -32,7 +32,7 @@
- {0}({1}) 的測試回合
+ {0} 的測試回合 ({1})
diff --git a/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs b/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs
index 6b16b27a55..565cf31578 100644
--- a/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs
+++ b/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs
@@ -22,9 +22,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Client.DesignMode
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions;
using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces;
- using CommunicationUtilitiesResources = Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.Resources.Resources;
- using CoreUtilitiesConstants = Microsoft.VisualStudio.TestPlatform.CoreUtilities.Constants;
- using ObjectModelConstants = Microsoft.VisualStudio.TestPlatform.ObjectModel.Constants;
+ using CommunicationUtilitiesResources = CommunicationUtilities.Resources.Resources;
///
/// The design mode client.
@@ -114,7 +112,7 @@ public void ConnectToClientAndProcessRequests(int port, ITestRequestManager test
string.Format(
CultureInfo.CurrentUICulture,
CommunicationUtilitiesResources.ConnectionTimeoutErrorMessage,
- CoreUtilitiesConstants.VstestConsoleProcessName,
+ CoreUtilities.Constants.VstestConsoleProcessName,
"translation layer",
connectionTimeoutInSecs,
EnvironmentHelper.VstestConnectionTimeout)
@@ -324,7 +322,7 @@ public bool AttachDebuggerToProcess(int pid, CancellationToken cancellationToken
// If an attach request is issued but there is no support for attaching on the other
// side of the communication channel, we simply return and let the caller know the
// request failed.
- if (this.protocolConfig.Version < ObjectModelConstants.MinimumProtocolVersionWithDebugSupport)
+ if (this.protocolConfig.Version < Constants.MinimumProtocolVersionWithDebugSupport)
{
return false;
}
@@ -413,39 +411,39 @@ public void TestRunMessageHandler(object sender, TestRunMessageEventArgs e)
private void StartTestRun(TestRunRequestPayload testRunPayload, ITestRequestManager testRequestManager, bool skipTestHostLaunch)
{
Task.Run(
- delegate
- {
- try
+ () =>
{
- testRequestManager.ResetOptions();
-
- var customLauncher = skipTestHostLaunch ?
- DesignModeTestHostLauncherFactory.GetCustomHostLauncherForTestRun(this, testRunPayload) : null;
+ try
+ {
+ testRequestManager.ResetOptions();
- testRequestManager.RunTests(testRunPayload, customLauncher, new DesignModeTestEventsRegistrar(this), this.protocolConfig);
- }
- catch (Exception ex)
- {
- EqtTrace.Error("DesignModeClient: Exception in StartTestRun: " + ex);
+ var customLauncher = skipTestHostLaunch ?
+ DesignModeTestHostLauncherFactory.GetCustomHostLauncherForTestRun(this, testRunPayload) : null;
- var testMessagePayload = new TestMessagePayload { MessageLevel = TestMessageLevel.Error, Message = ex.ToString() };
- this.communicationManager.SendMessage(MessageType.TestMessage, testMessagePayload);
- var runCompletePayload = new TestRunCompletePayload()
+ testRequestManager.RunTests(testRunPayload, customLauncher, new DesignModeTestEventsRegistrar(this), this.protocolConfig);
+ }
+ catch (Exception ex)
{
- TestRunCompleteArgs = new TestRunCompleteEventArgs(null, false, true, ex, null, TimeSpan.MinValue),
- LastRunTests = null
- };
+ EqtTrace.Error("DesignModeClient: Exception in StartTestRun: " + ex);
- // Send run complete to translation layer
- this.communicationManager.SendMessage(MessageType.ExecutionComplete, runCompletePayload);
- }
- });
+ var testMessagePayload = new TestMessagePayload { MessageLevel = TestMessageLevel.Error, Message = ex.ToString() };
+ this.communicationManager.SendMessage(MessageType.TestMessage, testMessagePayload);
+ var runCompletePayload = new TestRunCompletePayload()
+ {
+ TestRunCompleteArgs = new TestRunCompleteEventArgs(null, false, true, ex, null, TimeSpan.MinValue),
+ LastRunTests = null
+ };
+
+ // Send run complete to translation layer
+ this.communicationManager.SendMessage(MessageType.ExecutionComplete, runCompletePayload);
+ }
+ });
}
private void StartDiscovery(DiscoveryRequestPayload discoveryRequestPayload, ITestRequestManager testRequestManager)
{
Task.Run(
- delegate
+ () =>
{
try
{
@@ -475,7 +473,7 @@ private void StartDiscovery(DiscoveryRequestPayload discoveryRequestPayload, ITe
private void StartTestRunAttachmentsProcessing(TestRunAttachmentsProcessingPayload attachmentsProcessingPayload, ITestRequestManager testRequestManager)
{
Task.Run(
- delegate
+ () =>
{
try
{
diff --git a/src/Microsoft.TestPlatform.Client/Discovery/DiscoveryRequest.cs b/src/Microsoft.TestPlatform.Client/Discovery/DiscoveryRequest.cs
index cf01e11821..be17ec3f34 100644
--- a/src/Microsoft.TestPlatform.Client/Discovery/DiscoveryRequest.cs
+++ b/src/Microsoft.TestPlatform.Client/Discovery/DiscoveryRequest.cs
@@ -395,8 +395,9 @@ public void HandleRawMessage(string rawMessage)
{
// Note: Deserialize rawMessage only if required.
- var message = this.LoggerManager.LoggersInitialized || this.requestData.IsTelemetryOptedIn ?
- this.dataSerializer.DeserializeMessage(rawMessage) : null;
+ var message = this.LoggerManager.LoggersInitialized || this.requestData.IsTelemetryOptedIn
+ ? this.dataSerializer.DeserializeMessage(rawMessage)
+ : null;
if (string.Equals(message?.MessageType, MessageType.DiscoveryComplete))
{
diff --git a/src/Microsoft.TestPlatform.Client/Execution/TestRunRequest.cs b/src/Microsoft.TestPlatform.Client/Execution/TestRunRequest.cs
index fdce95cde3..35c9b0082a 100644
--- a/src/Microsoft.TestPlatform.Client/Execution/TestRunRequest.cs
+++ b/src/Microsoft.TestPlatform.Client/Execution/TestRunRequest.cs
@@ -40,12 +40,12 @@ public class TestRunRequest : ITestRunRequest, ITestRunEventsHandler2
///
/// Sync object for various operations
///
- private object syncObject = new Object();
+ private object syncObject = new object();
///
/// Sync object for cancel operation
///
- private object cancelSyncObject = new Object();
+ private object cancelSyncObject = new object();
///
/// The run completion event which will be signaled on completion of test run.
@@ -190,12 +190,12 @@ internal void OnTestSessionTimeout(object obj)
{
if (EqtTrace.IsVerboseEnabled)
{
- EqtTrace.Verbose(String.Format("TestRunRequest.OnTestSessionTimeout: calling cancellation as test run exceeded testSessionTimeout {0} milliseconds", testSessionTimeout));
+ EqtTrace.Verbose(string.Format("TestRunRequest.OnTestSessionTimeout: calling cancellation as test run exceeded testSessionTimeout {0} milliseconds", testSessionTimeout));
}
- string message = String.Format(ClientResources.TestSessionTimeoutMessage, this.testSessionTimeout);
- var testMessagePayload = new CommunicationObjectModel.TestMessagePayload { MessageLevel = TestMessageLevel.Error, Message = message };
- var rawMessage = this.dataSerializer.SerializePayload(CommunicationObjectModel.MessageType.TestMessage, testMessagePayload);
+ string message = string.Format(ClientResources.TestSessionTimeoutMessage, this.testSessionTimeout);
+ var testMessagePayload = new TestMessagePayload { MessageLevel = TestMessageLevel.Error, Message = message };
+ var rawMessage = this.dataSerializer.SerializePayload(MessageType.TestMessage, testMessagePayload);
this.HandleLogMessage(TestMessageLevel.Error, message);
this.HandleRawMessage(rawMessage);
@@ -215,7 +215,7 @@ public bool WaitForCompletion(int timeout)
}
if (this.State != TestRunState.InProgress
- && !(this.State == TestRunState.Completed
+ && !(this.State == TestRunState.Completed
|| this.State == TestRunState.Canceled
|| this.State == TestRunState.Aborted))
{
diff --git a/src/Microsoft.TestPlatform.Client/TestPlatform.cs b/src/Microsoft.TestPlatform.Client/TestPlatform.cs
index 8687b79276..8a24a51a4f 100644
--- a/src/Microsoft.TestPlatform.Client/TestPlatform.cs
+++ b/src/Microsoft.TestPlatform.Client/TestPlatform.cs
@@ -26,7 +26,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Client
using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions;
using Microsoft.VisualStudio.TestPlatform.Utilities.Helpers;
using Microsoft.VisualStudio.TestPlatform.Utilities.Helpers.Interfaces;
- using ClientResources = Microsoft.VisualStudio.TestPlatform.Client.Resources.Resources;
+ using ClientResources = Resources.Resources;
///
/// Implementation for TestPlatform
@@ -136,7 +136,7 @@ public ITestRunRequest CreateTestRunRequest(IRequestData requestData, TestRunCri
var runConfiguration = XmlRunSettingsUtilities.GetRunConfigurationNode(testRunCriteria.TestRunSettings);
// Update extension assemblies from source when design mode is false.
- if (runConfiguration.DesignMode == false)
+ if (!runConfiguration.DesignMode)
{
this.AddExtensionAssembliesFromSource(testRunCriteria);
}
@@ -176,8 +176,7 @@ public void Dispose()
/// Skips filtering by name (if true).
public void UpdateExtensions(IEnumerable pathToAdditionalExtensions, bool skipExtensionFilters)
{
- this.TestEngine.GetExtensionManager()
- .UseAdditionalExtensions(pathToAdditionalExtensions, skipExtensionFilters);
+ this.TestEngine.GetExtensionManager().UseAdditionalExtensions(pathToAdditionalExtensions, skipExtensionFilters);
}
///
@@ -192,11 +191,8 @@ private void ThrowExceptionIfTestHostManagerIsNull(ITestRuntimeProvider testHost
{
if (testHostManager == null)
{
- var config = XmlRunSettingsUtilities.GetRunConfigurationNode(settingXml);
- var framework = config.TargetFramework;
-
EqtTrace.Error("TestPlatform.CreateTestRunRequest: No suitable testHostProvider found for runsettings : {0}", settingXml);
- throw new TestPlatformException(String.Format(CultureInfo.CurrentCulture, ClientResources.NoTestHostProviderFound));
+ throw new TestPlatformException(string.Format(CultureInfo.CurrentCulture, ClientResources.NoTestHostProviderFound));
}
}
diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionAttachmentManager.cs b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionAttachmentManager.cs
index 6938babef3..953c79974c 100644
--- a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionAttachmentManager.cs
+++ b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionAttachmentManager.cs
@@ -62,7 +62,7 @@ internal class DataCollectionAttachmentManager : IDataCollectionAttachmentManage
/// Initializes a new instance of the class.
///
public DataCollectionAttachmentManager()
- : this(new Microsoft.VisualStudio.TestPlatform.Utilities.Helpers.FileHelper())
+ : this(new TestPlatform.Utilities.Helpers.FileHelper())
{
}
@@ -336,10 +336,7 @@ private void AddNewFileTransfer(FileTransferInformation fileTransferInfo, AsyncC
}
}
- if (sendFileCompletedCallback != null)
- {
- sendFileCompletedCallback(this, new AsyncCompletedEventArgs(t.Exception, false, fileTransferInfo.UserToken));
- }
+ sendFileCompletedCallback?.Invoke(this, new AsyncCompletedEventArgs(t.Exception, false, fileTransferInfo.UserToken));
}
catch (Exception e)
{
diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectorConfig.cs b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectorConfig.cs
index 74378d5fd7..de25804357 100644
--- a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectorConfig.cs
+++ b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectorConfig.cs
@@ -59,7 +59,7 @@ public override string IdentifierData
}
///
- public override ICollection
/// The property Value Provider.
/// True if evaluation is successful.
- internal bool Evaluate(Func propertyValueProvider)
+ internal bool Evaluate(Func propertyValueProvider)
{
ValidateArg.NotNull(propertyValueProvider, nameof(propertyValueProvider));
diff --git a/src/Microsoft.TestPlatform.Common/Friends.cs b/src/Microsoft.TestPlatform.Common/Friends.cs
index 950f802108..e767fb98ad 100644
--- a/src/Microsoft.TestPlatform.Common/Friends.cs
+++ b/src/Microsoft.TestPlatform.Common/Friends.cs
@@ -23,5 +23,6 @@
[assembly: InternalsVisibleTo("Microsoft.TestPlatform.CommunicationUtilities.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
[assembly: InternalsVisibleTo("Microsoft.TestPlatform.Client.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
[assembly: InternalsVisibleTo("Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
+[assembly: InternalsVisibleTo("Microsoft.TestPlatform.TestUtilities, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
#endregion
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.Common/Logging/InternalTestLoggerEvents.cs b/src/Microsoft.TestPlatform.Common/Logging/InternalTestLoggerEvents.cs
index 26bbcef7d1..13a3416be7 100644
--- a/src/Microsoft.TestPlatform.Common/Logging/InternalTestLoggerEvents.cs
+++ b/src/Microsoft.TestPlatform.Common/Logging/InternalTestLoggerEvents.cs
@@ -197,7 +197,7 @@ internal void WaitForEventCompletion()
/// Arguments to to be raised.
internal void RaiseTestResult(TestResultEventArgs args)
{
- ValidateArg.NotNull(args, "args");
+ ValidateArg.NotNull(args, "args");
this.CheckDisposed();
@@ -217,7 +217,7 @@ internal void RaiseTestResult(TestResultEventArgs args)
/// Arguments to be raised.
internal void RaiseTestRunStart(TestRunStartEventArgs args)
{
- ValidateArg.NotNull(args, "args");
+ ValidateArg.NotNull(args, "args");
CheckDisposed();
@@ -230,7 +230,7 @@ internal void RaiseTestRunStart(TestRunStartEventArgs args)
/// Arguments to be raised.
internal void RaiseDiscoveryStart(DiscoveryStartEventArgs args)
{
- ValidateArg.NotNull(args, "args");
+ ValidateArg.NotNull(args, "args");
CheckDisposed();
@@ -243,7 +243,7 @@ internal void RaiseDiscoveryStart(DiscoveryStartEventArgs args)
/// Arguments to be raised.
internal void RaiseDiscoveryMessage(TestRunMessageEventArgs args)
{
- ValidateArg.NotNull(args, "args");
+ ValidateArg.NotNull(args, "args");
this.CheckDisposed();
@@ -257,7 +257,7 @@ internal void RaiseDiscoveryMessage(TestRunMessageEventArgs args)
/// Arguments to be raised.
internal void RaiseDiscoveredTests(DiscoveredTestsEventArgs args)
{
- ValidateArg.NotNull(args, "args");
+ ValidateArg.NotNull(args, "args");
CheckDisposed();
@@ -270,7 +270,7 @@ internal void RaiseDiscoveredTests(DiscoveredTestsEventArgs args)
/// Arguments to be raised.
internal void RaiseDiscoveryComplete(DiscoveryCompleteEventArgs args)
{
- ValidateArg.NotNull(args, "args");
+ ValidateArg.NotNull(args, "args");
CheckDisposed();
@@ -287,7 +287,7 @@ internal void RaiseDiscoveryComplete(DiscoveryCompleteEventArgs args)
/// Arguments to be raised
internal void RaiseTestRunComplete(TestRunCompleteEventArgs args)
{
- ValidateArg.NotNull(args, "args");
+ ValidateArg.NotNull(args, "args");
CheckDisposed();
@@ -341,8 +341,8 @@ private void TestRunMessageHandler(object sender, TestRunMessageEventArgs e)
///
private void SafeInvokeAsync(Func eventHandlersFactory, EventArgs args, int size, string traceDisplayName)
{
- ValidateArg.NotNull>(eventHandlersFactory, "eventHandlersFactory");
- ValidateArg.NotNull(args, "args");
+ ValidateArg.NotNull(eventHandlersFactory, "eventHandlersFactory");
+ ValidateArg.NotNull(args, "args");
// Invoke the handlers on a background thread.
this.loggerEventQueue.QueueJob(
@@ -428,9 +428,9 @@ private static int FindTestResultSize(TestResultEventArgs args)
if (args.Result.Messages.Count != 0)
{
- foreach (ObjectModel.TestResultMessage msg in args.Result.Messages)
+ foreach (TestResultMessage msg in args.Result.Messages)
{
- if (!String.IsNullOrEmpty(msg.Text))
+ if (!string.IsNullOrEmpty(msg.Text))
size += msg.Text.Length;
}
}
diff --git a/src/Microsoft.TestPlatform.Common/RunSettings.cs b/src/Microsoft.TestPlatform.Common/RunSettings.cs
index cc86218fe0..53bc86612a 100644
--- a/src/Microsoft.TestPlatform.Common/RunSettings.cs
+++ b/src/Microsoft.TestPlatform.Common/RunSettings.cs
@@ -208,8 +208,8 @@ private void ReadRunSettings(XmlReader reader)
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "This methods must not fail on crash in loading settings.")]
private void LoadSection(XmlReader reader, SettingsProviderExtensionManager settingsExtensionManager)
{
- ValidateArg.NotNull(reader, "reader");
- ValidateArg.NotNull(settingsExtensionManager, "settingsExtensionManager");
+ ValidateArg.NotNull(reader, "reader");
+ ValidateArg.NotNull(settingsExtensionManager, "settingsExtensionManager");
// Check for duplicate settings
if (this.settings.ContainsKey(reader.Name))
diff --git a/src/Microsoft.TestPlatform.Common/SettingsProvider/SettingsProviderExtensionManager.cs b/src/Microsoft.TestPlatform.Common/SettingsProvider/SettingsProviderExtensionManager.cs
index 7f7335a5ea..372b7f3660 100644
--- a/src/Microsoft.TestPlatform.Common/SettingsProvider/SettingsProviderExtensionManager.cs
+++ b/src/Microsoft.TestPlatform.Common/SettingsProvider/SettingsProviderExtensionManager.cs
@@ -145,7 +145,7 @@ public static void Destroy()
/// Indicates whether this method should throw on error.
public static void LoadAndInitializeAllExtensions(bool shouldThrowOnError)
{
- var extensionManager = SettingsProviderExtensionManager.Create();
+ var extensionManager = Create();
try
{
diff --git a/src/Microsoft.TestPlatform.Common/Utilities/ExceptionUtilities.cs b/src/Microsoft.TestPlatform.Common/Utilities/ExceptionUtilities.cs
index 3284d15a3c..43d0e4f027 100644
--- a/src/Microsoft.TestPlatform.Common/Utilities/ExceptionUtilities.cs
+++ b/src/Microsoft.TestPlatform.Common/Utilities/ExceptionUtilities.cs
@@ -4,6 +4,7 @@
namespace Microsoft.VisualStudio.TestPlatform.Common.Utilities
{
using System;
+ using System.Text;
///
/// Exception utilities.
@@ -22,15 +23,16 @@ public static string GetExceptionMessage(Exception exception)
return string.Empty;
}
- var exceptionString = exception.Message;
+ var exceptionString = new StringBuilder(exception.Message);
var inner = exception.InnerException;
while (inner != null)
{
- exceptionString += Environment.NewLine + inner.Message;
+ exceptionString.Append(Environment.NewLine);
+ exceptionString.Append(inner.Message);
inner = inner.InnerException;
}
- return exceptionString;
+ return exceptionString.ToString();
}
}
}
diff --git a/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsProviderExtensions.cs b/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsProviderExtensions.cs
index c6e981289d..9caf3d38d1 100644
--- a/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsProviderExtensions.cs
+++ b/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsProviderExtensions.cs
@@ -83,7 +83,7 @@ public static void UpdateRunSettingsNode(this IRunSettingsProvider runSettingsPr
ValidateArg.NotNull(data, nameof(data));
var xmlDocument = runSettingsProvider.GetRunSettingXmlDocument();
- RunSettingsProviderExtensions.UpdateRunSettingsXmlDocument(xmlDocument, key, data);
+ UpdateRunSettingsXmlDocument(xmlDocument, key, data);
runSettingsProvider.UpdateRunSettings(xmlDocument.OuterXml);
}
@@ -149,7 +149,7 @@ public static void UpdateRunSettingsNodeInnerXml(this IRunSettingsProvider runSe
ValidateArg.NotNull(xml, nameof(xml));
var xmlDocument = runSettingsProvider.GetRunSettingXmlDocument();
- RunSettingsProviderExtensions.UpdateRunSettingsXmlDocumentInnerXml(xmlDocument, key, xml);
+ UpdateRunSettingsXmlDocumentInnerXml(xmlDocument, key, xml);
runSettingsProvider.UpdateRunSettings(xmlDocument.OuterXml);
}
@@ -172,7 +172,7 @@ internal static XmlNode GetXmlNode(XmlDocument xmlDocument, string key)
internal static void UpdateRunSettingsXmlDocument(XmlDocument xmlDocument, string key, string data)
{
- var node = GetXmlNode(xmlDocument, key) ?? RunSettingsProviderExtensions.CreateNode(xmlDocument, key);
+ var node = GetXmlNode(xmlDocument, key) ?? CreateNode(xmlDocument, key);
node.InnerText = data;
}
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/EnvironmentHelper.cs b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/EnvironmentHelper.cs
index 41e631b246..032d9c1275 100644
--- a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/EnvironmentHelper.cs
+++ b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/EnvironmentHelper.cs
@@ -21,16 +21,16 @@ public static int GetConnectionTimeout()
#if NETSTANDARD1_0
var envVarValue = string.Empty;
#else
- var envVarValue = Environment.GetEnvironmentVariable(EnvironmentHelper.VstestConnectionTimeout);
+ var envVarValue = Environment.GetEnvironmentVariable(VstestConnectionTimeout);
#endif
if (!string.IsNullOrEmpty(envVarValue) && int.TryParse(envVarValue, out int value) && value >= 0)
{
- EqtTrace.Info("EnvironmentHelper.GetConnectionTimeout: {0} value set to {1}.", EnvironmentHelper.VstestConnectionTimeout, value);
+ EqtTrace.Info("EnvironmentHelper.GetConnectionTimeout: {0} value set to {1}.", VstestConnectionTimeout, value);
}
else
{
- value = EnvironmentHelper.DefaultConnectionTimeout;
+ value = DefaultConnectionTimeout;
}
return value;
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/FileHelper.cs b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/FileHelper.cs
index 6cf218d7ad..bfe4bb4dcd 100644
--- a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/FileHelper.cs
+++ b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/FileHelper.cs
@@ -117,8 +117,8 @@ public void DeleteEmptyDirectroy(string dirPath)
{
try
{
- if (Directory.Exists(dirPath) && Directory.GetFiles(dirPath).Length == 0
- && Directory.GetDirectories(dirPath).Length == 0)
+ if (Directory.Exists(dirPath)
+ && Directory.EnumerateFileSystemEntries(dirPath).Count() == 0)
{
Directory.Delete(dirPath, true);
}
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs
index 616f48d165..80c8c6fcd4 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs
@@ -658,20 +658,5 @@ private void CheckDisposed()
throw new ObjectDisposedException(typeof(TestLoggerManager).FullName);
}
}
-
- ///
- /// Check and raise warning if disposed.
- ///
- /// Warning message.
- /// TestLoggerManager disposed flag.
- private bool CheckAndRaiseWarningIfDisposed(string warning)
- {
- if (this.isDisposed)
- {
- EqtTrace.Warning("{0}: Ignoring as the object is disposed.", warning);
- }
-
- return this.isDisposed;
- }
}
}
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DataCollectionTestRunEventsHandler.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DataCollectionTestRunEventsHandler.cs
index 8a7025fe82..74682d4b74 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DataCollectionTestRunEventsHandler.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DataCollectionTestRunEventsHandler.cs
@@ -130,7 +130,7 @@ public void HandleTestRunComplete(TestRunCompleteEventArgs testRunCompleteArgs,
{
if (this.dataCollectionAttachmentSets != null && this.dataCollectionAttachmentSets.Any())
{
- runContextAttachments = DataCollectionTestRunEventsHandler.GetCombinedAttachmentSets(this.dataCollectionAttachmentSets, runContextAttachments);
+ runContextAttachments = GetCombinedAttachmentSets(this.dataCollectionAttachmentSets, runContextAttachments);
}
this.testRunEventsHandler.HandleTestRunComplete(testRunCompleteArgs, lastChunkArgs, runContextAttachments, executorUris);
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyOutOfProcDataCollectionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyOutOfProcDataCollectionManager.cs
index 094c371e2c..b10e7193fe 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyOutOfProcDataCollectionManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyOutOfProcDataCollectionManager.cs
@@ -24,7 +24,7 @@ internal class ProxyOutOfProcDataCollectionManager
///
/// Sync object for ensuring that only run is active at a time
///
- private Object syncObject = new Object();
+ private object syncObject = new object();
///
/// Initializes a new instance of the class.
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscovererEnumerator.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscovererEnumerator.cs
index 0d440e5bdd..9de75faa79 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscovererEnumerator.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscovererEnumerator.cs
@@ -241,7 +241,7 @@ private void DiscoverTestsFromSingleDiscoverer(
EqtTrace.Verbose("DiscovererEnumerator.DiscoverTestsFromSingleDiscoverer: Done loading tests for {0}",
discoverer.Value.GetType().FullName);
- var discovererFromDeprecatedLocations = DiscovererEnumerator.IsDiscovererFromDeprecatedLocations(discoverer);
+ var discovererFromDeprecatedLocations = IsDiscovererFromDeprecatedLocations(discoverer);
if (discovererFromDeprecatedLocations)
{
logger.SendMessage(TestMessageLevel.Warning,
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs
index 15a0295aa4..35d3cf319f 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs
@@ -581,7 +581,7 @@ private TestExecutorExtensionManager GetExecutorExtensionManager(string extensio
try
{
if (string.IsNullOrEmpty(extensionAssembly)
- || string.Equals(extensionAssembly, ObjectModel.Constants.UnspecifiedAdapterPath))
+ || string.Equals(extensionAssembly, Constants.UnspecifiedAdapterPath))
{
// full execution. Since the extension manager is cached this can be created multiple times without harming performance.
return TestExecutorExtensionManager.Create();
@@ -729,7 +729,7 @@ private ICollection UpdateTestResults(ICollection testRe
foreach (var testResult in testResults)
{
- var updatedTestResult = this.dataSerializer.Clone(testResult);
+ var updatedTestResult = this.dataSerializer.Clone(testResult);
updatedTestResult.TestCase.Source = package;
updatedTestResults.Add(updatedTestResult);
}
@@ -747,7 +747,7 @@ private ICollection UpdateInProgressTests(ICollection inProg
ICollection updatedTestCases = new List();
foreach (var inProgressTestCase in inProgressTestCases)
{
- var updatedTestCase = this.dataSerializer.Clone(inProgressTestCase);
+ var updatedTestCase = this.dataSerializer.Clone(inProgressTestCase);
updatedTestCase.Source = package;
updatedTestCases.Add(updatedTestCase);
}
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/ExecutionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/ExecutionManager.cs
index ae85f23f1e..d0cd36ce80 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/ExecutionManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/ExecutionManager.cs
@@ -106,7 +106,7 @@ public void StartTestRun(
}
catch (Exception e)
{
- runEventsHandler.HandleLogMessage(ObjectModel.Logging.TestMessageLevel.Error, e.ToString());
+ runEventsHandler.HandleLogMessage(TestMessageLevel.Error, e.ToString());
this.Abort(runEventsHandler);
}
finally
@@ -142,7 +142,7 @@ public void StartTestRun(
}
catch (Exception e)
{
- runEventsHandler.HandleLogMessage(ObjectModel.Logging.TestMessageLevel.Error, e.ToString());
+ runEventsHandler.HandleLogMessage(TestMessageLevel.Error, e.ToString());
this.Abort(runEventsHandler);
}
finally
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithSources.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithSources.cs
index 377cac355c..d77952a2c3 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithSources.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithSources.cs
@@ -22,7 +22,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution
using ObjectModel.Client;
using ObjectModel.Logging;
using Utilities;
- using CrossPlatEngineResources = Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Resources.Resources;
+ using CrossPlatEngineResources = Resources.Resources;
internal class RunTestsWithSources : BaseRunTests
{
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithTests.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithTests.cs
index 79990b4b19..b072cac0a0 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithTests.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithTests.cs
@@ -129,7 +129,7 @@ private Dictionary, List> GetExecutorVsTestCaseList
// TODO: Fill this in with the right extension value.
var executorUriExtensionTuple = new Tuple(
test.ExecutorUri,
- ObjectModel.Constants.UnspecifiedAdapterPath);
+ Constants.UnspecifiedAdapterPath);
if (result.TryGetValue(executorUriExtensionTuple, out testList))
{
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.pl.xlf b/src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.pl.xlf
index 3ee87a2759..872c937c60 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.pl.xlf
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.pl.xlf
@@ -194,7 +194,7 @@
- Wyszukiwanie adaptera jest zmieniane, zobacz https://github.com/Microsoft/vstest-docs/blob/master/RFCs/0022-User-Specified-TestAdapter-Lookup.md#roadmapw celu uzyskania dalszych szczegółów.
+ Wyszukiwanie adaptera jest zmieniane, zobacz https://github.com/Microsoft/vstest-docs/blob/master/RFCs/0022-User-Specified-TestAdapter-Lookup.md#roadmap w celu uzyskania dalszych szczegółów.
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/TestEngine.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/TestEngine.cs
index fa6364b08f..0f9f6e8118 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/TestEngine.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/TestEngine.cs
@@ -80,7 +80,7 @@ public IProxyDiscoveryManager GetDiscoveryManager(IRequestData requestData, ITes
return new InProcessProxyDiscoveryManager(testHostManager, new TestHostManagerFactory(newRequestData));
}
- Func proxyDiscoveryManagerCreator = delegate
+ Func proxyDiscoveryManagerCreator = () =>
{
var hostManager = this.testHostProviderManager.GetTestHostManagerByRunConfiguration(discoveryCriteria.RunSettings);
hostManager?.Initialize(TestSessionMessageLogger.Instance, discoveryCriteria.RunSettings);
@@ -120,7 +120,7 @@ public IProxyExecutionManager GetExecutionManager(IRequestData requestData, ITes
}
// SetupChannel ProxyExecutionManager with data collection if data collectors are specififed in run settings.
- Func proxyExecutionManagerCreator = delegate
+ Func proxyExecutionManagerCreator = () =>
{
// Create a new HostManager, to be associated with individual ProxyExecutionManager(&POM)
var hostManager = this.testHostProviderManager.GetTestHostManagerByRunConfiguration(testRunCriteria.TestRunSettings);
@@ -178,8 +178,8 @@ private static int GetDistinctNumberOfSources(TestRunCriteria testRunCriteria)
int numSources = 1;
if (testRunCriteria.HasSpecificTests)
{
- numSources = new System.Collections.Generic.HashSet(
- testRunCriteria.Tests.Select((testCase) => testCase.Source)).Count;
+ numSources = new HashSet(
+ testRunCriteria.Tests.Select(testCase => testCase.Source)).Count;
}
else
{
diff --git a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Resources/xlf/Resources.cs.xlf b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Resources/xlf/Resources.cs.xlf
index e70ff548d3..92cbf0b875 100644
--- a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Resources/xlf/Resources.cs.xlf
+++ b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Resources/xlf/Resources.cs.xlf
@@ -25,7 +25,10 @@
The test running when the crash occurred:
{0}
This test may, or may not be the source of the crash.
- Aktivní testovací běh byl přerušen, protože hostitelský proces byl neočekávaně ukončen při provádění následujících testů:
+ Aktivní testovací běh se přerušil, protože proces hostitele se neočekávaně ukončil. Prověřte prosím výše zásobník volání, pokud je k dispozici. Nabídne vám další informace o původu výjimky.
+Test, který běžel, když došlo k chybovému ukončení:
+{0}
+Tento test může a nemusí být příčinou chybového ukončení.
{0} is a single test (or in rare cases multiple tests) that were running when test host crashed.
@@ -60,7 +63,7 @@ This test may, or may not be the source of the crash.
- Uplynul zadaný čas nečinnosti {0} min. Shromažďuje se výpis paměti a ukončuje se proces hostitele testu.
+ Zadaná doba nečinnosti {0} {1} vypršela. Shromažďují se výpisy při zablokování z hostitele testhost a jeho podřízených procesů.
{0} value, {1} one of the unit strings below, Minutes/Seconds
@@ -70,27 +73,27 @@ This test may, or may not be the source of the crash.
- All tests finished running, Sequence file will not be generated.
+ Všechny testy se dokončily. Soubor sekvence se nevygeneruje.
"Sequence" is the name of the file.
- Dumping {0} - {1}
+ Vytváří se výpis pro {0} – {1}
as in creating a process dump, {0} process id, {1} process name
- Dumping this process tree (from bottom)
+ Vytváří se výpis tohoto stromu procesu (zespod)
- minutes
+ minuty
- seconds
+ sekundy