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

Function newHarness

pubsub/gcppubsubv2/gcppubsub_test.go:47–55  ·  view source on GitHub ↗
(ctx context.Context, t *testing.T)

Source from the content-addressed store, hash-verified

45}
46
47func newHarness(ctx context.Context, t *testing.T) (drivertest.Harness, error) {
48 t.Helper()
49
50 client, err := Client(ctx, projectID, nil)
51 if err != nil {
52 return nil, fmt.Errorf("making client: %v", err)
53 }
54 return &harness{closer: func() {}, client: client, numTopics: 0, numSubs: 0}, nil
55}
56
57func (h *harness) CreateTopic(ctx context.Context, testName string) (dt driver.Topic, cleanup func(), err error) {
58 topicName := fmt.Sprintf("%s-topic-%d", sanitize(testName), atomic.AddUint32(&h.numTopics, 1))

Callers

nothing calls this directly

Calls 1

ClientFunction · 0.85

Tested by

no test coverage detected