Skip to content

Commit

Permalink
(maint) stash/bitbucket on prem v5 add push webhook test (#257)
Browse files Browse the repository at this point in the history
Co-authored-by: dependabot-ci <[email protected]>
  • Loading branch information
TP Honey and dependabot-ci authored Jun 22, 2023
1 parent 5877f38 commit ad21d44
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 1 deletion.
44 changes: 44 additions & 0 deletions scm/driver/stash/testdata/webhooks/push_v5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"eventKey": "repo:refs_changed",
"date": "2023-05-30T15:40:47-0400",
"actor": {
"name": "trangineni",
"emailAddress": "[email protected]",
"id": 39725,
"displayName": "Rangineni, Tanuja",
"active": true,
"slug": "trangineni",
"type": "NORMAL"
},
"repository": {
"slug": "transamerica.cloud.individual.tftest",
"id": 13027,
"name": "transamerica.cloud.individual.tftest",
"scmId": "git",
"state": "AVAILABLE",
"statusMessage": "Available",
"forkable": true,
"project": {
"key": "ISCLOUD",
"id": 1453,
"name": "Individual Cloud",
"description": "Project for Individual Solutions application terraform.",
"public": false,
"type": "NORMAL"
},
"public": false
},
"changes": [
{
"ref": {
"id": "refs/heads/trangineni/devtfvars-1685475548410",
"displayId": "trangineni/devtfvars-1685475548410",
"type": "BRANCH"
},
"refId": "refs/heads/trangineni/devtfvars-1685475548410",
"fromHash": "b2b710209761a3fab9fc867aad7b7725fd0fd028",
"toHash": "51a33664b6d7fb5aa15063064eb230362cd02e9e",
"type": "UPDATE"
}
]
}
50 changes: 50 additions & 0 deletions scm/driver/stash/testdata/webhooks/push_v5.json.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"Ref": "refs/heads/trangineni/devtfvars-1685475548410",
"After": "51a33664b6d7fb5aa15063064eb230362cd02e9e",
"Before": "b2b710209761a3fab9fc867aad7b7725fd0fd028",
"Repo": {
"ID": "13027",
"Namespace": "ISCLOUD",
"Name": "transamerica.cloud.individual.tftest",
"Perm": null,
"Branch": "master",
"Private": true,
"Clone": "",
"CloneSSH": "",
"Link": "",
"Created": "0001-01-01T00:00:00Z",
"Updated": "0001-01-01T00:00:00Z"
},
"Commit": {
"Sha": "51a33664b6d7fb5aa15063064eb230362cd02e9e",
"Message": "",
"Author": {
"Name": "Rangineni, Tanuja",
"Email": "[email protected]",
"Date": "0001-01-01T00:00:00Z",
"Login": "trangineni",
"Avatar": "https://www.gravatar.com/avatar/1c0ba1559ee8ed291204dad48479149b.jpg"
},
"Committer": {
"Name": "Rangineni, Tanuja",
"Email": "[email protected]",
"Date": "0001-01-01T00:00:00Z",
"Login": "trangineni",
"Avatar": "https://www.gravatar.com/avatar/1c0ba1559ee8ed291204dad48479149b.jpg"
},
"Link": ""
},
"Commits": [
{
"Sha": "51a33664b6d7fb5aa15063064eb230362cd02e9e",
"Message": "",
"Link": ""
}
],
"Sender": {
"Login": "trangineni",
"Name": "Rangineni, Tanuja",
"Email": "[email protected]",
"Avatar": "https://www.gravatar.com/avatar/1c0ba1559ee8ed291204dad48479149b.jpg"
}
}
9 changes: 8 additions & 1 deletion scm/driver/stash/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ func TestWebhooks(t *testing.T) {
after: "testdata/webhooks/push.json.golden",
obj: new(scm.PushHook),
},

// v5 test
{
sig: "71295b197fa25f4356d2fb9965df3f2379d903d7",
event: "repo:refs_changed",
before: "testdata/webhooks/push_v5.json",
after: "testdata/webhooks/push_v5.json.golden",
obj: new(scm.PushHook),
},
//
// tag events
//
Expand Down

0 comments on commit ad21d44

Please sign in to comment.