You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`the lock was not claimed as it is owned by octocat`
765
+
)
766
+
})
767
+
768
+
test('checks a lock and finds that it is from another owner and that no reason was set - it was a lock for the production environment and sticky is set to false',async()=>{
`the lock was not claimed as it is owned by octocat`
799
+
)
800
+
})
801
+
731
802
test('Determines that the lock request is coming from current owner of the lock (GLOBAL lock) and exits - sticky',async()=>{
732
803
context.actor='octocat'
733
804
context.payload.comment.body='.lock --global'
@@ -967,9 +1038,9 @@ test('successfully obtains a deployment lock (sticky) by creating the branch and
967
1038
)
968
1039
})
969
1040
970
-
test('successfully obtains a deployment lock (sticky) by creating the branch and lock file with a --reason',async()=>{
1041
+
test('successfully obtains a deployment lock (sticky) by creating the branch and lock file with a --reason and assuming a null environment to start (but it is production)',async()=>{
971
1042
context.payload.comment.body='.lock --reason because something is broken'
Copy file name to clipboardExpand all lines: __tests__/functions/post-deploy-message.test.js
+23-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ import {postDeployMessage} from '../../src/functions/post-deploy-message'
2
2
import*ascorefrom'@actions/core'
3
3
importdedentfrom'dedent-js'
4
4
5
-
// const debugMock = jest.spyOn(core, 'debug')
5
+
constdebugMock=jest.spyOn(core,'debug')
6
6
7
7
varcontext
8
8
varenvironment
@@ -124,6 +124,28 @@ test('successfully constructs a post deploy message with the defaults during a d
124
124
)
125
125
})
126
126
127
+
test('successfully constructs a post deploy message with the defaults during a deployment with an unknown status and the DEPLOY_MESSAGE_PATH is unset',async()=>{
128
+
process.env.INPUT_DEPLOY_MESSAGE_PATH=''
129
+
expect(
130
+
awaitpostDeployMessage(
131
+
context,// context
132
+
environment,// environment
133
+
environment_url,// environment_url
134
+
'unknown',// status
135
+
noop,// noop
136
+
ref,// ref
137
+
approved_reviews_count// approved_reviews_count
138
+
)
139
+
).toStrictEqual(
140
+
dedent(`
141
+
### Deployment Results ⚠️
142
+
143
+
Warning: deployment status is unknown, please use caution`)
144
+
)
145
+
146
+
expect(debugMock).toHaveBeenCalledWith('deployMessagePath is not set - null')
147
+
})
148
+
127
149
test('successfully constructs a post deploy message with a custom env var',async()=>{
128
150
process.env.DEPLOY_MESSAGE='Deployed 1 shiny new server'
0 commit comments