Skip to content

Commit

Permalink
Merge branch 'master' into dev/jachocho/1114286_merging
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubch1 committed Jun 4, 2020
2 parents 6189eb0 + ef615ae commit 4870e7c
Show file tree
Hide file tree
Showing 76 changed files with 932 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Microsoft.TestPlatform.ObjectModel\Microsoft.TestPlatform.ObjectModel.csproj" />
<ProjectReference Include="..\..\Microsoft.TestPlatform.Utilities\Microsoft.TestPlatform.Utilities.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Internal.CodeCoverage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace Microsoft.VisualStudio.Coverage
using System.Xml;
using Interfaces;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection;
using Microsoft.VisualStudio.TestPlatform.Utilities;
using TestPlatform.ObjectModel;
using TraceCollector;
using TraceCollector.Interfaces;
Expand Down Expand Up @@ -107,10 +108,29 @@ public virtual void Initialize(
IDataCollectionSink dataSink,
IDataCollectionLogger logger)
{
var defaultConfigurationElement = DynamicCoverageDataCollectorImpl.GetDefaultConfiguration();

try
{
var processor = new CodeCoverageRunSettingsProcessor(defaultConfigurationElement);
configurationElement = (XmlElement)processor.Process(configurationElement);
}
catch (Exception ex)
{
EqtTrace.Warning(
string.Format(
CultureInfo.CurrentCulture,
string.Join(
" ",
"DynamicCoverageDataCollectorImpl.Initialize: Exception encountered while processing the configuration element.",
"Keeping the configuration element unaltered. More info about the exception: {0}"),
ex.Message));
}

EqtTrace.Info("DynamicCoverageDataCollectorImpl.Initialize: Initialize configuration. ");
if (string.IsNullOrEmpty(configurationElement?.InnerXml))
{
configurationElement = DynamicCoverageDataCollectorImpl.GetDefaultConfiguration();
configurationElement = defaultConfigurationElement;
}

this.logger = logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.DataCollector
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
using Microsoft.VisualStudio.TestPlatform.Utilities;
using Microsoft.VisualStudio.TestPlatform.Utilities.Helpers.Interfaces;

/// <summary>
Expand Down Expand Up @@ -117,11 +118,21 @@ public void Initialize(SessionId id, string outputDirectory, IMessageSink messag
this.SessionOutputDirectory = Path.Combine(absolutePath, id.Id.ToString());
}

// Create the output directory if it doesn't exist.
if (!Directory.Exists(this.SessionOutputDirectory))
try
{
// Create the output directory if it doesn't exist.
if (!Directory.Exists(this.SessionOutputDirectory))
{
Directory.CreateDirectory(this.SessionOutputDirectory);
}
}
catch (UnauthorizedAccessException accessException)
{
Directory.CreateDirectory(this.SessionOutputDirectory);
string accessDeniedMessage = string.Format(CultureInfo.CurrentCulture, Resources.Resources.AccessDenied, accessException.Message);
ConsoleOutput.Instance.Error(false, accessDeniedMessage);
throw;
}

}

