MCPcopy Create free account
hub / github.com/ejoffe/spr / TestMatchPullRequestStack

Function TestMatchPullRequestStack

github/githubclient/client_test.go:13–530  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestMatchPullRequestStack(t *testing.T) {
14 tests := []struct {
15 name string
16 commits []git.Commit
17 prs fezzik_types.PullRequestConnection
18 expect []*github.PullRequest
19 }{
20 {
21 name: "ThirdCommitQueue",
22 commits: []git.Commit{
23 {CommitID: "00000001"},
24 {CommitID: "00000002"},
25 {CommitID: "00000003"},
26 },
27 prs: fezzik_types.PullRequestConnection{
28 Nodes: &fezzik_types.PullRequestsViewerPullRequestsNodes{
29 {
30 Id: "2",
31 HeadRefName: "spr/master/00000002",
32 BaseRefName: "master",
33 MergeQueueEntry: &fezzik_types.PullRequestsViewerPullRequestsNodesMergeQueueEntry{Id: "020"},
34 Commits: fezzik_types.PullRequestsViewerPullRequestsNodesCommits{
35 Nodes: &fezzik_types.PullRequestsViewerPullRequestsNodesCommitsNodes{
36 {
37 fezzik_types.PullRequestsViewerPullRequestsNodesCommitsNodesCommit{Oid: "1", MessageBody: "commit-id:1"},
38 },
39 {
40 fezzik_types.PullRequestsViewerPullRequestsNodesCommitsNodesCommit{Oid: "2", MessageBody: "commit-id:2"},
41 },
42 },
43 },
44 },
45 },
46 },
47 expect: []*github.PullRequest{
48 {
49 ID: "2",
50 FromBranch: "spr/master/00000002",
51 ToBranch: "master",
52 Commit: git.Commit{
53 CommitID: "00000002",
54 CommitHash: "2",
55 Body: "commit-id:2",
56 },
57 InQueue: true,
58 Commits: []git.Commit{
59 {CommitID: "1", CommitHash: "1", Body: "commit-id:1"},
60 {CommitID: "2", CommitHash: "2", Body: "commit-id:2"},
61 },
62 MergeStatus: github.PullRequestMergeStatus{
63 ChecksPass: github.CheckStatusPass,
64 },
65 },
66 },
67 },
68 {
69 name: "FourthCommitQueue",
70 commits: []git.Commit{

Callers

nothing calls this directly

Calls 1

matchPullRequestStackFunction · 0.85

Tested by

no test coverage detected