Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Abort when init and run messages fail to process #2887

Merged
merged 1 commit into from May 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -1447,6 +1447,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Testovací běh se přerušil s chybou {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Canceled.]]></Val>
Expand Down
Expand Up @@ -1447,6 +1447,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Der Testlauf wurde mit dem Fehler {0} abgebrochen.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Canceled.]]></Val>
Expand Down
Expand Up @@ -1447,6 +1447,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[La serie de pruebas se ha anulado con el error {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Canceled.]]></Val>
Expand Down
Expand Up @@ -1447,6 +1447,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Désolé... Nous n’avons pas pu procéder à la série de tests, car nous avons rencontré l’erreur suivante : {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Canceled.]]></Val>
Expand Down
Expand Up @@ -1447,6 +1447,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Esecuzione dei test interrotta con errore {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Canceled.]]></Val>
Expand Down
Expand Up @@ -1447,6 +1447,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[テストの実行がエラー {0} により中止されました。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Canceled.]]></Val>
Expand Down
Expand Up @@ -1447,6 +1447,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[테스트 실행이 {0} 오류로 인해 중단되었습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Canceled.]]></Val>
Expand Down
Expand Up @@ -1447,6 +1447,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Przebieg testowy został przerwany z powodu błędu {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Canceled.]]></Val>
Expand Down
Expand Up @@ -1447,6 +1447,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Execução de Teste Abortada com Erro {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Canceled.]]></Val>
Expand Down
Expand Up @@ -1456,6 +1456,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Тестовый запуск прерван с ошибкой {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunFailed" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Failed.]]></Val>
Expand Down
Expand Up @@ -1447,6 +1447,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Test Çalıştırması {0} hatasıyla durduruldu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Canceled.]]></Val>
Expand Down
Expand Up @@ -1447,6 +1447,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[测试运行已中止,出现错误 {0}。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Canceled.]]></Val>
Expand Down
Expand Up @@ -1447,6 +1447,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[測試執行已中止,錯誤 {0}。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Test Run Canceled.]]></Val>
Expand Down
Expand Up @@ -529,7 +529,7 @@ private Assembly CurrentDomainAssemblyResolve(object sender, AssemblyResolveEven
{
try
{
EqtTrace.Verbose("CurrentDomain_AssemblyResolve: Resolving assembly '{0}'.", args.Name);
EqtTrace.Verbose("CurrentDomainAssemblyResolve: Resolving assembly '{0}'.", args.Name);

if (this.resolvedAssemblies.TryGetValue(args.Name, out assembly))
{
Expand Down
11 changes: 10 additions & 1 deletion src/Microsoft.TestPlatform.Common/Utilities/AssemblyResolver.cs
Expand Up @@ -106,6 +106,7 @@ private Assembly OnResolve(object sender, AssemblyResolveEventArgs args)

if (this.searchDirectories == null || this.searchDirectories.Count == 0)
{
EqtTrace.Info("AssemblyResolver.OnResolve: {0}: There are no search directories, returning.", args.Name);
return null;
}

Expand Down Expand Up @@ -146,23 +147,31 @@ private Assembly OnResolve(object sender, AssemblyResolveEventArgs args)
continue;
}

EqtTrace.Info("AssemblyResolver.OnResolve: {0}: Searching in: '{1}'.", args.Name, dir);

foreach (var extension in SupportedFileExtensions)
{
var assemblyPath = Path.Combine(dir, requestedName.Name + extension);
try
{
if (!File.Exists(assemblyPath))
{
EqtTrace.Info("AssemblyResolver.OnResolve: {0}: Assembly path does not exist: '{1}', returning.", args.Name, assemblyPath);

continue;
}

AssemblyName foundName = this.platformAssemblyLoadContext.GetAssemblyNameFromPath(assemblyPath);

if (!this.RequestedAssemblyNameMatchesFound(requestedName, foundName))
{
EqtTrace.Info("AssemblyResolver.OnResolve: {0}: File exists but version/public key is wrong. Try next extension.", args.Name);

continue; // File exists but version/public key is wrong. Try next extension.
}

EqtTrace.Info("AssemblyResolver.OnResolve: {0}: Loading assembly '{1}'.", args.Name, assemblyPath);

assembly = this.platformAssemblyLoadContext.LoadAssemblyFromPath(assemblyPath);
this.resolvedAssemblies[args.Name] = assembly;

Expand All @@ -172,7 +181,7 @@ private Assembly OnResolve(object sender, AssemblyResolveEventArgs args)
}
catch (FileLoadException ex)
{
EqtTrace.Info("AssemblyResolver.OnResolve: {0}: Failed to load assembly. Reason:{1} ", args.Name, ex);
EqtTrace.Error("AssemblyResolver.OnResolve: {0}: Failed to load assembly. Reason:{1} ", args.Name, ex);

// Re-throw FileLoadException, because this exception means that the assembly
// was found, but could not be loaded. This will allow us to report a more
Expand Down