You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/01/10 15:59:49 UTC

[GitHub] [beam] KhaninArtur commented on a change in pull request #16469: [BEAM-13623][Playground] [Bugfix] During unit tests failing there is no any output

KhaninArtur commented on a change in pull request #16469:
URL: https://github.com/apache/beam/pull/16469#discussion_r781320645



##########
File path: playground/backend/internal/code_processing/code_processing.go
##########
@@ -189,8 +189,13 @@ func Process(ctx context.Context, cacheService cache.Cache, lc *fs_tool.LifeCycl
 		return
 	}
 	if !ok {
-		if runOutput.Error != nil {
-			runError.Write([]byte(runOutput.Error.Error()))
+		// If unit test has some error then error output is placed as RunOutput
+		if isUnitTest {
+			output, err := GetProcessingOutput(ctx, cacheService, pipelineId, cache.RunOutput, "")
+			if err == nil {
+				runError.Write([]byte(output))
+			}

Review comment:
       Don't we need to process this `err` if it is not `nil`?

##########
File path: playground/backend/internal/code_processing/code_processing.go
##########
@@ -189,8 +189,13 @@ func Process(ctx context.Context, cacheService cache.Cache, lc *fs_tool.LifeCycl
 		return
 	}
 	if !ok {
-		if runOutput.Error != nil {
-			runError.Write([]byte(runOutput.Error.Error()))
+		// If unit test has some error then error output is placed as RunOutput
+		if isUnitTest {

Review comment:
       Shouldn't we add an `else` case to do this?
   ```go
   if runOutput.Error != nil {
   	runError.Write([]byte(runOutput.Error.Error()))
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org