[
https://issues.apache.org/jira/browse/BEAM-13918?focusedWorklogId=747996&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-747996
]
ASF GitHub Bot logged work on BEAM-13918:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 25/Mar/22 20:55
Start Date: 25/Mar/22 20:55
Worklog Time Spent: 10m
Work Description: Abacn commented on a change in pull request #17173:
URL: https://github.com/apache/beam/pull/17173#discussion_r835604331
##########
File path: sdks/go/pkg/beam/io/datastoreio/datastore.go
##########
@@ -32,8 +32,20 @@ import (
"github.com/apache/beam/sdks/v2/go/pkg/beam/internal/errors"
"github.com/apache/beam/sdks/v2/go/pkg/beam/log"
"google.golang.org/api/iterator"
+ "google.golang.org/api/option"
)
+type clientType interface {
+ Run(context.Context, *datastore.Query) *datastore.Iterator
+ Close() error
+}
+
+// call to newClient returns an instance of datastore.Client
+// redirect this call for unit test usage
+var newClient = func(ctx context.Context, projectID string, opts
...option.ClientOption) (clientType, error) {
Review comment:
Thanks so much for the suggestions! If I understood correctly, does the
unit test then have to call the unexported `query` function directly, with a
(not nil) newClient function type pass in?
--
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: 747996)
Time Spent: 1h 40m (was: 1.5h)
> Increase unit testing coverage in the datastoreio package
> ---------------------------------------------------------
>
> Key: BEAM-13918
> URL: https://issues.apache.org/jira/browse/BEAM-13918
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-go
> Reporter: Jack McCluskey
> Assignee: Yi Hu
> Priority: P2
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
> Increase unit testing coverage in the [datastoreio
> package|https://github.com/apache/beam/tree/release-2.36.0/sdks/go/pkg/beam/io/datastoreio]
> We want code coverage at or above 50%, it is currently at 17.2%.
> This will involve mocking a datastore service.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)