Skip to content

Commit c7a93de

Browse files
resolve SymbolicLink (#809)
1 parent 3405007 commit c7a93de

File tree

5 files changed

+23
-0
lines changed

5 files changed

+23
-0
lines changed

__tests__/cache-utils.test.ts

+18
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ describe('cache-utils', () => {
2323
let isFeatureAvailable: jest.SpyInstance;
2424
let info: jest.SpyInstance;
2525
let warningSpy: jest.SpyInstance;
26+
let fsRealPathSyncSpy: jest.SpyInstance;
2627

2728
beforeEach(() => {
29+
console.log('::stop-commands::stoptoken');
2830
process.env['GITHUB_WORKSPACE'] = path.join(__dirname, 'data');
2931
debugSpy = jest.spyOn(core, 'debug');
3032
debugSpy.mockImplementation(msg => {});
@@ -35,8 +37,24 @@ describe('cache-utils', () => {
3537
isFeatureAvailable = jest.spyOn(cache, 'isFeatureAvailable');
3638

3739
getCommandOutputSpy = jest.spyOn(utils, 'getCommandOutput');
40+
41+
fsRealPathSyncSpy = jest.spyOn(fs, 'realpathSync');
42+
fsRealPathSyncSpy.mockImplementation(dirName => {
43+
return dirName;
44+
});
45+
});
46+
47+
afterEach(() => {
48+
jest.resetAllMocks();
49+
jest.clearAllMocks();
50+
//jest.restoreAllMocks();
3851
});
3952

53+
afterAll(async () => {
54+
console.log('::stoptoken::');
55+
jest.restoreAllMocks();
56+
}, 100000);
57+
4058
describe('getPackageManagerInfo', () => {
4159
it.each<[string, PackageManagerInfo | null]>([
4260
['npm', utils.supportedPackageManagers.npm],

__tests__/nightly-installer.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ describe('setup-node', () => {
9595
res = <INodeVersion[]>nodeTestDistRc;
9696
} else if (url.includes('/nightly')) {
9797
res = <INodeVersion[]>nodeTestDistNightly;
98+
} else if (url.includes('/v8-canary')) {
99+
res = <INodeVersion[]>nodeV8CanaryTestDist;
98100
} else {
99101
res = <INodeVersion[]>nodeTestDist;
100102
}

dist/cache-save/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -60556,6 +60556,7 @@ const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __
6055660556
const existingDirectories = cacheDependenciesPaths
6055760557
.map(path_1.default.dirname)
6055860558
.filter(util_1.unique())
60559+
.map(dirName => fs_1.default.realpathSync(dirName))
6055960560
.filter(directory => fs_1.default.lstatSync(directory).isDirectory());
6056060561
if (!existingDirectories.length)
6056160562
core.warning(`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`);

dist/setup/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -71343,6 +71343,7 @@ const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __
7134371343
const existingDirectories = cacheDependenciesPaths
7134471344
.map(path_1.default.dirname)
7134571345
.filter(util_1.unique())
71346+
.map(dirName => fs_1.default.realpathSync(dirName))
7134671347
.filter(directory => fs_1.default.lstatSync(directory).isDirectory());
7134771348
if (!existingDirectories.length)
7134871349
core.warning(`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`);

src/cache-utils.ts

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ const getProjectDirectoriesFromCacheDependencyPath = async (
144144
const existingDirectories: string[] = cacheDependenciesPaths
145145
.map(path.dirname)
146146
.filter(unique())
147+
.map(dirName => fs.realpathSync(dirName))
147148
.filter(directory => fs.lstatSync(directory).isDirectory());
148149

149150
if (!existingDirectories.length)

0 commit comments

Comments
 (0)