From 49845a5239dfcb4638c6590a3f7c23a80552d85f Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 10 Jan 2022 15:22:47 +0400 Subject: [PATCH 1/3] [BEAM-13486] Added errorOutput to output tab --- .../editor/repository/code_repository/code_repository.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart b/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart index 15c4f405beb0..dc5547d4a724 100644 --- a/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart +++ b/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart @@ -138,13 +138,15 @@ class CodeRepository { case RunCodeStatus.finished: final responses = await Future.wait([ _client.getRunOutput(pipelineUuid, request), - _client.getLogOutput(pipelineUuid, request) + _client.getLogOutput(pipelineUuid, request), + _client.getRunErrorOutput(pipelineUuid, request) ]); final output = responses[0]; final log = responses[1]; + final error = responses[2]; return RunCodeResult( status: status, - output: prevOutput + output.output, + output: prevOutput + output.output + error.output, log: prevLog + log.output, ); default: From aaa468dc97a4d7d7b619e6d75dab5f217b737bd7 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 11 Jan 2022 21:05:39 +0400 Subject: [PATCH 2/3] [BEAM-13486] Fixed tests for code repository --- .../code_repository/code_repository_test.dart | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.dart b/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.dart index 3ab75a125ad8..df4c33c26df7 100644 --- a/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.dart +++ b/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.dart @@ -73,6 +73,9 @@ void main() { when(client.getCompileOutput(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kCompileOutputResponse, ); + when(client.getRunErrorOutput(kPipelineUuid, kRequestMock)).thenAnswer( + (_) async => kRunErrorOutputResponse, + ); when(client.getLogOutput(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kLogOutputResponse, ); @@ -91,7 +94,7 @@ void main() { ), RunCodeResult( status: RunCodeStatus.finished, - output: kRunOutput, + output: kRunOutput + kRunErrorOutput, log: kProcessingStartedText + kLogOutput, ), ]), @@ -115,6 +118,9 @@ void main() { when(client.getRunOutput(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kRunOutputResponse, ); + when(client.getRunErrorOutput(kPipelineUuid, kRequestMock)).thenAnswer( + (_) async => kRunErrorOutputResponse, + ); when(client.getLogOutput(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kLogOutputResponse, ); @@ -224,17 +230,17 @@ void main() { ), RunCodeResult( status: RunCodeStatus.executing, - output: kRunOutput, + output: kRunOutput + kRunErrorOutput, log: kProcessingStartedText + kLogOutput, ), RunCodeResult( status: RunCodeStatus.executing, - output: kRunOutput * 2, + output: (kRunOutput + kRunErrorOutput) * 2, log: kProcessingStartedText + kLogOutput * 2, ), RunCodeResult( status: RunCodeStatus.finished, - output: kRunOutput * 3, + output: (kRunOutput + kRunErrorOutput) * 3, log: kProcessingStartedText + kLogOutput * 3, ), ]), From 205589f84de83ccf143f3728a86273b755dcd765 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 12 Jan 2022 18:27:40 +0400 Subject: [PATCH 3/3] [BEAM-13486] Fixed runOutputError printing --- .../repository/code_repository/code_repository.dart | 11 +++++++++++ .../code_repository/code_repository_test.dart | 9 +++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart b/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart index dc5547d4a724..bc43571315b0 100644 --- a/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart +++ b/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart @@ -135,6 +135,17 @@ class CodeRepository { log: prevLog, ); case RunCodeStatus.executing: + final responses = await Future.wait([ + _client.getRunOutput(pipelineUuid, request), + _client.getLogOutput(pipelineUuid, request), + ]); + final output = responses[0]; + final log = responses[1]; + return RunCodeResult( + status: status, + output: prevOutput + output.output, + log: prevLog + log.output, + ); case RunCodeStatus.finished: final responses = await Future.wait([ _client.getRunOutput(pipelineUuid, request), diff --git a/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.dart b/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.dart index df4c33c26df7..8383043c30d1 100644 --- a/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.dart +++ b/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.dart @@ -118,9 +118,6 @@ void main() { when(client.getRunOutput(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kRunOutputResponse, ); - when(client.getRunErrorOutput(kPipelineUuid, kRequestMock)).thenAnswer( - (_) async => kRunErrorOutputResponse, - ); when(client.getLogOutput(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kLogOutputResponse, ); @@ -230,17 +227,17 @@ void main() { ), RunCodeResult( status: RunCodeStatus.executing, - output: kRunOutput + kRunErrorOutput, + output: kRunOutput, log: kProcessingStartedText + kLogOutput, ), RunCodeResult( status: RunCodeStatus.executing, - output: (kRunOutput + kRunErrorOutput) * 2, + output: kRunOutput * 2, log: kProcessingStartedText + kLogOutput * 2, ), RunCodeResult( status: RunCodeStatus.finished, - output: (kRunOutput + kRunErrorOutput) * 3, + output: kRunOutput * 3 + kRunErrorOutput, log: kProcessingStartedText + kLogOutput * 3, ), ]),