Skip to content

Commit

Permalink
Revert "Temporarily disabled cache usage for v2"
Browse files Browse the repository at this point in the history
  • Loading branch information
AlenaSviridenko authored Aug 4, 2021
1 parent d6e3b55 commit d21ecc7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 20 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/e2e-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ jobs:
node-yarn2-depencies-caching:
name: Test yarn 2 (Node ${{ matrix.node-version}}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
strategy:
fail-fast: false
matrix:
Expand Down
21 changes: 7 additions & 14 deletions __tests__/installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ describe('setup-node', () => {
// Found in cache tests
//--------------------------------------------------

// Usage of pre-cached Node.js versions is temporarily disabled.
xit('finds version in cache with stable true', async () => {
it('finds version in cache with stable true', async () => {
inputs['node-version'] = '12';
inputs.stable = 'true';

Expand All @@ -183,8 +182,7 @@ describe('setup-node', () => {
expect(logSpy).toHaveBeenCalledWith(`Found in cache @ ${toolPath}`);
});

// Usage of pre-cached Node.js versions is temporarily disabled.
xit('finds version in cache with stable not supplied', async () => {
it('finds version in cache with stable not supplied', async () => {
inputs['node-version'] = '12';

inSpy.mockImplementation(name => inputs[name]);
Expand All @@ -196,8 +194,7 @@ describe('setup-node', () => {
expect(logSpy).toHaveBeenCalledWith(`Found in cache @ ${toolPath}`);
});

// Usage of pre-cached Node.js versions is temporarily disabled.
xit('finds version in cache and adds it to the path', async () => {
it('finds version in cache and adds it to the path', async () => {
inputs['node-version'] = '12';

inSpy.mockImplementation(name => inputs[name]);
Expand Down Expand Up @@ -387,8 +384,7 @@ describe('setup-node', () => {
}, 100000);

This comment has been minimized.

Copy link
@yan12318

yan12318 Sep 9, 2021

what this for


describe('check-latest flag', () => {
// Usage of pre-cached Node.js versions is temporarily disabled.
xit('use local version and dont check manifest if check-latest is not specified', async () => {
it('use local version and dont check manifest if check-latest is not specified', async () => {
os.platform = 'linux';
os.arch = 'x64';

Expand All @@ -409,8 +405,7 @@ describe('setup-node', () => {
);
});

// Usage of pre-cached Node.js versions is temporarily disabled.
xit('check latest version and resolve it from local cache', async () => {
it('check latest version and resolve it from local cache', async () => {
os.platform = 'linux';
os.arch = 'x64';

Expand Down Expand Up @@ -561,8 +556,7 @@ describe('setup-node', () => {
inputs.stable = 'true';
});

// Usage of pre-cached Node.js versions is temporarily disabled.
xit('find latest LTS version and resolve it from local cache (lts/erbium)', async () => {
it('find latest LTS version and resolve it from local cache (lts/erbium)', async () => {
// arrange
inputs['node-version'] = 'lts/erbium';

Expand Down Expand Up @@ -632,8 +626,7 @@ describe('setup-node', () => {
);
});

// Usage of pre-cached Node.js versions is temporarily disabled.
xit('find latest LTS version and resolve it from local cache (lts/*)', async () => {
it('find latest LTS version and resolve it from local cache (lts/*)', async () => {
// arrange
inputs['node-version'] = 'lts/*';

Expand Down
5 changes: 3 additions & 2 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65086,8 +65086,9 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) {
let toolPath;
toolPath = tc.find('node', versionSpec, osArch);
// If not found in cache, download
// Usage of pre-cached Node.js versions is temporarily disabled.
if (false) {}
if (toolPath) {
core.info(`Found in cache @ ${toolPath}`);
}
else {
core.info(`Attempting to download ${versionSpec}...`);
let downloadPath = '';
Expand Down
3 changes: 1 addition & 2 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ export async function getNode(
toolPath = tc.find('node', versionSpec, osArch);

// If not found in cache, download
// Usage of pre-cached Node.js versions is temporarily disabled.
if (false) {
if (toolPath) {
core.info(`Found in cache @ ${toolPath}`);
} else {
core.info(`Attempting to download ${versionSpec}...`);
Expand Down

0 comments on commit d21ecc7

Please sign in to comment.