mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-08-16 11:06:00 +08:00
Fix tests
This commit is contained in:
parent
0e707aeabc
commit
5a0405df4e
2
packages/cache/__tests__/tar.test.ts
vendored
2
packages/cache/__tests__/tar.test.ts
vendored
@ -106,7 +106,7 @@ test('gzip extract GNU tar on windows with GNUtar in path', async () => {
|
|||||||
// GNU tar present in path but not at default location
|
// GNU tar present in path but not at default location
|
||||||
const isGnuMock = jest
|
const isGnuMock = jest
|
||||||
.spyOn(utils, 'getGnuTarPathOnWindows')
|
.spyOn(utils, 'getGnuTarPathOnWindows')
|
||||||
.mockReturnValue(Promise.resolve('C:\\Program Files\\gnutar\\tar.exe'))
|
.mockReturnValue(Promise.resolve('tar'))
|
||||||
const execMock = jest.spyOn(exec, 'exec')
|
const execMock = jest.spyOn(exec, 'exec')
|
||||||
const archivePath = `${process.env['windir']}\\fakepath\\cache.tar`
|
const archivePath = `${process.env['windir']}\\fakepath\\cache.tar`
|
||||||
const workspace = process.env['GITHUB_WORKSPACE']
|
const workspace = process.env['GITHUB_WORKSPACE']
|
||||||
|
2
packages/cache/src/internal/constants.ts
vendored
2
packages/cache/src/internal/constants.ts
vendored
@ -23,4 +23,4 @@ export const DefaultRetryDelay = 5000
|
|||||||
export const SocketTimeout = 5000
|
export const SocketTimeout = 5000
|
||||||
|
|
||||||
// The default path of GNUtar on hosted Windows runners
|
// The default path of GNUtar on hosted Windows runners
|
||||||
export const GnuTarPathOnWindows = 'C:\\Program Files\\Git\\usr\\bin\\tar.exe'
|
export const GnuTarPathOnWindows = 'C:\\Program Files\\Git\\usr\\bin\\tar.exe'
|
||||||
|
5
packages/cache/src/internal/tar.ts
vendored
5
packages/cache/src/internal/tar.ts
vendored
@ -7,10 +7,7 @@ import {CompressionMethod} from './constants'
|
|||||||
|
|
||||||
const IS_WINDOWS = process.platform === 'win32'
|
const IS_WINDOWS = process.platform === 'win32'
|
||||||
|
|
||||||
async function getTarPath(
|
async function getTarPath(args: string[]): Promise<string> {
|
||||||
args: string[],
|
|
||||||
compressionMethod: CompressionMethod
|
|
||||||
): Promise<string> {
|
|
||||||
let tarPath = await io.which('tar', true)
|
let tarPath = await io.which('tar', true)
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case 'win32': {
|
case 'win32': {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user