Skip to content

Commit

Permalink
Work on Travis build
Browse files Browse the repository at this point in the history
  • Loading branch information
imurchie committed Apr 19, 2019
1 parent 8468c44 commit 00a842d
Show file tree
Hide file tree
Showing 4 changed files with 277 additions and 603 deletions.
18 changes: 1 addition & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
notifications:
email: false
branches:
only:
- master
language: node_js
node_js:
- "10"
# addons:
# sauce_connect: true
env:
global:
- TIMEOUT=600000
# - HTTP_TIMEOUT=60000
- HTTP_RETRIES=3
- HTTP_RETRY_DELAY=60000
- DEBUG_CONNECTION=1
- CONCURRENCY=15
# - THROTTLE=5
- VERBOSE=1
- SAUCE_CONNECT_VERSION='4.5.1'
- SAUCE_CONNECT_VERBOSE=1
Expand All @@ -29,12 +20,5 @@ env:
# - CONFIG=iphone
# - CONFIG=ipad
# - CONFIG=android_phone
# matrix:
# include:
# - node_js: "5"
# env: CONFIG=chrome_e2e
# allow_failures:
# - node_js: "5"
# env: CONFIG=chrome_e2e
script:
- "node_modules/.bin/gulp travis --config $CONFIG --sauce"
- "npx gulp travis --config $CONFIG --sauce"
24 changes: 10 additions & 14 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var gulp = require('gulp'),
runSequence = Q.denodeify(require('run-sequence')),
path = require('path'),
_ = require('lodash'),
args = require('yargs').argv,
args = require('yargs').argv,
urlLib = require('url'),
mochaStream = require('spawn-mocha-parallel').mochaStream,
httpProxy = require('http-proxy'),
Expand Down Expand Up @@ -114,28 +114,24 @@ _(BROWSERS).each(function(browser) {
});
});

_(MOBILE_BROWSERS).each(function(browser) {
gulp.task('test-midway-' + browser, function () {
_(MOBILE_BROWSERS).each(function (browser) {
gulp.task(`test-midway-${browser}`, function () {
var opts = buildMochaOpts({ midway: true, browser: browser });
var mocha = mochaStream(opts);
return gulp.src([
'test/midway/api-nav-specs.js',
'test/midway/api-el-specs.js',
'test/midway/api-exec-specs.js',
'test/midway/mobile-specs.js',
], {read: false})
.pipe(mocha)
.pipe(mochaStream(opts))
.on('error', console.warn.bind(console));
});
});

gulp.task('test-midway', function() {
var midwayTestTasks = [];
_(args.browsers).each(function(browser) {
midwayTestTasks.push('test-midway-' + browser);
});
const midwayTestTasks = _.map(args.browsers, (browser) =>`test-midway-${browser}`);
return runSequence('pre-midway', midwayTestTasks)
.finally(function() {
.finally(function () {
return runSequence('post-midway');
});
});
Expand Down Expand Up @@ -228,7 +224,7 @@ gulp.task('stop-proxy', function(done) {

var sauceConnectProcess = null;

gulp.task('start-sc', function(done) {
gulp.task('start-sc', function (done) {
var opts = {
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY,
Expand All @@ -239,7 +235,7 @@ gulp.task('start-sc', function(done) {
if(process.env.TRAVIS_JOB_NUMBER) {
opts.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
}
var startTunnel = function(done, n) {
var startTunnel = function (done, n) {
sauceConnectLauncher(opts, function (err, _sauceConnectProcess) {
if (err) {
if(n > 0) {
Expand All @@ -262,7 +258,7 @@ gulp.task('start-sc', function(done) {
startTunnel(done, 3);
});

gulp.task('stop-sc', function(done) {
gulp.task('stop-sc', function (done) {
if(sauceConnectProcess) { sauceConnectProcess.close(done); }
else { done(); }
});
Expand All @@ -285,7 +281,7 @@ gulp.task('post-midway', function() {

gulp.task('travis', function() {
var seq;
switch(args.config) {
switch (args.config) {
case 'unit':
return runSequence(['test-unit']);
case 'multi':
Expand Down
Loading

0 comments on commit 00a842d

Please sign in to comment.