(t *testing.T)
| 47 | var timeout = (1 << 10) * test.Delay |
| 48 | |
| 49 | func TestCloudPubSub(t *testing.T) { //nolint:paralleltest |
| 50 | events.IncludeCaller = true |
| 51 | |
| 52 | taskStarter := task.StartTaskFunc(task.DefaultStartTask) |
| 53 | |
| 54 | test.RunSubtest(t, test.SubtestConfig{ |
| 55 | Name: "json", |
| 56 | Timeout: 10 * timeout, |
| 57 | Func: func(ctx context.Context, t *testing.T, a *assertions.Assertion) { |
| 58 | t.Helper() |
| 59 | pubsub, err := cloud.NewPubSub(ctx, taskStarter, "mem://json_events_test", "mem://json_events_test") |
| 60 | a.So(err, should.BeNil) |
| 61 | defer pubsub.Close(ctx) |
| 62 | cloud.SetContentType(pubsub, "application/json") |
| 63 | eventstest.TestBackend(ctx, t, a, pubsub) |
| 64 | }, |
| 65 | }) |
| 66 | |
| 67 | test.RunSubtest(t, test.SubtestConfig{ |
| 68 | Name: "protobuf", |
| 69 | Timeout: 10 * timeout, |
| 70 | Func: func(ctx context.Context, t *testing.T, a *assertions.Assertion) { |
| 71 | t.Helper() |
| 72 | pubsub, err := cloud.NewPubSub(ctx, taskStarter, "mem://protobuf_events_test", "mem://protobuf_events_test") |
| 73 | a.So(err, should.BeNil) |
| 74 | defer pubsub.Close(ctx) |
| 75 | cloud.SetContentType(pubsub, "application/protobuf") |
| 76 | eventstest.TestBackend(ctx, t, a, pubsub) |
| 77 | }, |
| 78 | }) |
| 79 | } |
nothing calls this directly
no test coverage detected