{wip}
This commit is contained in:
parent
92747f0913
commit
c1df08dc59
11
workflow-pr/pr_processor_reviewed.go
Normal file
11
workflow-pr/pr_processor_reviewed.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "src.opensuse.org/autogits/common"
|
||||||
|
|
||||||
|
type PullRequestReviewed struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PullRequestReviewed) Process(req *common.PullRequestWebhookEvent, git common.Git, config *common.AutogitConfig) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
56
workflow-pr/pr_processor_reviewed_test.go
Normal file
56
workflow-pr/pr_processor_reviewed_test.go
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"src.opensuse.org/autogits/common"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestPRReviewed(t *testing.T) {
|
||||||
|
testData := []struct {
|
||||||
|
title string
|
||||||
|
error error
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
title: "forward project review",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
event := &common.PullRequestWebhookEvent{
|
||||||
|
Action: "reviewed",
|
||||||
|
Number: 1,
|
||||||
|
Pull_Request: &common.PullRequest{
|
||||||
|
Id: 1,
|
||||||
|
Base: common.Head{
|
||||||
|
Ref: "branch",
|
||||||
|
Sha: "testing",
|
||||||
|
Repo: &common.Repository{
|
||||||
|
Name: "testRepo",
|
||||||
|
Default_Branch: "main1",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Head: common.Head{
|
||||||
|
Ref: "branch",
|
||||||
|
Sha: "testing",
|
||||||
|
Repo: &common.Repository{
|
||||||
|
Name: "testRepo",
|
||||||
|
Default_Branch: "main1",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Repository: &common.Repository{
|
||||||
|
Owner: &common.Organization{
|
||||||
|
Username: "test",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, test := range testData {
|
||||||
|
t.Run(test.title, func(t *testing.T) {
|
||||||
|
s := PullRequestReviewed{}
|
||||||
|
if err := s.Process(event, nil, nil); err != test.error {
|
||||||
|
t.Error("unexected error:", err, "Expected:", test.error)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user