MCPcopy Create free account
hub / github.com/google/go-cloud / newHarness

Function newHarness

pubsub/gcppubsub/gcppubsub_test.go:48–61  ·  view source on GitHub ↗
(ctx context.Context, t *testing.T)

Source from the content-addressed store, hash-verified

46}
47
48func newHarness(ctx context.Context, t *testing.T) (drivertest.Harness, error) {
49 t.Helper()
50
51 conn, done := setup.NewGCPgRPCConn(ctx, t, endPoint, "pubsub")
52 pubClient, err := PublisherClient(ctx, conn)
53 if err != nil {
54 return nil, fmt.Errorf("making publisher client: %v", err)
55 }
56 subClient, err := SubscriberClient(ctx, conn)
57 if err != nil {
58 return nil, fmt.Errorf("making subscription client: %v", err)
59 }
60 return &harness{closer: done, pubClient: pubClient, subClient: subClient, numTopics: 0, numSubs: 0}, nil
61}
62
63func (h *harness) CreateTopic(ctx context.Context, testName string) (dt driver.Topic, cleanup func(), err error) {
64 // We may encounter topics that were created by a previous test run and were

Callers

nothing calls this directly

Calls 3

NewGCPgRPCConnFunction · 0.92
PublisherClientFunction · 0.85
SubscriberClientFunction · 0.85

Tested by

no test coverage detected