@@ -50,7 +50,7 @@ test('save with large cache outputs should fail', async () => {
50
50
const cachePaths = [ path . resolve ( filePath ) ]
51
51
52
52
const createTarMock = jest . spyOn ( tar , 'createTar' )
53
- const logWarningMock = jest . spyOn ( core , 'warning ' )
53
+ const logErrorMock = jest . spyOn ( core , 'error ' )
54
54
55
55
const cacheSize = 11 * 1024 * 1024 * 1024 //~11GB, over the 10GB limit
56
56
jest
@@ -63,8 +63,8 @@ test('save with large cache outputs should fail', async () => {
63
63
64
64
const cacheId = await saveCache ( [ filePath ] , primaryKey )
65
65
expect ( cacheId ) . toBe ( - 1 )
66
- expect ( logWarningMock ) . toHaveBeenCalledTimes ( 1 )
67
- expect ( logWarningMock ) . toHaveBeenCalledWith (
66
+ expect ( logErrorMock ) . toHaveBeenCalledTimes ( 1 )
67
+ expect ( logErrorMock ) . toHaveBeenCalledWith (
68
68
'Failed to save: Cache size of ~11264 MB (11811160064 B) is over the 10GB limit, not saving cache.'
69
69
)
70
70
@@ -85,7 +85,7 @@ test('save with large cache outputs should fail in GHES with error message', asy
85
85
const cachePaths = [ path . resolve ( filePath ) ]
86
86
87
87
const createTarMock = jest . spyOn ( tar , 'createTar' )
88
- const logWarningMock = jest . spyOn ( core , 'warning ' )
88
+ const logErrorMock = jest . spyOn ( core , 'error ' )
89
89
90
90
const cacheSize = 11 * 1024 * 1024 * 1024 //~11GB, over the 10GB limit
91
91
jest
@@ -115,8 +115,8 @@ test('save with large cache outputs should fail in GHES with error message', asy
115
115
116
116
const cacheId = await saveCache ( [ filePath ] , primaryKey )
117
117
expect ( cacheId ) . toBe ( - 1 )
118
- expect ( logWarningMock ) . toHaveBeenCalledTimes ( 1 )
119
- expect ( logWarningMock ) . toHaveBeenCalledWith (
118
+ expect ( logErrorMock ) . toHaveBeenCalledTimes ( 1 )
119
+ expect ( logErrorMock ) . toHaveBeenCalledWith (
120
120
'Failed to save: The cache filesize must be between 0 and 1073741824 bytes'
121
121
)
122
122
@@ -137,7 +137,7 @@ test('save with large cache outputs should fail in GHES without error message',
137
137
const cachePaths = [ path . resolve ( filePath ) ]
138
138
139
139
const createTarMock = jest . spyOn ( tar , 'createTar' )
140
- const logWarningMock = jest . spyOn ( core , 'warning ' )
140
+ const logErrorMock = jest . spyOn ( core , 'error ' )
141
141
142
142
const cacheSize = 11 * 1024 * 1024 * 1024 //~11GB, over the 10GB limit
143
143
jest
@@ -163,8 +163,8 @@ test('save with large cache outputs should fail in GHES without error message',
163
163
164
164
const cacheId = await saveCache ( [ filePath ] , primaryKey )
165
165
expect ( cacheId ) . toBe ( - 1 )
166
- expect ( logWarningMock ) . toHaveBeenCalledTimes ( 1 )
167
- expect ( logWarningMock ) . toHaveBeenCalledWith (
166
+ expect ( logErrorMock ) . toHaveBeenCalledTimes ( 1 )
167
+ expect ( logErrorMock ) . toHaveBeenCalledWith (
168
168
'Failed to save: Cache size of ~11264 MB (11811160064 B) is over the data cap limit, not saving cache.'
169
169
)
170
170
@@ -224,7 +224,7 @@ test('save with server error should fail', async () => {
224
224
const filePath = 'node_modules'
225
225
const primaryKey = 'Linux-node-bb828da54c148048dd17899ba9fda624811cfb43'
226
226
const cachePaths = [ path . resolve ( filePath ) ]
227
- const logWarningMock = jest . spyOn ( core , 'warning ' )
227
+ const logErrorMock = jest . spyOn ( core , 'error ' )
228
228
const cacheId = 4
229
229
const reserveCacheMock = jest
230
230
. spyOn ( cacheHttpClient , 'reserveCache' )
@@ -250,8 +250,8 @@ test('save with server error should fail', async () => {
250
250
. mockReturnValueOnce ( Promise . resolve ( compression ) )
251
251
252
252
await saveCache ( [ filePath ] , primaryKey )
253
- expect ( logWarningMock ) . toHaveBeenCalledTimes ( 1 )
254
- expect ( logWarningMock ) . toHaveBeenCalledWith (
253
+ expect ( logErrorMock ) . toHaveBeenCalledTimes ( 1 )
254
+ expect ( logErrorMock ) . toHaveBeenCalledWith (
255
255
'Failed to save: HTTP Error Occurred'
256
256
)
257
257
0 commit comments