Try run sauce labs build on travis

This commit is contained in:
Roman Hotsiy 2016-01-17 00:36:23 +02:00
parent ab8da92578
commit 4b8e35e4f1
6 changed files with 42 additions and 12 deletions

View File

@ -5,13 +5,20 @@ branches:
except:
- releases
env:
matrix:
- JOB: unit
- JOB: e2e
global:
- GH_REF: github.com/Rebilly/ReDoc.git
- GIT_AUTHOR_EMAIL: redoc-bot@users.noreply.github.com
- GIT_AUTHOR_NAME: RedocBot
- SAUCE_USERNAME: romangotsiy
- secure: QJSADcLJYW8Y90AO0WOowA3LnjkLNdUY8euQHcMmrqNWeR9+DfFNFKY4zCjL2HrNMy/o/c/o3PZpWOzhBzg7P5+gWs+HUWDfmqHf4pbnPZj0ExXzVdCeY+F3oXmTgJ7Af0bzFeoK+oaZi8PMfZN82A0q5ebE6HZPXO+D/xT+XKdj+D/9zfaZYo+XOF3IfJkM5OCMDewoJkf4OWq7M8qteUHDHVMTu5B23GWZ3a/PD4PCX7vW8fq4RAnHVtlu+iHNycQaZLoA/ZWpEkO6vk8xvCY25UW++4L4btnttYGEYjOt9Y6P5qQ4BdY0OoSx2pCtsoFSOkfQmN6dfMB46BUOM2MZak7DPDq6c1MrNjFWFIEZUx4ZWhI8f/7XjPklXW9XQ/uxcSXZBEEU8NxYk5sWbwjIUXzpNXqh1M8L4ZyUUwC+pFz1eTCrZzuupaNsOZCOcqK5uW9dBlfzvCfMD62bdt4KXE+tf95LXo2MM17NqWY7luJNSxlYT/fMnGWGwFp4cIE3FaGgsi8qUA/IhaK5pKYx83lQKUsBT2w5Fp2l61R0wBEiT/Xm+SYFdlps7Yvl5ZwoGvA8ahr/jklLwWOHyabxftLdr3Aikv+2pgkyEmSMUXlxUqhS1NZKPRLAcAfsvC8lIVoxk9oRpsmByOnOWlfXFjj9SeuzvU3A8t/zLQs=
- secure: H2GClDJ7TEQaWgnk8d2fIVDpLwG3rTmN8TalUzrCqXGoG6ylCVmlwzKLgfPPWrVgSA7QTdfNV0ab7c2KyPoZBinHmeGMSuKNLV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gEaqM/ibebxrMS2IcGE5Nk7qLdaOAdB1plXAhMl+PGNaPx4+cniUqIIpgDTX8hlmd/Qk8ThyN5Z4aQyWI2WfH1BSqwg8dQfB5B6WNUDbJh/4Z6AX7e7ACiMLKoRkBTWpQ1FIwEJh5j8X/mtMBjf4+HSf8kfnAWFCmPTpRcYz9i4ZUDfa/9QKMoumCjokfItU7Ue2UE5v4=
- secure: apiavCfCQngL9Een1m7MIXMf3bqO3rY4YY59TMBl/yFKi80CEsHPHhgVUkl6hC+aM5PeBt/vgjh37rHMX31j/pcSZ4Z8SO/4Bwr36iHfhSxSEuAQog8P07qWqH7wYYWGIVmF682stgl0fYF+GN92sx/6edFVzsWVECf2G7imtICKSTbhKGm3Dhn2JwGnhD7eyfgZ33omgiaswumdu0xABoXDfqSZR+16fC4Ap5rhv3fXO9ndvRNy1STn376nT+my6e86UrQL4aS/S+HNHgIe1BUs+5cOp6Jgw6t0ie7phY0EAiECsRxy9K4e3Dctv9m6+Wma4+vy65MS0zGyrqey6oyV4l827sCOjrD1qcqc9bX6FlMSouVoNfE4ZjINNAbgigTaiLSoDSPcf5I5smkkM2ezzFOMSZwZxNdaNL2LKb97vc8m/ZUkv0sKZyT7oqVL7aJweEivsSHj5l2KR8Z7XrVB1y2eI6GvyTSa/d+CL4dSRzjh8+IRN047YBrdTKD5IkdT0upfoBu14WPUfFmLKxX+iMCslXRWb6kwojhrWNYmZvL65KRAzJ6+eIPDG/W5QUOpYyYT77bLlBQjVo6NmVvl9v3HMECq9CHH0ivKFBGPiKMOx7cJkTax3FuyznOW2WCXB9kTb5Zk9toaiNlSp9L6ll/h2Eyxa6n6sWUgmmM=
addons:
sauce_connect: true
cache:
directories:
- node_modules

