MCPcopy Create free account
hub / github.com/cli/cli / TestRunWithWorkflowAndCommit

Function TestRunWithWorkflowAndCommit

pkg/cmd/run/shared/test.go:25–46  ·  view source on GitHub ↗
(workflowId, runId int64, s Status, c Conclusion, commit string)

Source from the content-addressed store, hash-verified

23}
24
25func TestRunWithWorkflowAndCommit(workflowId, runId int64, s Status, c Conclusion, commit string) Run {
26 return Run{
27 WorkflowID: workflowId,
28 ID: runId,
29 CreatedAt: TestRunStartTime,
30 UpdatedAt: TestRunStartTime.Add(time.Minute*4 + time.Second*34),
31 Status: s,
32 Conclusion: c,
33 Event: "push",
34 HeadBranch: "trunk",
35 JobsURL: fmt.Sprintf("https://api.github.com/runs/%d/jobs", runId),
36 HeadCommit: Commit{
37 Message: commit,
38 },
39 HeadSha: "1234567890",
40 URL: fmt.Sprintf("https://github.com/runs/%d", runId),
41 HeadRepository: Repo{
42 Owner: struct{ Login string }{Login: "OWNER"},
43 Name: "REPO",
44 },
45 }
46}
47
48var SuccessfulRun Run = TestRun(3, Completed, Success)
49var FailedRun Run = TestRun(1234, Completed, Failure)

Callers 2

TestRunWithCommitFunction · 0.85

Calls 1

AddMethod · 0.65

Tested by

no test coverage detected