Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 6c2925c

Browse files
committed
chore(travis): add Travis CI
1 parent e8f84cf commit 6c2925c

File tree

3 files changed

+40
-11
lines changed

3 files changed

+40
-11
lines changed

.travis.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
dist: trusty
2+
sudo: required
3+
language: node_js
4+
node_js:
5+
- "5"
6+
os:
7+
- linux
8+
env:
9+
global:
10+
- DISPLAY=:99.0
11+
- CHROME_BIN=chromium-browser
12+
matrix:
13+
- SCRIPT="run-e2e-tests --fast"
14+
before_install:
15+
- npm install -g gulp --no-optional
16+
before_script:
17+
- sh -e /etc/init.d/xvfb start
18+
install:
19+
- npm install --no-optional
20+
- npm install --prefix public/docs/_examples
21+
- npm run webdriver:update --prefix public/docs/_examples
22+
- gulp add-example-boilerplate
23+
script:
24+
- gulp $SCRIPT

gulpfile.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ var _exampleDartWebBoilerPlateFiles = ['styles.css'];
103103
* all means (ts|js|dart)
104104
*/
105105
gulp.task('run-e2e-tests', function() {
106-
107-
var exePath = path.join(process.cwd(), "./node_modules/.bin/");
108-
109106
var promise;
110107
if (argv.fast) {
111108
// fast; skip all setup
@@ -115,7 +112,7 @@ gulp.task('run-e2e-tests', function() {
115112
var spawnInfo = spawnExt('npm', ['install'], { cwd: EXAMPLES_PATH});
116113
promise = spawnInfo.promise.then(function() {
117114
copyExampleBoilerplate();
118-
spawnInfo = spawnExt('webdriver-manager', ['update'], {cwd: exePath});
115+
spawnInfo = spawnExt('npm', ['run', 'webdriver:update'], {cwd: EXAMPLES_PATH});
119116
return spawnInfo.promise;
120117
});
121118
}
@@ -124,9 +121,12 @@ gulp.task('run-e2e-tests', function() {
124121
return findAndRunE2eTests(argv.filter);
125122
}).then(function(status) {
126123
reportStatus(status);
124+
if (status.failed.length > 0){
125+
return Promise.reject('Some test suites failed');
126+
}
127127
}).catch(function(e) {
128128
gutil.log(e);
129-
return e;
129+
process.exit(1);
130130
});
131131
});
132132

@@ -213,9 +213,8 @@ function runProtractor(prepPromise, appDir, appRunSpawnInfo, protractorConfigFil
213213
.then(function (data) {
214214
// start protractor
215215
var pcFilename = path.resolve(protractorConfigFilename); // need to resolve because we are going to be running from a different dir
216-
var exePath = path.join(process.cwd(), "./node_modules/.bin/");
217-
var spawnInfo = spawnExt('protractor',
218-
[ pcFilename, '--params.appDir=' + appDir, '--params.outputFile=' + outputFile], { cwd: exePath });
216+
var spawnInfo = spawnExt('npm', [ 'run', 'protractor', '--', pcFilename,
217+
'--params.appDir=' + appDir, '--params.outputFile=' + outputFile], { cwd: EXAMPLES_PATH });
219218
return spawnInfo.promise
220219
})
221220
.then(
@@ -483,9 +482,14 @@ gulp.task('git-changed-examples', ['_shred-devguide-examples'], function(){
483482

484483
gulp.task('check-deploy', ['build-docs'], function() {
485484
return harpCompile().then(function() {
486-
gutil.log('compile ok - running live server ...');
487-
execPromise('npm run live-server ./www');
488-
return askDeploy();
485+
gutil.log('compile ok');
486+
if(argv.dryRun) {
487+
return false;
488+
} else {
489+
gutil.log('running live server ...');
490+
execPromise('npm run live-server ./www');
491+
return askDeploy();
492+
}
489493
}).then(function(shouldDeploy) {
490494
if (shouldDeploy) {
491495
gutil.log('deploying...');

public/docs/_examples/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"tsc": "tsc",
1414
"tsc:w": "tsc -w",
1515
"typings": "typings",
16+
"protractor": "protractor",
1617
"webdriver:update": "webdriver-manager update",
1718
"start:webpack": "webpack-dev-server --inline --progress --port 8080",
1819
"test:webpack": "karma start karma.webpack.conf.js",

0 commit comments

Comments
 (0)