mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-06 10:17:37 +02:00
Add tests for webhook and fix some webhook bugs (#33396)
This PR created a mock webhook server in the tests and added integration tests for generic webhooks. It also fixes bugs in package webhooks and pull request comment webhooks.
This commit is contained in:
1 parent
256b94e9e9
commit
75940a0191
22 files changed
+630
-89
No files matched your search
@@ -24,6 +24,10 @@ import (
|
||||
webhook_module "code.gitea.io/gitea/modules/webhook"
|
||||
)
|
||||
|
||||
func init() {
|
||||
RegisterWebhookRequester(webhook_module.MATRIX, newMatrixRequest)
|
||||
}
|
||||
|
||||
func newMatrixRequest(_ context.Context, w *webhook_model.Webhook, t *webhook_model.HookTask) (*http.Request, []byte, error) {
|
||||
meta := &MatrixMeta{}
|
||||
if err := json.Unmarshal([]byte(w.Meta), meta); err != nil {
|
||||
|
||||
Reference in new issue
Block a user