mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-05-04 05:28:06 +08:00
Troubleshoot
This commit is contained in:
26
packages/cache/__tests__/uploadUtils.test.ts
vendored
26
packages/cache/__tests__/uploadUtils.test.ts
vendored
@@ -1,8 +1,8 @@
|
||||
import {UploadProgress} from '../src/internal/uploadUtils'
|
||||
import * as uploadUtils from '../src/internal/uploadUtils'
|
||||
import {TransferProgressEvent} from '@azure/ms-rest-js'
|
||||
|
||||
test('upload progress tracked correctly', () => {
|
||||
const progress = new UploadProgress(1000)
|
||||
const progress = new uploadUtils.UploadProgress(1000)
|
||||
|
||||
expect(progress.contentLength).toBe(1000)
|
||||
expect(progress.sentBytes).toBe(0)
|
||||
@@ -56,3 +56,25 @@ test('upload progress tracked correctly', () => {
|
||||
expect(progress.getTransferredBytes()).toBe(1000)
|
||||
expect(progress.isDone()).toBe(true)
|
||||
})
|
||||
|
||||
// test('upload to azure blob storage is successful', () => {
|
||||
// const archivePath = 'path/to/archive.tzst'
|
||||
// const signedUploadURL = 'https://storage10.blob.core.windows.net/cache-container/3fe-60?se=2024-12-002T11%3A08%3A58Z&sv=2024-11-04'
|
||||
// const options: UploadOptions = {
|
||||
// useAzureSdk: true,
|
||||
// uploadChunkSize: 64 * 1024 * 1024,
|
||||
// uploadConcurrency: 8
|
||||
// }
|
||||
|
||||
// jest.spyOn(uploadUtils.UploadProgress.prototype, 'onProgress').mockImplementation(() => (progress: TransferProgressEvent) => {
|
||||
// return progress.loadedBytes
|
||||
// })
|
||||
|
||||
// jest.spyOn(uploadUtils.UploadProgress.prototype, 'onProgress').mockImplementation(() => (progress: TransferProgressEvent) => {
|
||||
// return progress.loadedBytes
|
||||
// })
|
||||
|
||||
// const response = uploadUtils.uploadCacheArchiveSDK(signedUploadURL, archivePath, options)
|
||||
|
||||
// expect(response).toBeInstanceOf(Promise)
|
||||
// })
|
||||
|
||||
Reference in New Issue
Block a user