8000 Remove useless await in getCacheDistributor calls · dhvcc/setup-python@422c071 · GitHub
[go: up one dir, main page]

Skip to content

Commit 422c071

Browse files
committed
Remove useless await in getCacheDistributor calls
1 parent 7885ec3 commit 422c071

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

__tests__/cache-restore.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py
2727
let debugSpy: jest.SpyInstance;
2828
let saveSatetSpy: jest.SpyInstance;
2929
let getStateSpy: jest.SpyInstance;
30+
let setOutputSpy: jest.SpyInstance;
3031

3132
// cache spy
3233
let restoreCacheSpy: jest.SpyInstance;
@@ -64,6 +65,9 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py
6465
return {stdout: '', stderr: 'Error occured', exitCode: 2};
6566
});
6667

68+
setOutputSpy = jest.spyOn(core, 'setOutput');
69+
setOutputSpy.mockImplementation(input => undefined);
70+
6771
restoreCacheSpy = jest.spyOn(cache, 'restoreCache');
6872
restoreCacheSpy.mockImplementation(
6973
(cachePaths: string[], primaryKey: string, restoreKey?: string) => {
@@ -100,7 +104,7 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py
100104
])(
101105
'restored dependencies for %s by primaryKey',
102106
async (packageManager, pythonVersion, dependencyFile, fileHash) => {
103-
const cacheDistributor = await getCacheDistributor(
107+
const cacheDistributor = getCacheDistributor(
104108
packageManager,
105109
pythonVersion,
106110
dependencyFile
@@ -126,7 +130,7 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py
126130
dependencyFile,
127131
cacheDependencyPath
128132
) => {
129-
const cacheDistributor = await getCacheDistributor(
133+
const cacheDistributor = getCacheDistributor(
130134
packageManager,
131135
pythonVersion,
132136
dependencyFile
@@ -162,7 +166,7 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py
162166
return primaryKey !== fileHash && restoreKey ? pipFileLockHash : '';
163167
}
164168
);
165-
const cacheDistributor = await getCacheDistributor(
169+
const cacheDistributor = getCacheDistributor(
166170
packageManager,
167171
pythonVersion,
168172
dependencyFile

0 commit comments

Comments
 (0)
0