Skip to content

Commit 3bd83eb

Browse files
committed
test(cli): tweak test timeouts
1 parent d9a75dd commit 3bd83eb

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

packages/cli/test/acceptance/app-run.acceptance.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ describe('app-generator (SLOW)', function() {
2323
outdir: sandbox,
2424
};
2525

26-
before(async () => {
26+
before('scaffold a new application', async function createAppProject() {
27+
// Increase the timeout to 1 minute to accomodate slow CI build machines
28+
this.timeout(60 * 1000);
2729
await helpers
2830
.run(generator)
2931
.inDir(sandbox)
@@ -32,21 +34,25 @@ describe('app-generator (SLOW)', function() {
3234
.withPrompts(props);
3335
});
3436

35-
// Run `lerna bootstrap --scope @loopback/sandbox-app`
36-
// WARNING: It takes a while to run `lerna bootstrap`
37-
this.timeout(0);
38-
before(async () => {
37+
before('install dependencies', async function installDependencies() {
38+
// Run `lerna bootstrap --scope @loopback/sandbox-app`
39+
// WARNING: It takes a while to run `lerna bootstrap`
40+
this.timeout(15 * 60 * 1000);
3941
process.chdir(rootDir);
4042
await lernaBootstrap(appName);
4143
});
4244

43-
it('passes `npm test` for the generated project', () => {
44-
process.chdir(sandbox);
45+
it('passes `npm test` for the generated project', function() {
46+
// Increase the timeout to 5 minutes,
47+
// the tests can take more than 2 seconds to run.
48+
this.timeout(5 * 60 * 1000);
49+
4550
return new Promise((resolve, reject) => {
4651
build
4752
.runShell('npm', ['test'], {
4853
// Disable stdout
4954
stdio: [process.stdin, 'ignore', process.stderr],
55+
cwd: sandbox,
5056
})
5157
.on('close', code => {
5258
assert.equal(code, 0);

packages/cli/test/integration/lib/project-generator.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ const expect = require('@loopback/testlab').expect;
1515

1616
module.exports = function(projGenerator, props, projectType) {
1717
return function() {
18+
// Increase the timeout to 60 seconds to accomodate
19+
// for possibly slow CI build machines
20+
this.timeout(60 * 1000);
21+
1822
describe('help', () => {
1923
it('prints lb4', () => {
2024
const env = yeoman.createEnv();

0 commit comments

Comments
 (0)