mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
chore(travis): clean up logs
Forward SauceConnect logs and Karma debug logs into a file and print these files at the very end of a build.
This commit is contained in:
parent
c64a985307
commit
80d0f98263
9 changed files with 49 additions and 25 deletions
|
|
@ -7,6 +7,13 @@ env:
|
|||
- SAUCE_USERNAME=angular-ci
|
||||
- SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987
|
||||
- SAUCE_CONNECT_READY_FILE=/tmp/sauce-connect-ready
|
||||
- LOGS_DIR=/tmp/angular-build/logs
|
||||
|
||||
before_script:
|
||||
- mkdir -p $LOGS_DIR
|
||||
|
||||
script:
|
||||
- ./travis_build.sh
|
||||
|
||||
after_script:
|
||||
- ./travis_print_logs.sh
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
var sharedConfig = require('./karma-shared.conf');
|
||||
|
||||
module.exports = function(config) {
|
||||
sharedConfig(config);
|
||||
sharedConfig(config, {testName: 'AngularJS: docs', logFile: 'karma-docs.log'});
|
||||
|
||||
config.set({
|
||||
files: [
|
||||
|
|
@ -35,6 +35,4 @@ module.exports = function(config) {
|
|||
suite: 'Docs'
|
||||
}
|
||||
});
|
||||
|
||||
config.sauceLabs.testName = 'AngularJS: docs';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
var sharedConfig = require('./karma-shared.conf');
|
||||
|
||||
module.exports = function(config) {
|
||||
sharedConfig(config);
|
||||
sharedConfig(config, {testName: 'AngularJS: e2e', logFile: 'karma-e2e.log'});
|
||||
|
||||
config.set({
|
||||
frameworks: [],
|
||||
|
|
@ -22,6 +22,4 @@ module.exports = function(config) {
|
|||
suite: 'E2E'
|
||||
}
|
||||
});
|
||||
|
||||
config.sauceLabs.testName = 'AngularJS: e2e';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ var angularFiles = require('./angularFiles');
|
|||
var sharedConfig = require('./karma-shared.conf');
|
||||
|
||||
module.exports = function(config) {
|
||||
sharedConfig(config);
|
||||
sharedConfig(config, {testName: 'AngularJS: jqLite', logFile: 'karma-jqlite.log'});
|
||||
|
||||
config.set({
|
||||
files: angularFiles.mergeFilesFor('karma'),
|
||||
|
|
@ -13,6 +13,4 @@ module.exports = function(config) {
|
|||
suite: 'jqLite'
|
||||
}
|
||||
});
|
||||
|
||||
config.sauceLabs.testName = 'AngularJS: jqLite';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ var angularFiles = require('./angularFiles');
|
|||
var sharedConfig = require('./karma-shared.conf');
|
||||
|
||||
module.exports = function(config) {
|
||||
sharedConfig(config);
|
||||
sharedConfig(config, {testName: 'AngularJS: jQuery', logFile: 'karma-jquery.log'});
|
||||
|
||||
config.set({
|
||||
files: angularFiles.mergeFilesFor('karmaJquery'),
|
||||
|
|
@ -13,6 +13,4 @@ module.exports = function(config) {
|
|||
suite: 'jQuery'
|
||||
}
|
||||
});
|
||||
|
||||
config.sauceLabs.testName = 'AngularJS: jQuery';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ var angularFiles = require('./angularFiles');
|
|||
var sharedConfig = require('./karma-shared.conf');
|
||||
|
||||
module.exports = function(config) {
|
||||
sharedConfig(config);
|
||||
sharedConfig(config, {testName: 'AngularJS: modules', logFile: 'karma-modules.log'});
|
||||
|
||||
config.set({
|
||||
files: angularFiles.mergeFilesFor('karmaModules', 'angularSrcModules'),
|
||||
|
|
@ -12,6 +12,4 @@ module.exports = function(config) {
|
|||
suite: 'modules'
|
||||
}
|
||||
});
|
||||
|
||||
config.sauceLabs.testName = 'AngularJS: modules';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
module.exports = function(config) {
|
||||
module.exports = function(config, specificOptions) {
|
||||
config.set({
|
||||
frameworks: ['jasmine'],
|
||||
autoWatch: true,
|
||||
|
|
@ -9,11 +9,13 @@ module.exports = function(config) {
|
|||
|
||||
// config for Travis CI
|
||||
sauceLabs: {
|
||||
testName: 'AngularJS',
|
||||
testName: specificOptions.testName || 'AngularJS',
|
||||
startConnect: false,
|
||||
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
|
||||
},
|
||||
|
||||
// For more browsers on Sauce Labs see:
|
||||
// https://saucelabs.com/docs/platforms/webdriver
|
||||
customLaunchers: {
|
||||
'SL_Chrome': {
|
||||
base: 'SauceLabs',
|
||||
|
|
@ -51,9 +53,16 @@ module.exports = function(config) {
|
|||
});
|
||||
|
||||
|
||||
// TODO(vojta): remove once SauceLabs supports websockets.
|
||||
// This speeds up the capturing a bit, as browsers don't even try to use websocket.
|
||||
if (process.env.TRAVIS) {
|
||||
// TODO(vojta): remove once SauceLabs supports websockets.
|
||||
// This speeds up the capturing a bit, as browsers don't even try to use websocket.
|
||||
config.transports = ['xhr-polling'];
|
||||
|
||||
// Debug logging into a file, that we print out at the end of the build.
|
||||
config.loggers.push({
|
||||
type: 'file',
|
||||
filename: process.env.LOGS_DIR + '/' + (specificOptions.logFile || 'karma.log'),
|
||||
level: config.LOG_DEBUG
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -15,13 +15,16 @@ set -e
|
|||
CONNECT_URL="http://saucelabs.com/downloads/Sauce-Connect-latest.zip"
|
||||
CONNECT_DIR="/tmp/sauce-connect-$RANDOM"
|
||||
CONNECT_DOWNLOAD="Sauce_Connect.zip"
|
||||
CONNECT_LOG="$CONNECT_DIR/log"
|
||||
|
||||
CONNECT_LOG="$LOGS_DIR/sauce-connect"
|
||||
CONNECT_STDOUT="$LOGS_DIR/sauce-connect.stdout"
|
||||
CONNECT_STDERR="$LOGS_DIR/sauce-connect.stderr"
|
||||
|
||||
# Get Connect and start it
|
||||
mkdir -p $CONNECT_DIR
|
||||
cd $CONNECT_DIR
|
||||
curl $CONNECT_URL > $CONNECT_DOWNLOAD 2> /dev/null
|
||||
unzip $CONNECT_DOWNLOAD
|
||||
curl $CONNECT_URL -o $CONNECT_DOWNLOAD 2> /dev/null 1> /dev/null
|
||||
unzip $CONNECT_DOWNLOAD > /dev/null
|
||||
rm $CONNECT_DOWNLOAD
|
||||
|
||||
|
||||
|
|
@ -36,6 +39,10 @@ if [ ! -z "$SAUCE_CONNECT_READY_FILE" ]; then
|
|||
ARGS="$ARGS --readyfile $SAUCE_CONNECT_READY_FILE"
|
||||
fi
|
||||
|
||||
echo "Starting Sauce Connect in the background"
|
||||
echo "Logging into $CONNECT_LOG"
|
||||
java -jar Sauce-Connect.jar $ARGS $SAUCE_USERNAME $SAUCE_ACCESS_KEY > $CONNECT_LOG &
|
||||
|
||||
echo "Starting Sauce Connect in the background, logging into:"
|
||||
echo " $CONNECT_LOG"
|
||||
echo " $CONNECT_STDOUT"
|
||||
echo " $CONNECT_STDERR"
|
||||
java -jar Sauce-Connect.jar $ARGS $SAUCE_USERNAME $SAUCE_ACCESS_KEY \
|
||||
--logfile $CONNECT_LOG 2> $CONNECT_STDERR 1> $CONNECT_STDOUT &
|
||||
|
|
|
|||
11
travis_print_logs.sh
Executable file
11
travis_print_logs.sh
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
LOG_FILES=$LOGS_DIR/*
|
||||
|
||||
for FILE in $LOG_FILES; do
|
||||
echo -e "\n\n\n"
|
||||
echo "================================================================================"
|
||||
echo " $FILE"
|
||||
echo "================================================================================"
|
||||
cat $FILE
|
||||
done
|
||||
Loading…
Reference in a new issue