Skip to content

Commit

Permalink
test(cli): tweak test timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
bajtos committed Jun 14, 2018
1 parent 98bca85 commit ce81840
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
20 changes: 13 additions & 7 deletions packages/cli/test/acceptance/app-run.acceptance.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ describe('app-generator (SLOW)', function() {
outdir: sandbox,
};

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

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

it('passes `npm test` for the generated project', () => {
process.chdir(sandbox);
it('passes `npm test` for the generated project', function() {
// Increase the timeout to 5 minutes,
// the tests can take more than 2 seconds to run.
this.timeout(5 * 60 * 1000);

return new Promise((resolve, reject) => {
build
.runShell('npm', ['test'], {
// Disable stdout
stdio: [process.stdin, 'ignore', process.stderr],
cwd: sandbox,
})
.on('close', code => {
assert.equal(code, 0);
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/test/integration/lib/project-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const expect = require('@loopback/testlab').expect;

module.exports = function(projGenerator, props, projectType) {
return function() {
// Increase the timeout to 60 seconds to accomodate
// for possibly slow CI build machines
this.timeout(60 * 1000);

describe('help', () => {
it('prints lb4', () => {
const env = yeoman.createEnv();
Expand Down

0 comments on commit ce81840

Please sign in to comment.