6
build/run_tests.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
if [ $JOB = "e2e" ]; then
npm run e2e
else
npm run unit
fi

View File

@ -19,7 +19,7 @@ gulp.task('test-server', function (done) {
});
gulp.task('e2e', ['test-server'], function(done) {
gulp.task('e2e', ['bundleProd', 'test-server'], function(done) {
gulp.src(['tests/e2e/**/*.js'], { read:false })
.pipe(gp.protractor({
configFile: './protractor.conf.js'

View File

@ -8,12 +8,14 @@
},
"main": "dist/redoc.full.min.js",
"scripts": {
"test": "gulp lint && gulp test",
"test": "gulp lint && ./build/run_tests.sh",
"prepublish": "gulp build",
"postinstall": "jspm install",
"start": "gulp serve",
"build-dist": "gulp build",
"branch-release": "branch-release"
"branch-release": "branch-release",
"unit": "gulp test",
"e2e": "gulp e2e"
},
"keywords": [
"Swagger",

View File

@ -1,28 +1,40 @@
'use strict';
const loadJson = require('./tests/e2e/helpers').loadJson;
exports.config = {
const travis = process.env.TRAVIS;
let config = {
specs: ['./tests/e2e/**/*.js'],
capabilities: {
browserName: 'chrome'
},
baseUrl: 'http://localhost:3000',
framework: 'jasmine2',
onPrepare: function() {
var SpecReporter = require('jasmine-spec-reporter');
// add jasmine spec reporter
jasmine.getEnv().addReporter(new SpecReporter({displaySpecDuration: true}));
// load APIs.guru list
return loadJson('https://apis-guru.github.io/api-models/api/v1/list.json').then((list) => {
global.apisGuruList = list;
});
},
directConnect: true,
//directConnect: true,
useAllAngular2AppRoots: true,
jasmineNodeOpts: {
showTiming: true,
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
}
},
multiCapabilities: [{
browserName: 'chrome',
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
}]
};
if (travis) {
config.sauceUser = process.env.SAUCE_USERNAME;
config.sauceKey = process.env.SAUCE_ACCESS_KEY;
config.sauceSeleniumAddres = 'localhost:4445/wd/hub';
} else {
config.directConnect = true;
}
exports.config = config;

View File

@ -35,13 +35,16 @@ function verifyNoBrowserErrors() {
browser.executeScript('1+1');
browser.manage().logs().get('browser').then(function(browserLog) {
let filteredLog = browserLog.filter((logEntry) => {
let message = logEntry.message;
if (logEntry.level.value >= LogLevel.INFO) {
let message = logEntry.message;
if (message.length > MAX_ERROR_MESSAGE_SYMBOLS) {
message = message.substr(0, MAX_ERROR_MESSAGE_SYMBOLS) + '...';
}
console.log('>> ' + message);
}
// skip browser-sync errors
if (message.indexOf('browser-sync') > -1) return false;
return logEntry.level.value > LogLevel.WARNING;
});
expect(filteredLog.length).toEqual(0, `Found ${filteredLog.length} browser errors`);