From 74236358e6d0b931d4c036213eec65be014886d3 Mon Sep 17 00:00:00 2001 From: Dave Hadka Date: Fri, 9 Apr 2021 14:10:36 -0500 Subject: [PATCH] Update tests --- packages/cache/__tests__/tar.test.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/cache/__tests__/tar.test.ts b/packages/cache/__tests__/tar.test.ts index 3f7a1b3b..a62fa3d3 100644 --- a/packages/cache/__tests__/tar.test.ts +++ b/packages/cache/__tests__/tar.test.ts @@ -11,6 +11,7 @@ jest.mock('@actions/exec') jest.mock('@actions/io') const IS_WINDOWS = process.platform === 'win32' +const IS_MAC = process.platform === 'darwin' const defaultTarPath = process.platform === 'darwin' ? 'gtar' : 'tar' @@ -55,7 +56,8 @@ test('zstd extract tar', async () => { '-P', '-C', IS_WINDOWS ? workspace?.replace(/\\/g, '/') : workspace - ].concat(IS_WINDOWS ? ['--force-local'] : []), + ].concat(IS_WINDOWS ? ['--force-local'] : []) + .concat(IS_MAC ? ['--delay-directory-restore'] : []), {cwd: undefined} ) }) @@ -84,7 +86,7 @@ test('gzip extract tar', async () => { '-P', '-C', IS_WINDOWS ? workspace?.replace(/\\/g, '/') : workspace - ], + ].concat(IS_MAC ? ['--delay-directory-restore'] : []), {cwd: undefined} ) }) @@ -145,7 +147,8 @@ test('zstd create tar', async () => { IS_WINDOWS ? workspace?.replace(/\\/g, '/') : workspace, '--files-from', 'manifest.txt' - ].concat(IS_WINDOWS ? ['--force-local'] : []), + ].concat(IS_WINDOWS ? ['--force-local'] : []) + .concat(IS_MAC ? ['--delay-directory-restore'] : []), { cwd: archiveFolder } @@ -180,7 +183,7 @@ test('gzip create tar', async () => { IS_WINDOWS ? workspace?.replace(/\\/g, '/') : workspace, '--files-from', 'manifest.txt' - ], + ].concat(IS_MAC ? ['--delay-directory-restore'] : []), { cwd: archiveFolder } @@ -205,7 +208,8 @@ test('zstd list tar', async () => { '-tf', IS_WINDOWS ? archivePath.replace(/\\/g, '/') : archivePath, '-P' - ].concat(IS_WINDOWS ? ['--force-local'] : []), + ].concat(IS_WINDOWS ? ['--force-local'] : []) + .concat(IS_MAC ? ['--delay-directory-restore'] : []), {cwd: undefined} ) }) @@ -228,7 +232,8 @@ test('zstdWithoutLong list tar', async () => { '-tf', IS_WINDOWS ? archivePath.replace(/\\/g, '/') : archivePath, '-P' - ].concat(IS_WINDOWS ? ['--force-local'] : []), + ].concat(IS_WINDOWS ? ['--force-local'] : []) + .concat(IS_MAC ? ['--delay-directory-restore'] : []), {cwd: undefined} ) }) @@ -252,7 +257,7 @@ test('gzip list tar', async () => { '-tf', IS_WINDOWS ? archivePath.replace(/\\/g, '/') : archivePath, '-P' - ], + ].concat(IS_MAC ? ['--delay-directory-restore'] : []), {cwd: undefined} ) })