From 13b027cad9fe1e4ba3ea616836dbfbc0b7ae7d1e Mon Sep 17 00:00:00 2001 From: Sampark Sharma Date: Tue, 3 Jan 2023 09:35:30 +0000 Subject: [PATCH] Fix tests --- packages/cache/src/cache.ts | 6 ++---- packages/cache/src/internal/cacheHttpClient.ts | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/cache/src/cache.ts b/packages/cache/src/cache.ts index 5180532d..072497cf 100644 --- a/packages/cache/src/cache.ts +++ b/packages/cache/src/cache.ts @@ -4,7 +4,6 @@ import * as utils from './internal/cacheUtils' import * as cacheHttpClient from './internal/cacheHttpClient' import {createTar, extractTar, listTar} from './internal/tar' import {DownloadOptions, UploadOptions} from './options' -import {CompressionMethod} from './internal/constants' import {ArtifactCacheEntry} from './internal/contracts' export class ValidationError extends Error { @@ -89,12 +88,11 @@ export async function restoreCache( checkKey(key) } - let cacheEntry: ArtifactCacheEntry | null - let compressionMethod = await utils.getCompressionMethod() + const compressionMethod = await utils.getCompressionMethod() let archivePath = '' try { // path are needed to compute version - cacheEntry = await cacheHttpClient.getCacheEntry(keys, paths, { + const cacheEntry = await cacheHttpClient.getCacheEntry(keys, paths, { compressionMethod, enableCrossOsArchive }) diff --git a/packages/cache/src/internal/cacheHttpClient.ts b/packages/cache/src/internal/cacheHttpClient.ts index 0f5903f2..87ad735f 100644 --- a/packages/cache/src/internal/cacheHttpClient.ts +++ b/packages/cache/src/internal/cacheHttpClient.ts @@ -79,7 +79,9 @@ export function getCacheVersion( const components = paths .concat([!compressionMethod ? '' : compressionMethod]) .concat( - process.platform !== 'win32' || enableCrossOsArchive ? [] : ['windows-only'] + process.platform !== 'win32' || enableCrossOsArchive + ? [] + : ['windows-only'] ) // Only check for windows platforms if enableCrossOsArchive is false // Add salt to cache version to support breaking changes in cache entry