@@ -19,8 +19,8 @@ describe(`Cursor Deploy Action`, () => {
19
19
And the tree hash used is the current repo tree hash
20
20
` ,
21
21
async ( ) => {
22
- const treeHash = 'b017ebdf289ba78787da4e9c3291f0b7959e7059'
23
- mockedUtils . getCurrentRepoTreeHash . mockResolvedValue ( treeHash )
22
+ const deployHash = 'b017ebdf289ba78787da4e9c3291f0b7959e7059'
23
+ mockedUtils . readFileFromS3 . mockResolvedValue ( deployHash )
24
24
mockedUtils . fileExistsInS3 . mockResolvedValue ( false )
25
25
26
26
const output = await cursorDeploy ( {
@@ -33,13 +33,13 @@ describe(`Cursor Deploy Action`, () => {
33
33
expectRollbackFileChecked ( 'my-bucket' , 'rollbacks/main' )
34
34
35
35
expectCursorFileUpdated ( {
36
- treeHash : treeHash ,
36
+ deployHash : deployHash ,
37
37
branch : 'main' ,
38
38
bucket : 'my-bucket' ,
39
39
key : 'deploys/main'
40
40
} )
41
41
42
- expect ( output . treeHash ) . toBe ( treeHash )
42
+ expect ( output . deployHash ) . toBe ( deployHash )
43
43
expect ( output . branchLabel ) . toBe ( 'main' )
44
44
}
45
45
)
@@ -53,9 +53,9 @@ describe(`Cursor Deploy Action`, () => {
53
53
And the tree hash used is the current repo tree hash
54
54
` ,
55
55
async ( ) => {
56
- const treeHash = '553b0cb96ac21ffc0583e5d8d72343b1faa90dfd'
56
+ const deployHash = '553b0cb96ac21ffc0583e5d8d72343b1faa90dfd'
57
57
const sanitizedBranch = 'lol-my-feature-branch-30-better'
58
- mockedUtils . getCurrentRepoTreeHash . mockResolvedValue ( treeHash )
58
+ mockedUtils . readFileFromS3 . mockResolvedValue ( deployHash )
59
59
mockedUtils . fileExistsInS3 . mockResolvedValue ( false )
60
60
61
61
const output = await cursorDeploy ( {
@@ -68,13 +68,13 @@ describe(`Cursor Deploy Action`, () => {
68
68
expectRollbackFileChecked ( 'my-bucket' , 'rollbacks/lol-my-feature-branch-30-better' )
69
69
70
70
expectCursorFileUpdated ( {
71
- treeHash : treeHash ,
71
+ deployHash : deployHash ,
72
72
branch : sanitizedBranch ,
73
73
bucket : 'my-bucket' ,
74
74
key : 'deploys/lol-my-feature-branch-30-better'
75
75
} )
76
76
77
- expect ( output . treeHash ) . toBe ( treeHash )
77
+ expect ( output . deployHash ) . toBe ( deployHash )
78
78
expect ( output . branchLabel ) . toBe ( sanitizedBranch )
79
79
}
80
80
)
@@ -87,8 +87,8 @@ describe(`Cursor Deploy Action`, () => {
87
87
And the action returns a error
88
88
` ,
89
89
async ( ) => {
90
- const treeHash = 'b017ebdf289ba78787da4e9c3291f0b7959e7059'
91
- mockedUtils . getCurrentRepoTreeHash . mockResolvedValue ( treeHash )
90
+ const deployHash = 'b017ebdf289ba78787da4e9c3291f0b7959e7059'
91
+ mockedUtils . readFileFromS3 . mockResolvedValue ( deployHash )
92
92
mockedUtils . fileExistsInS3 . mockResolvedValue ( true )
93
93
94
94
const promise = cursorDeploy ( {
@@ -121,7 +121,7 @@ describe(`Cursor Deploy Action`, () => {
121
121
const currentTreeHash = 'b017ebdf289ba78787da4e9c3291f0b7959e7059'
122
122
const commitTreeHash = '32439d157a7e346d117a6a3c47d511526bd45012'
123
123
124
- mockedUtils . getCurrentRepoTreeHash . mockResolvedValue ( currentTreeHash )
124
+ mockedUtils . readFileFromS3 . mockResolvedValue ( currentTreeHash )
125
125
mockedUtils . fileExistsInS3 . mockResolvedValue ( false )
126
126
mockedUtils . getTreeHashForCommitHash . mockResolvedValue ( commitTreeHash )
127
127
@@ -155,7 +155,7 @@ describe(`Cursor Deploy Action`, () => {
155
155
key : 'rollbacks/main'
156
156
} )
157
157
158
- expect ( output . treeHash ) . toBe ( commitTreeHash )
158
+ expect ( output . deployHash ) . toBe ( commitTreeHash )
159
159
expect ( output . branchLabel ) . toBe ( 'main' )
160
160
}
161
161
)
@@ -172,7 +172,7 @@ describe(`Cursor Deploy Action`, () => {
172
172
const commitTreeHash = 'b6e1c0468f4705b8cd0f18a04cd28ef7b9da7425'
173
173
const commitHash = 'fc24d309398cbf6d53237e05e4d2a8cd2de57cc7'
174
174
175
- mockedUtils . getCurrentRepoTreeHash . mockResolvedValue ( currentTreeHash )
175
+ mockedUtils . readFileFromS3 . mockResolvedValue ( currentTreeHash )
176
176
mockedUtils . fileExistsInS3 . mockResolvedValue ( false )
177
177
mockedUtils . isHeadAncestor . mockResolvedValue ( true )
178
178
mockedUtils . getTreeHashForCommitHash . mockResolvedValue ( commitTreeHash )
@@ -207,7 +207,7 @@ describe(`Cursor Deploy Action`, () => {
207
207
key : 'rollbacks/main'
208
208
} )
209
209
210
- expect ( output . treeHash ) . toBe ( commitTreeHash )
210
+ expect ( output . deployHash ) . toBe ( commitTreeHash )
211
211
expect ( output . branchLabel ) . toBe ( 'main' )
212
212
}
213
213
)
@@ -221,9 +221,9 @@ describe(`Cursor Deploy Action`, () => {
221
221
And the tree hash used is the tree hash of the passed commit hash
222
222
` ,
223
223
async ( ) => {
224
- const treeHash = 'b017ebdf289ba78787da4e9c3291f0b7959e7059'
224
+ const deployHash = 'b017ebdf289ba78787da4e9c3291f0b7959e7059'
225
225
226
- mockedUtils . getCurrentRepoTreeHash . mockResolvedValue ( treeHash )
226
+ mockedUtils . readFileFromS3 . mockResolvedValue ( deployHash )
227
227
mockedUtils . fileExistsInS3 . mockResolvedValue ( true )
228
228
mockedUtils . isHeadAncestor . mockResolvedValue ( true )
229
229
@@ -237,7 +237,7 @@ describe(`Cursor Deploy Action`, () => {
237
237
expectRollbackFileChecked ( 'my-bucket' , 'rollbacks/main' )
238
238
239
239
expectCursorFileUpdated ( {
240
- treeHash : treeHash ,
240
+ deployHash : deployHash ,
241
241
branch : 'main' ,
242
242
bucket : 'my-bucket' ,
243
243
key : 'deploys/main'
@@ -248,7 +248,7 @@ describe(`Cursor Deploy Action`, () => {
248
248
key : 'rollbacks/main'
249
249
} )
250
250
251
- expect ( output . treeHash ) . toBe ( treeHash )
251
+ expect ( output . deployHash ) . toBe ( deployHash )
252
252
expect ( output . branchLabel ) . toBe ( 'main' )
253
253
}
254
254
)
@@ -286,7 +286,7 @@ describe(`Cursor Deploy Action`, () => {
286
286
const commitHash = 'fc24d309398cbf6d53237e05e4d2a8cd2de57cc7'
287
287
const commitTreeHash = 'b6e1c0468f4705b8cd0f18a04cd28ef7b9da7425'
288
288
289
- mockedUtils . getCurrentRepoTreeHash . mockResolvedValue ( currentTreeHash )
289
+ mockedUtils . readFileFromS3 . mockResolvedValue ( currentTreeHash )
290
290
mockedUtils . fileExistsInS3 . mockResolvedValue ( false )
291
291
mockedUtils . isHeadAncestor . mockResolvedValue ( false )
292
292
mockedUtils . getTreeHashForCommitHash . mockResolvedValue ( commitTreeHash )
@@ -370,14 +370,14 @@ describe('Branch Sanitize - branchNameToHostnameLabel', () => {
370
370
//#region Custom Assertions
371
371
372
372
function expectCursorFileUpdated ( args : {
373
- treeHash : string
373
+ deployHash : string
374
374
branch : string
375
375
bucket : string
376
376
key : string
377
377
} ) {
378
378
expect ( mockedUtils . writeLineToFile ) . toHaveBeenCalledTimes ( 1 )
379
379
expect ( mockedUtils . writeLineToFile ) . toHaveBeenCalledWith ( {
380
- text : args . treeHash ,
380
+ text : args . deployHash ,
381
381
path : args . branch
382
382
} )
383
383
0 commit comments