MCPcopy Create free account
hub / github.com/GoogleChrome/webstatus.dev / createTestSubscription

Function createTestSubscription

lib/gcppubsub/client_test.go:144–157  ·  view source on GitHub ↗
(t *testing.T, topicID, subID string, seconds int32)

Source from the content-addressed store, hash-verified

142}
143
144func createTestSubscription(t *testing.T, topicID, subID string, seconds int32) {
145 ctx := context.Background()
146 topicName := fmt.Sprintf("projects/%s/topics/%s", testProjectID, topicID)
147 // nolint:exhaustruct // WONTFIX: external struct
148 subpb := &pubsubpb.Subscription{
149 Name: fmt.Sprintf("projects/%s/subscriptions/%s", testProjectID, subID),
150 Topic: topicName,
151 AckDeadlineSeconds: seconds,
152 }
153 _, err := pubsubClient.client.SubscriptionAdminClient.CreateSubscription(ctx, subpb)
154 if err != nil {
155 t.Fatalf("failed to create subscription: %v", err)
156 }
157}
158
159type handlerDetails struct {
160 id string

Callers 2

TestPublishAndSubscribeFunction · 0.85

Calls 1

CreateSubscriptionMethod · 0.45

Tested by

no test coverage detected