[ 
https://issues.apache.org/jira/browse/BEAM-11218?focusedWorklogId=640460&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-640460
 ]

ASF GitHub Bot logged work on BEAM-11218:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 21/Aug/21 15:16
            Start Date: 21/Aug/21 15:16
    Worklog Time Spent: 10m 
      Work Description: 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 640460)
    Time Spent: 40m  (was: 0.5h)

> ptest allows to obtain a pipeline result
> ----------------------------------------
>
>                 Key: BEAM-11218
>                 URL: https://issues.apache.org/jira/browse/BEAM-11218
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-go
>            Reporter: Kamil Wasilewski
>            Assignee: Ritesh Ghorse
>            Priority: P3
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> ptest should allow to obtain a pipeline result, which would enable using 
> metrics in testing scenarios. This can be done either by adding a new 
> endpoint (e.g. `ptest.RunWithMetrics`) or replacing the existing `ptest.Run` 
> with a new version.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to