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 2021/08/21 15:16:30 UTC

[GitHub] [beam] lostluck commented on a change in pull request #15364: [BEAM-11218] ptest allows to obtain a pipeline result

lostluck commented on a change in pull request #15364:
URL: https://github.com/apache/beam/pull/15364#discussion_r693365913



##########
File path: sdks/go/pkg/beam/testing/ptest/ptest.go
##########
@@ -81,6 +81,15 @@ func Run(p *beam.Pipeline) error {
 	return err
 }
 
+// RunWithMetrics runs a pipeline for testing with that returns metrics.Results
+// in the form of Pipeline Result
+func RunWithMetrics(p *beam.Pipeline) (beam.PipelineResult, error) {
+	if *Runner == "" {
+		*Runner = defaultRunner
+	}
+	return beam.Run(context.Background(), *Runner, p)
+}
+
 // RunAndValidate runs a pipeline for testing and validates the result, failing
 // the test if the pipeline fails.
 func RunAndValidate(t *testing.T, p *beam.Pipeline) {

Review comment:
       Consider changing this function to return the PipelineResults as well.

##########
File path: sdks/go/pkg/beam/runners/direct/direct.go
##########
@@ -76,8 +76,26 @@ func Execute(ctx context.Context, p *beam.Pipeline) (beam.PipelineResult, error)
 	}
 	// TODO(lostluck) 2020/01/24: What's the right way to expose the
 	// metrics store for the direct runner?

Review comment:
       We can remove this todo




-- 
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