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

Remove the proxy and create the concrete TestApplicationResult #3907

Merged
merged 2 commits into from
Oct 3, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,13 @@ public async Task<ITestHost> BuildAsync(
serviceProvider.AddService(nonCooperativeParentProcessListener);
}

// Add TestApplicationResultProxy
TestApplicationResultProxy testApplicationResultProxy = new();
serviceProvider.AddService(testApplicationResultProxy);
// Register the ITestApplicationResult
TestApplicationResult testApplicationResult = new(
platformOutputDevice,
serviceProvider.GetTestApplicationCancellationTokenSource(),
serviceProvider.GetCommandLineOptions(),
serviceProvider.GetEnvironment());
serviceProvider.AddService(testApplicationResult);

// ============= SETUP COMMON SERVICE USED IN ALL MODES END ===============//

Expand Down Expand Up @@ -728,17 +732,9 @@ private async Task<ITestFramework> BuildTestFrameworkAsync(TestFrameworkBuilderD
TestSessionLifetimeHandlersContainer testSessionLifetimeHandlersContainer = new(testSessionLifetimeHandlers);
serviceProvider.AddService(testSessionLifetimeHandlersContainer);

// Register the ITestApplicationResult
TestApplicationResult testApplicationResult = new(
testFrameworkBuilderData.PlatformOutputDisplayService,
serviceProvider.GetTestApplicationCancellationTokenSource(),
serviceProvider.GetCommandLineOptions(),
serviceProvider.GetEnvironment());

// Set the concrete TestApplicationResult
TestApplicationResultProxy testApplicationResultProxy = serviceProvider.GetRequiredService<TestApplicationResultProxy>();
testApplicationResultProxy.SetTestApplicationProcessExitCode(testApplicationResult);
await RegisterAsServiceOrConsumerOrBothAsync(testApplicationResultProxy, serviceProvider, dataConsumersBuilder);
// Allow the ITestApplicationProcessExitCode to subscribe as IDataConsumer
ITestApplicationProcessExitCode testApplicationResult = serviceProvider.GetRequiredService<ITestApplicationProcessExitCode>();
await RegisterAsServiceOrConsumerOrBothAsync(testApplicationResult, serviceProvider, dataConsumersBuilder);

// We register the data consumer handler if we're connected to the dotnet test pipe
if (pushOnlyProtocolDataConsumer is not null)
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,4 @@ Takes one argument as string in the format &lt;value&gt;[h|m|s] where 'value' is
<data name="MissingClientPortFoJsonRpc" xml:space="preserve">
<value>Expected --client-port when jsonRpc protocol is used.</value>
</data>
<data name="TestApplicationResultNotReady" xml:space="preserve">
<value>The ITestApplicationResult has not been built yet.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,6 @@ Platné hodnoty jsou Normal a Detailed. Výchozí hodnota je Normal.</target>
<target state="translated">Výsledek testovací aplikace</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationResultNotReady">
<source>The ITestApplicationResult has not been built yet.</source>
<target state="translated">ITestApplicationResult ještě není sestaveno.</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationVSTestModeTooManyBuilders">
<source>VSTest mode only supports a single TestApplicationBuilder per process</source>
<target state="translated">Režim VSTest podporuje jen jeden TestApplicationBuilder na proces.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,6 @@ Gültige Werte sind „Normal“, „Detailed“. Der Standardwert ist „Normal
<target state="translated">Testanwendungsergebnis</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationResultNotReady">
<source>The ITestApplicationResult has not been built yet.</source>
<target state="translated">Das ITestApplicationResult wurde noch nicht erstellt.</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationVSTestModeTooManyBuilders">
<source>VSTest mode only supports a single TestApplicationBuilder per process</source>
<target state="translated">Der VSTest-Modus unterstützt nur einen einzelnen TestApplicationBuilder pro Prozess.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,6 @@ Los valores válidos son 'Normal', 'Detallado'. El valor predeterminado es 'Norm
<target state="translated">Resultado de la aplicación de prueba</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationResultNotReady">
<source>The ITestApplicationResult has not been built yet.</source>
<target state="translated">ITestApplicationResult aún no se ha compilado.</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationVSTestModeTooManyBuilders">
<source>VSTest mode only supports a single TestApplicationBuilder per process</source>
<target state="translated">El modo VSTest solo admite un único TestApplicationBuilder por proceso</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,6 @@ Les valeurs valides sont « Normal » et « Détaillé ». La valeur par dé
<target state="translated">Résultat de l’application de test</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationResultNotReady">
<source>The ITestApplicationResult has not been built yet.</source>
<target state="translated">Désolé, ITestApplicationResult n’a pas encore été généré.</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationVSTestModeTooManyBuilders">
<source>VSTest mode only supports a single TestApplicationBuilder per process</source>
<target state="translated">Le mode VSTest ne prend en charge qu’un seul TestApplicationBuilder par processus</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,6 @@ I valori validi sono 'Normal', 'Detailed'. L'impostazione predefinita è 'Normal
<target state="translated">Risultato del test dell'applicazione</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationResultNotReady">
<source>The ITestApplicationResult has not been built yet.</source>
<target state="translated">ITestApplicationResult non è ancora stato compilato.</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationVSTestModeTooManyBuilders">
<source>VSTest mode only supports a single TestApplicationBuilder per process</source>
<target state="translated">La modalità VSTest supporta solo un singolo TestApplicationBuilder per processo</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -731,11 +731,6 @@ Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="translated">テスト アプリケーションの結果</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationResultNotReady">
<source>The ITestApplicationResult has not been built yet.</source>
<target state="translated">ITestApplicationResult はまだビルドされていません。</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationVSTestModeTooManyBuilders">
<source>VSTest mode only supports a single TestApplicationBuilder per process</source>
<target state="translated">VSTest モードは、プロセスごとに 1 つの TestApplicationBuilder のみをサポートします</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,6 @@ Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="translated">테스트 애플리케이션 결과</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationResultNotReady">
<source>The ITestApplicationResult has not been built yet.</source>
<target state="translated">ITestApplicationResult가 아직 빌드되지 않았습니다.</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationVSTestModeTooManyBuilders">
<source>VSTest mode only supports a single TestApplicationBuilder per process</source>
<target state="translated">VSTest 모드는 프로세스당 단일 TestApplicationBuilder만 지원합니다.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,6 @@ Prawidłowe wartości to „Normalne”, „Szczegółowe”. Wartość domyśln
<target state="translated">Wynik aplikacji testowej</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationResultNotReady">
<source>The ITestApplicationResult has not been built yet.</source>
<target state="translated">Obiekt ITestApplicationResult nie został jeszcze skompilowany.</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationVSTestModeTooManyBuilders">
<source>VSTest mode only supports a single TestApplicationBuilder per process</source>
<target state="translated">Tryb VSTest obsługuje tylko jeden element TestApplicationBuilder na proces</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,6 @@ Os valores válidos são “Normal”, “Detalhado”. O padrão é “Normal
<target state="translated">Resultado do aplicativo de teste</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationResultNotReady">
<source>The ITestApplicationResult has not been built yet.</source>
<target state="translated">O ITestApplicationResult ainda não foi criado.</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationVSTestModeTooManyBuilders">
<source>VSTest mode only supports a single TestApplicationBuilder per process</source>
<target state="translated">O modo VSTest dá suporte apenas a um único TestApplicationBuilder por processo</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,6 @@ Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="translated">Результат приложения для тестирования</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationResultNotReady">
<source>The ITestApplicationResult has not been built yet.</source>
<target state="translated">Объект ITestApplicationResult еще не создан.</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationVSTestModeTooManyBuilders">
<source>VSTest mode only supports a single TestApplicationBuilder per process</source>
<target state="translated">Режим VSTest поддерживает только один TestApplicationBuilder для каждого процесса</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,6 @@ Geçerli değerler: ‘Normal’, ‘Ayrıntılı’. Varsayılan değer: ‘Nor
<target state="translated">Test uygulaması sonucu</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationResultNotReady">
<source>The ITestApplicationResult has not been built yet.</source>
<target state="translated">ITestApplicationResult henüz oluşturulmadı.</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationVSTestModeTooManyBuilders">
<source>VSTest mode only supports a single TestApplicationBuilder per process</source>
<target state="translated">VSTest modu, işlem başına yalnızca tek bir TestApplicationBuilder destekler</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,6 @@ Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="translated">测试应用程序结果</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationResultNotReady">
<source>The ITestApplicationResult has not been built yet.</source>
<target state="translated">尚未生成 ITestApplicationResult。</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationVSTestModeTooManyBuilders">
<source>VSTest mode only supports a single TestApplicationBuilder per process</source>
<target state="translated">VSTest 模式仅支持每个进程一个 TestApplicationBuilder</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,6 @@ Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="translated">測試應用程式結果</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationResultNotReady">
<source>The ITestApplicationResult has not been built yet.</source>
<target state="translated">尚未建置 ITestApplicationResult。</target>
<note />
</trans-unit>
<trans-unit id="TestApplicationVSTestModeTooManyBuilders">
<source>VSTest mode only supports a single TestApplicationBuilder per process</source>
<target state="translated">VSTest 模式僅支援每一程序的單一 TestApplicationBuilder</target>
Expand Down

This file was deleted.

Loading