From aae2d96d5614a82e1887bd84820c1b94b2d1d392 Mon Sep 17 00:00:00 2001 From: spalger Date: Mon, 22 Feb 2016 10:39:42 -0800 Subject: [PATCH] [YamlDoc] add section description logging --- test/integration/yaml_suite/client_manager.js | 9 +++------ test/integration/yaml_suite/yaml_doc.js | 13 +++++++++++++ test/integration/yaml_suite/yaml_file.js | 11 +++++++++-- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/test/integration/yaml_suite/client_manager.js b/test/integration/yaml_suite/client_manager.js index 212dd6f6a..c4bad9cdb 100644 --- a/test/integration/yaml_suite/client_manager.js +++ b/test/integration/yaml_suite/client_manager.js @@ -2,25 +2,22 @@ var BROWSER = process.env.browser; var VERBOSE = process.env.VERBOSE; var JENKINS = !!process.env.JENKINS_HOME; +var es; if (BROWSER) { - var es = window.elasticsearch; + es = window.elasticsearch; } else { - var es = require('../../../src/elasticsearch'); + es = require('../../../src/elasticsearch'); } var _ = require('../../../src/lib/utils'); var path = require('path'); var fs = require('fs'); -var async = require('async'); var fromRoot = _.bindKey(path, 'join', require('find-root')(__dirname)); var Bluebird = require('bluebird'); // current client var client = null; -// when set to a boolean, hold the test of a ping -var externalExists; - module.exports = { create: function create(apiVersion, port, host, cb) { // create a client and ping the server for up to 15 seconds diff --git a/test/integration/yaml_suite/yaml_doc.js b/test/integration/yaml_suite/yaml_doc.js index 89263e89b..05fb22be7 100644 --- a/test/integration/yaml_suite/yaml_doc.js +++ b/test/integration/yaml_suite/yaml_doc.js @@ -158,6 +158,19 @@ function YamlDoc(doc, file) { 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) { diff --git a/test/integration/yaml_suite/yaml_file.js b/test/integration/yaml_suite/yaml_file.js index 530423d55..6923c2f1b 100644 --- a/test/integration/yaml_suite/yaml_file.js +++ b/test/integration/yaml_suite/yaml_file.js @@ -1,3 +1,5 @@ +/* eslint-env mocha */ +/* eslint-disable no-console */ /** * Class representing a YAML file * @type {[type]} @@ -20,16 +22,21 @@ function YamlFile(filename, docs) { doc = new YamlDoc(doc, file); if (doc.description === 'setup') { beforeEach(/* doc */function (done) { - async.series(_.pluck(doc._actions, 'testable'), done); + async.series(doc.getActionsRunners(), done); }); } else { it(doc.description, function (done) { - async.series(_.pluck(doc._actions, 'testable'), done); + async.series(doc.getActionsRunners(), done); }); } }); afterEach(/* doc */function () { + if (!!process.env.JENKINS_HOME) { + console.log('==========================='); + console.log('Cleanup'); + console.log('==========================='); + } return clientManager.get().clearEs(); }); });