Skip to content

Commit f3c435d

Browse files
committed
e2e
1 parent 3ae36f3 commit f3c435d

File tree

3 files changed

+31
-29
lines changed

3 files changed

+31
-29
lines changed

.travis.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ env:
2424
- BROWSER_STACK_ACCESS_KEY=BWCd4SynLzdDcv8xtzsB
2525
- ARCH=linux-x64
2626
- BROWSER_PROVIDER_READY_FILE=/tmp/angular-material2-build/readyfile
27-
# Token for tsd to increase github rate limit
28-
# See https://github.com/DefinitelyTyped/tsd#tsdrc
29-
# This does not use http://docs.travis-ci.com/user/environment-variables/#Secure-Variables
30-
# because those are not visible for pull requests, and those should also be reliable.
31-
# This SSO token belongs to github account angular-github-ratelimit-token which has no access
32-
# (password is in Valentine)
33-
- TSDRC='{"token":"ef474500309daea53d5991b3079159a29520a40b"}'
3427
# GITHUB_TOKEN_ANGULAR
3528
- secure: "fq/U7VDMWO8O8SnAQkdbkoSe2X92PVqg4d044HmRYVmcf6YbO48+xeGJ8yOk0pCBwl3ISO4Q2ot0x546kxfiYBuHkZetlngZxZCtQiFT9kyId8ZKcYdXaIW9OVdw3Gh3tQyUwDucfkVhqcs52D6NZjyE2aWZ4/d1V4kWRO/LMgo="
3629
matrix:

gulpfile.js

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,26 @@ function createExecTask(packageName, executable, args) {
9191
}
9292
return function(done) {
9393
resolveBin(packageName, { executable: executable }, function (err, binPath) {
94-
child_process.exec(`${binPath} ${args.join(' ')}`, function (error) {
95-
if (error) {
96-
console.error(error);
97-
throw error;
98-
} else {
99-
done();
94+
if (err) {
95+
console.error(err);
96+
throw err;
97+
}
98+
99+
const process = child_process.spawn(binPath, args);
100+
101+
process.stdout.on('data', (data) => {
102+
console.log(`stdout: ${data}`);
103+
});
104+
105+
process.stderr.on('data', (data) => {
106+
console.log(`stderr: ${data}`);
107+
});
108+
109+
process.on('close', (code) => {
110+
if (code != 0) {
111+
throw new Error('Process failed with code ' + code);
100112
}
113+
done();
101114
});
102115
});
103116
}
@@ -141,7 +154,7 @@ gulp.task(':build:components:ngc', ['build:components'], createExecTask(
141154
*/
142155
gulp.task(':build:vendor', function() {
143156
const npmVendorFiles = [
144-
'core-js/client', 'zone.js/dist', 'hammerjs', 'systemjs/dist', 'rxjs', '@angular', 'hammerjs'
157+
'@angular', 'core-js/client', 'hammerjs', 'rxjs', 'systemjs/dist', 'zone.js/dist'
145158
];
146159

147160
return gulpMerge(
@@ -290,8 +303,9 @@ gulp.task('serve:e2eapp', ['build:e2eapp'], function(done) {
290303

291304
stopE2eServer = function() {
292305
stream.emit('kill');
293-
done();
294306
};
307+
308+
return stream;
295309
});
296310

297311
gulp.task(':serve:e2eapp:stop', function() {
@@ -323,22 +337,16 @@ gulp.task(':test:protractor', createExecTask(
323337
'protractor', [path.join(__dirname, 'test/protractor.conf.js')]
324338
));
325339

326-
gulp.task(':test:protractor:and-stop', function(done) {
327-
gulpRunSequence(
328-
':test:protractor',
329-
':serve:e2eapp:stop',
330-
done
331-
);
332-
});
333-
334340
gulp.task(':e2e:done', function() {
335341
process.exit(0);
336342
});
337343

338344
gulp.task('e2e', function(done) {
339345
gulpRunSequence(
340346
':test:protractor:setup',
341-
['serve:e2eapp', ':test:protractor:and-stop'],
347+
'serve:e2eapp',
348+
':test:protractor',
349+
':serve:e2eapp:stop',
342350
':e2e:done',
343351
done
344352
);
@@ -363,7 +371,9 @@ gulp.task('build:release', function(done) {
363371
* Continuous Integration.
364372
*/
365373
gulp.task('ci:lint', ['lint', 'stylelint']);
366-
gulp.task('ci:test', ['test:single-run']);
374+
gulp.task('ci:test', ['test:single-run'], function() {
375+
process.exit(0);
376+
});
367377
gulp.task('ci:e2e', ['e2e']);
368378
gulp.task('ci:extract-metadata', [':build:components:ngc']);
369379
gulp.task('ci:forbidden-identifiers', function() {

test/protractor.conf.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ const config = {
1313
useAllAngular2AppRoots: true,
1414
specs: [ path.join(__dirname, '../e2e/**/*.e2e.ts') ],
1515
baseUrl: E2E_BASE_URL,
16-
allScriptsTimeout: 30000,
17-
getPageTimeout: 30000,
16+
allScriptsTimeout: 120000,
17+
getPageTimeout: 120000,
1818
jasmineNodeOpts: {
19-
defaultTimeoutInterval: 60000,
19+
defaultTimeoutInterval: 120000,
2020
}
2121
};
2222

23-
2423
if (process.env['TRAVIS']) {
2524
const key = require('../scripts/sauce/sauce_config');
2625
config.sauceUser = process.env['SAUCE_USERNAME'];

0 commit comments

Comments
 (0)