createTestProject creates a fresh project (default AllowSelfApproval=true; approval-flow subtests call disableSelfApproval).
(ctx context.Context, t *testing.T, prefix string)
| 110 | // createTestProject creates a fresh project (default AllowSelfApproval=true; |
| 111 | // approval-flow subtests call disableSelfApproval). |
| 112 | func (ctl *controller) createTestProject(ctx context.Context, t *testing.T, prefix string) *v1pb.Project { |
| 113 | t.Helper() |
| 114 | pid := generateRandomString(prefix) |
| 115 | resp, err := ctl.projectServiceClient.CreateProject(ctx, connect.NewRequest(&v1pb.CreateProjectRequest{ |
| 116 | ProjectId: pid, |
| 117 | Project: &v1pb.Project{ |
| 118 | Name: fmt.Sprintf("projects/%s", pid), |
| 119 | Title: prefix, |
| 120 | AllowSelfApproval: true, |
| 121 | }, |
| 122 | })) |
| 123 | require.NoError(t, err) |
| 124 | return resp.Msg |
| 125 | } |
| 126 | |
| 127 | // addWebhookForEvents adds a Slack webhook to the project subscribed to the |
| 128 | // given event types only. |
no test coverage detected