[YamlDoc] add section description logging
This commit is contained in:
@ -2,25 +2,22 @@ var BROWSER = process.env.browser;
|
|||||||
var VERBOSE = process.env.VERBOSE;
|
var VERBOSE = process.env.VERBOSE;
|
||||||
var JENKINS = !!process.env.JENKINS_HOME;
|
var JENKINS = !!process.env.JENKINS_HOME;
|
||||||
|
|
||||||
|
var es;
|
||||||
if (BROWSER) {
|
if (BROWSER) {
|
||||||
var es = window.elasticsearch;
|
es = window.elasticsearch;
|
||||||
} else {
|
} else {
|
||||||
var es = require('../../../src/elasticsearch');
|
es = require('../../../src/elasticsearch');
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = require('../../../src/lib/utils');
|
var _ = require('../../../src/lib/utils');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var async = require('async');
|
|
||||||
var fromRoot = _.bindKey(path, 'join', require('find-root')(__dirname));
|
var fromRoot = _.bindKey(path, 'join', require('find-root')(__dirname));
|
||||||
var Bluebird = require('bluebird');
|
var Bluebird = require('bluebird');
|
||||||
|
|
||||||
// current client
|
// current client
|
||||||
var client = null;
|
var client = null;
|
||||||
|
|
||||||
// when set to a boolean, hold the test of a ping
|
|
||||||
var externalExists;
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
create: function create(apiVersion, port, host, cb) {
|
create: function create(apiVersion, port, host, cb) {
|
||||||
// create a client and ping the server for up to 15 seconds
|
// create a client and ping the server for up to 15 seconds
|
||||||
|
|||||||
@ -158,6 +158,19 @@ function YamlDoc(doc, file) {
|
|||||||
|
|
||||||
return action;
|
return action;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
self.getActionsRunners = function () {
|
||||||
|
return self._actions.map(function (action) {
|
||||||
|
return function (cb) {
|
||||||
|
if (!!process.env.JENKINS_HOME) {
|
||||||
|
console.log('===========================');
|
||||||
|
console.log(action.name);
|
||||||
|
console.log('===========================');
|
||||||
|
}
|
||||||
|
return action.testable(cb);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
YamlDoc.compareRangeToVersion = function (range, version) {
|
YamlDoc.compareRangeToVersion = function (range, version) {
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* eslint-env mocha */
|
||||||
|
/* eslint-disable no-console */
|
||||||
/**
|
/**
|
||||||
* Class representing a YAML file
|
* Class representing a YAML file
|
||||||
* @type {[type]}
|
* @type {[type]}
|
||||||
@ -20,16 +22,21 @@ function YamlFile(filename, docs) {
|
|||||||
doc = new YamlDoc(doc, file);
|
doc = new YamlDoc(doc, file);
|
||||||
if (doc.description === 'setup') {
|
if (doc.description === 'setup') {
|
||||||
beforeEach(/* doc */function (done) {
|
beforeEach(/* doc */function (done) {
|
||||||
async.series(_.pluck(doc._actions, 'testable'), done);
|
async.series(doc.getActionsRunners(), done);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
it(doc.description, function (done) {
|
it(doc.description, function (done) {
|
||||||
async.series(_.pluck(doc._actions, 'testable'), done);
|
async.series(doc.getActionsRunners(), done);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(/* doc */function () {
|
afterEach(/* doc */function () {
|
||||||
|
if (!!process.env.JENKINS_HOME) {
|
||||||
|
console.log('===========================');
|
||||||
|
console.log('Cleanup');
|
||||||
|
console.log('===========================');
|
||||||
|
}
|
||||||
return clientManager.get().clearEs();
|
return clientManager.get().clearEs();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user