MCPcopy Index your code
hub / github.com/bytebase/bytebase / createGitOpsVCSUserTestProject

Function createGitOpsVCSUserTestProject

backend/tests/gitops_test.go:587–600  ·  view source on GitHub ↗
(ctx context.Context, t *testing.T, ctl *controller)

Source from the content-addressed store, hash-verified

585}
586
587func createGitOpsVCSUserTestProject(ctx context.Context, t *testing.T, ctl *controller) *v1pb.Project {
588 t.Helper()
589 projectID := generateRandomString("gitops-vcs-user")
590 projectResp, err := ctl.projectServiceClient.CreateProject(ctx, connect.NewRequest(&v1pb.CreateProjectRequest{
591 Project: &v1pb.Project{
592 Name: fmt.Sprintf("projects/%s", projectID),
593 Title: projectID,
594 AllowSelfApproval: true,
595 },
596 ProjectId: projectID,
597 }))
598 require.NoError(t, err)
599 return projectResp.Msg
600}
601
602func createGitOpsVCSUserTestTarget(ctx context.Context, t *testing.T, ctl *controller, project *v1pb.Project) string {
603 t.Helper()

Calls 2

generateRandomStringFunction · 0.85
CreateProjectMethod · 0.65

Tested by

no test coverage detected