Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve SymbolicLink #809

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions __tests__/cache-utils.test.ts
Expand Up @@ -23,8 +23,10 @@ describe('cache-utils', () => {
let isFeatureAvailable: jest.SpyInstance;
let info: jest.SpyInstance;
let warningSpy: jest.SpyInstance;
let fsRealPathSyncSpy: jest.SpyInstance;

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

getCommandOutputSpy = jest.spyOn(utils, 'getCommandOutput');

fsRealPathSyncSpy = jest.spyOn(fs, 'realpathSync');
fsRealPathSyncSpy.mockImplementation(dirName => {
return dirName;
});
});

afterEach(() => {
jest.resetAllMocks();
jest.clearAllMocks();
//jest.restoreAllMocks();
});

afterAll(async () => {
console.log('::stoptoken::');
jest.restoreAllMocks();
}, 100000);

describe('getPackageManagerInfo', () => {
it.each<[string, PackageManagerInfo | null]>([
['npm', utils.supportedPackageManagers.npm],
Expand Down
2 changes: 2 additions & 0 deletions __tests__/nightly-installer.test.ts
Expand Up @@ -95,6 +95,8 @@ describe('setup-node', () => {
res = <INodeVersion[]>nodeTestDistRc;
} else if (url.includes('/nightly')) {
res = <INodeVersion[]>nodeTestDistNightly;
} else if (url.includes('/v8-canary')) {
res = <INodeVersion[]>nodeV8CanaryTestDist;
} else {
res = <INodeVersion[]>nodeTestDist;
}
Expand Down
1 change: 1 addition & 0 deletions dist/cache-save/index.js
Expand Up @@ -60532,6 +60532,7 @@ const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __
const existingDirectories = cacheDependenciesPaths
.map(path_1.default.dirname)
.filter(util_1.unique())
.map(dirName => fs_1.default.realpathSync(dirName))
.filter(directory => fs_1.default.lstatSync(directory).isDirectory());
if (!existingDirectories.length)
core.warning(`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`);
Expand Down
1 change: 1 addition & 0 deletions dist/setup/index.js
Expand Up @@ -71324,6 +71324,7 @@ const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __
const existingDirectories = cacheDependenciesPaths
.map(path_1.default.dirname)
.filter(util_1.unique())
.map(dirName => fs_1.default.realpathSync(dirName))
.filter(directory => fs_1.default.lstatSync(directory).isDirectory());
if (!existingDirectories.length)
core.warning(`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`);
Expand Down
1 change: 1 addition & 0 deletions src/cache-utils.ts
Expand Up @@ -144,6 +144,7 @@ const getProjectDirectoriesFromCacheDependencyPath = async (
const existingDirectories: string[] = cacheDependenciesPaths
.map(path.dirname)
.filter(unique())
.map(dirName => fs.realpathSync(dirName))
.filter(directory => fs.lstatSync(directory).isDirectory());

if (!existingDirectories.length)
Expand Down