Skip to content

Commit

Permalink
test: Bring back skipped cache tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrzesik committed Nov 24, 2023
1 parent e33b02d commit 8abf922
Showing 1 changed file with 45 additions and 56 deletions.
101 changes: 45 additions & 56 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1373,36 +1373,30 @@ test(
{ skip: !canUseDocker() || process.platform === 'win32' }
);

test('py3.7 uses download cache by default option',
async (t) => {
process.chdir('tests/base');
const path = npm(['pack', '../..']);
npm(['i', path]);
sls(['package'], { env: {} });
const cachepath = getUserCachePath();
t.true(
pathExistsSync(`${cachepath}${sep}downloadCacheslspyc${sep}http`),
'cache directory exists'
);
t.end();
},
{ skip: true }
);
test('py3.7 uses download cache by default option', async (t) => {
process.chdir('tests/base');
const path = npm(['pack', '../..']);
npm(['i', path]);
sls(['package'], { env: {} });
const cachepath = getUserCachePath();
t.true(
pathExistsSync(`${cachepath}${sep}downloadCacheslspyc${sep}http`),
'cache directory exists'
);
t.end();
});

test('py3.7 uses download cache by default',
async (t) => {
process.chdir('tests/base');
const path = npm(['pack', '../..']);
npm(['i', path]);
sls(['package'], { env: { cacheLocation: '.requirements-cache' } });
t.true(
pathExistsSync(`.requirements-cache${sep}downloadCacheslspyc${sep}http`),
'cache directory exists'
);
t.end();
},
{ skip: true }
);
test('py3.7 uses download cache by default', async (t) => {
process.chdir('tests/base');
const path = npm(['pack', '../..']);
npm(['i', path]);
sls(['package'], { env: { cacheLocation: '.requirements-cache' } });
t.true(
pathExistsSync(`.requirements-cache${sep}downloadCacheslspyc${sep}http`),
'cache directory exists'
);
t.end();
});

test(
'py3.7 uses download cache with dockerizePip option',
Expand All @@ -1418,8 +1412,7 @@ test(
);
t.end();
},
// { skip: !canUseDocker() || brokenOn('win32') }
{ skip: true }
{ skip: !canUseDocker() || brokenOn('win32') }
);

test(
Expand All @@ -1437,33 +1430,29 @@ test(
);
t.end();
},
// { skip: !canUseDocker() || brokenOn('win32') }
{ skip: true }
{ skip: !canUseDocker() || brokenOn('win32') }
);

test('py3.7 uses static and download cache',
async (t) => {
process.chdir('tests/base');
const path = npm(['pack', '../..']);
npm(['i', path]);
sls(['package'], { env: {} });
const cachepath = getUserCachePath();
const cacheFolderHash = sha256Path('.serverless/requirements.txt');
const arch = 'x86_64';
t.true(
pathExistsSync(`${cachepath}${sep}downloadCacheslspyc${sep}http`),
'http exists in download-cache'
);
t.true(
pathExistsSync(
`${cachepath}${sep}${cacheFolderHash}_${arch}_slspyc${sep}flask`
),
'flask exists in static-cache'
);
t.end();
},
{ skip: true }
);
test('py3.7 uses static and download cache', async (t) => {
process.chdir('tests/base');
const path = npm(['pack', '../..']);
npm(['i', path]);
sls(['package'], { env: {} });
const cachepath = getUserCachePath();
const cacheFolderHash = sha256Path('.serverless/requirements.txt');
const arch = 'x86_64';
t.true(
pathExistsSync(`${cachepath}${sep}downloadCacheslspyc${sep}http`),
'http exists in download-cache'
);
t.true(
pathExistsSync(
`${cachepath}${sep}${cacheFolderHash}_${arch}_slspyc${sep}flask`
),
'flask exists in static-cache'
);
t.end();
});

test(
'py3.7 uses static and download cache with dockerizePip option',
Expand Down

0 comments on commit 8abf922

Please sign in to comment.