/// <inheritdoc/>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/Microsoft.TestPlatform.Common/Resources/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AccessDenied" xml:space="preserve">
<value>{0} Access denied while trying to create "TestResults" folder in mentioned location. You are getting this exception because you are running vstest.console.exe from a folder which requires having write access. To solve the issue: please run vstest.console.exe from a folder where you have write privileges. For more information, please look at the error message:</value>
</data>
<data name="CancellationRequested" xml:space="preserve">
<value>Cancelling the operation as requested.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@
<target state="translated">Nepovedlo se načíst rozšíření ze souboru {0}. Další informace získáte pomocí parametru /diag.</target>
<note></note>
</trans-unit>
<trans-unit id="AccessDenied">
<source>{0} Access denied while trying to create "TestResults" folder in mentioned location. You are getting this exception because you are running vstest.console.exe from a folder which requires having write access. To solve the issue: please run vstest.console.exe from a folder where you have write privileges. For more information, please look at the error message:</source>
<target state="new">Access denied while trying to create "TestResults" folder in current location. You are getting this exception because you are running vstest.console.exe from a folder which requires administrator rights. To solve the issue : please open command line "As Administrator" or run vstest.console.exe from a folder where you have admin privileges.</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@
<target state="translated">Fehler beim Laden von Erweiterungen aus der Datei "{0}". Verwenden Sie "/diag", um weitere Informationen zu erhalten.</target>
<note></note>
</trans-unit>
<trans-unit id="AccessDenied">
<source>{0} Access denied while trying to create "TestResults" folder in mentioned location. You are getting this exception because you are running vstest.console.exe from a folder which requires having write access. To solve the issue: please run vstest.console.exe from a folder where you have write privileges. For more information, please look at the error message:</source>
<target state="new">Access denied while trying to create "TestResults" folder in current location. You are getting this exception because you are running vstest.console.exe from a folder which requires administrator rights. To solve the issue : please open command line "As Administrator" or run vstest.console.exe from a folder where you have admin privileges.</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@
<target state="translated">No se pudieron cargar las extensiones del archivo "{0}". Use /diag para obtener más información.</target>
<note></note>
</trans-unit>
<trans-unit id="AccessDenied">
<source>{0} Access denied while trying to create "TestResults" folder in mentioned location. You are getting this exception because you are running vstest.console.exe from a folder which requires having write access. To solve the issue: please run vstest.console.exe from a folder where you have write privileges. For more information, please look at the error message:</source>
<target state="new">Access denied while trying to create "TestResults" folder in current location. You are getting this exception because you are running vstest.console.exe from a folder which requires administrator rights. To solve the issue : please open command line "As Administrator" or run vstest.console.exe from a folder where you have admin privileges.</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@
<target state="translated">Le chargement des extensions à partir du fichier '{0}' a échoué. Pour plus d'informations, utilisez /diag.</target>
<note></note>
</trans-unit>
<trans-unit id="AccessDenied">
<source>{0} Access denied while trying to create "TestResults" folder in mentioned location. You are getting this exception because you are running vstest.console.exe from a folder which requires having write access. To solve the issue: please run vstest.console.exe from a folder where you have write privileges. For more information, please look at the error message:</source>
<target state="new">Access denied while trying to create "TestResults" folder in current location. You are getting this exception because you are running vstest.console.exe from a folder which requires administrator rights. To solve the issue : please open command line "As Administrator" or run vstest.console.exe from a folder where you have admin privileges.</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@
<target state="translated">Non è stato possibile caricare le estensioni dal file '{0}'. Per altre informazioni, usare /diag.</target>
<note></note>
</trans-unit>
<trans-unit id="AccessDenied">
<source>{0} Access denied while trying to create "TestResults" folder in mentioned location. You are getting this exception because you are running vstest.console.exe from a folder which requires having write access. To solve the issue: please run vstest.console.exe from a folder where you have write privileges. For more information, please look at the error message:</source>
<target state="new">Access denied while trying to create "TestResults" folder in current location. You are getting this exception because you are running vstest.console.exe from a folder which requires administrator rights. To solve the issue : please open command line "As Administrator" or run vstest.console.exe from a folder where you have admin privileges.</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@
<target state="translated">ファイル '{0}' から拡張機能を読み込めませんでした。詳細な情報を得るには、/diag をご使用ください。</target>
<note></note>
</trans-unit>
<trans-unit id="AccessDenied">
<source>{0} Access denied while trying to create "TestResults" folder in mentioned location. You are getting this exception because you are running vstest.console.exe from a folder which requires having write access. To solve the issue: please run vstest.console.exe from a folder where you have write privileges. For more information, please look at the error message:</source>
<target state="new">Access denied while trying to create "TestResults" folder in current location. You are getting this exception because you are running vstest.console.exe from a folder which requires administrator rights. To solve the issue : please open command line "As Administrator" or run vstest.console.exe from a folder where you have admin privileges.</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@
<target state="translated">'{0}' 파일에서 확장을 로드하지 못했습니다. 자세한 내용을 보려면 /diag를 사용하세요.</target>
<note></note>
</trans-unit>
<trans-unit id="AccessDenied">
<source>{0} Access denied while trying to create "TestResults" folder in mentioned location. You are getting this exception because you are running vstest.console.exe from a folder which requires having write access. To solve the issue: please run vstest.console.exe from a folder where you have write privileges. For more information, please look at the error message:</source>
<target state="new">Access denied while trying to create "TestResults" folder in current location. You are getting this exception because you are running vstest.console.exe from a folder which requires administrator rights. To solve the issue : please open command line "As Administrator" or run vstest.console.exe from a folder where you have admin privileges.</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@
<target state="translated">Nie można załadować rozszerzeń z pliku „{0}”. Aby uzyskać więcej informacji, użyj opcji /diag.</target>
<note></note>
</trans-unit>
<trans-unit id="AccessDenied">
<source>{0} Access denied while trying to create "TestResults" folder in mentioned location. You are getting this exception because you are running vstest.console.exe from a folder which requires having write access. To solve the issue: please run vstest.console.exe from a folder where you have write privileges. For more information, please look at the error message:</source>
<target state="new">Access denied while trying to create "TestResults" folder in current location. You are getting this exception because you are running vstest.console.exe from a folder which requires administrator rights. To solve the issue : please open command line "As Administrator" or run vstest.console.exe from a folder where you have admin privileges.</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@
<target state="translated">Falha ao carregar as extensões do arquivo '{0}'. Use /diag para obter mais informações.</target>
<note></note>
</trans-unit>
<trans-unit id="AccessDenied">
<source>{0} Access denied while trying to create "TestResults" folder in mentioned location. You are getting this exception because you are running vstest.console.exe from a folder which requires having write access. To solve the issue: please run vstest.console.exe from a folder where you have write privileges. For more information, please look at the error message:</source>
<target state="new">Access denied while trying to create "TestResults" folder in current location. You are getting this exception because you are running vstest.console.exe from a folder which requires administrator rights. To solve the issue : please open command line "As Administrator" or run vstest.console.exe from a folder where you have admin privileges.</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@
<target state="translated">Не удалось загрузить расширения из файла "{0}". Для получения дополнительных сведений используйте /diag.</target>
<note></note>
</trans-unit>
<trans-unit id="AccessDenied">
<source>{0} Access denied while trying to create "TestResults" folder in mentioned location. You are getting this exception because you are running vstest.console.exe from a folder which requires having write access. To solve the issue: please run vstest.console.exe from a folder where you have write privileges. For more information, please look at the error message:</source>
<target state="new">Access denied while trying to create "TestResults" folder in current location. You are getting this exception because you are running vstest.console.exe from a folder which requires administrator rights. To solve the issue : please open command line "As Administrator" or run vstest.console.exe from a folder where you have admin privileges.</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@
<target state="translated">Uzantılar '{0}' dosyasından yüklenemedi. Daha fazla bilgi için lütfen /diag kullanın.</target>
<note></note>
</trans-unit>
<trans-unit id="AccessDenied">
<source>{0} Access denied while trying to create "TestResults" folder in mentioned location. You are getting this exception because you are running vstest.console.exe from a folder which requires having write access. To solve the issue: please run vstest.console.exe from a folder where you have write privileges. For more information, please look at the error message:</source>
<target state="new">Access denied while trying to create "TestResults" folder in current location. You are getting this exception because you are running vstest.console.exe from a folder which requires administrator rights. To solve the issue : please open command line "As Administrator" or run vstest.console.exe from a folder where you have admin privileges.</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
5 changes: 5 additions & 0 deletions src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@
<target state="new">TestPluginDiscoverer: Failed to load extensions from file '{0}'. Please use /diag for more information.</target>
<note></note>
</trans-unit>
<trans-unit id="AccessDenied">
<source>{0} Access denied while trying to create "TestResults" folder in mentioned location. You are getting this exception because you are running vstest.console.exe from a folder which requires having write access. To solve the issue: please run vstest.console.exe from a folder where you have write privileges. For more information, please look at the error message:</source>
<target state="new">Access denied while trying to create "TestResults" folder in current location. You are getting this exception because you are running vstest.console.exe from a folder which requires administrator rights. To solve the issue : please open command line "As Administrator" or run vstest.console.exe from a folder where you have admin privileges.</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@
<target state="translated">未能从文件 "{0}" 加载扩展。有关详细信息,请使用 /diag。</target>
<note></note>
</trans-unit>
<trans-unit id="AccessDenied">
<source>{0} Access denied while trying to create "TestResults" folder in mentioned location. You are getting this exception because you are running vstest.console.exe from a folder which requires having write access. To solve the issue: please run vstest.console.exe from a folder where you have write privileges. For more information, please look at the error message:</source>
<target state="new">Access denied while trying to create "TestResults" folder in current location. You are getting this exception because you are running vstest.console.exe from a folder which requires administrator rights. To solve the issue : please open command line "As Administrator" or run vstest.console.exe from a folder where you have admin privileges.</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
Loading

0 comments on commit 4870e7c

Please sign in to comment.