From 102d8965d636a89943418b0d94818677ccbcd892 Mon Sep 17 00:00:00 2001 From: Spencer Alger Date: Sun, 11 Jan 2015 16:03:41 -0700 Subject: [PATCH] log earlier, for formatting sake --- scripts/ci.js | 5 ++--- test/integration/yaml_suite/run.js | 21 ++++++++------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/scripts/ci.js b/scripts/ci.js index 981e4ebce..f9e84d195 100644 --- a/scripts/ci.js +++ b/scripts/ci.js @@ -26,6 +26,7 @@ var child_process = require('child_process'); var chalk = require('chalk'); var format = require('util').format; +var NL_RE = /(\r?\n)/g; var ROOT = join(__dirname, '..'); var GRUNT = join(ROOT, './node_modules/.bin/grunt'); var ENV = _.clone(process.env); @@ -207,8 +208,6 @@ function logImportant(text) { log('------------'); } -var RE = /(\r?\n)/g; - function push(m) { return function () { var args = _.toArray(arguments); @@ -220,7 +219,7 @@ function push(m) { function indent() { var str = through2( - push(function (chunk) { return String(chunk).replace(RE, '$1 '); }), + push(function (chunk) { return String(chunk).replace(NL_RE, '$1 '); }), push(function () { return '\n'; }) ); str.push(' '); diff --git a/test/integration/yaml_suite/run.js b/test/integration/yaml_suite/run.js index 0387bafd2..58ea767f6 100644 --- a/test/integration/yaml_suite/run.js +++ b/test/integration/yaml_suite/run.js @@ -9,25 +9,20 @@ module.exports = function (branch) { var es = rootReq('src/elasticsearch'); var clientManager = require('./client_manager'); + var port = parseInt(process.env.ES_PORT || 9200, 10); + var _release = branch.match(/^v(\d+\.\d+)\.\d+$/); + var apiVersion = _release ? _release[1] : branch; + + console.log(' branch:', branch); + console.log(' port:', port); + console.log(' api version:', apiVersion); + describe('integration', function () { this.timeout(30000); // before running any tests... before(function (done) { this.timeout(5 * 60 * 1000); - - var apiVersion = branch; - var match; - if (match = apiVersion.match(/^v(\d+\.\d+)\.\d+$/)) { - apiVersion = match[1]; - } - - var port = parseInt(process.env.ES_PORT || 9200, 10); - - console.log('branch:', branch); - console.log('port:', port); - console.log('api version:', apiVersion); - clientManager.create(apiVersion, port, done); });