mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Set intern.js to run status and testSettings suites.
This commit is contained in:
parent
05684c6326
commit
1e853f0d15
2 changed files with 31 additions and 1 deletions
30
test/fixtures/scenarioManager.js
vendored
30
test/fixtures/scenarioManager.js
vendored
|
@ -82,4 +82,34 @@ ScenarioManager.prototype.deleteAll = function () {
|
|||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Load a testing scenario if not already loaded
|
||||
* @param {string} id The scenario id to load
|
||||
* @return {Promise} A promise that is resolved when elasticsearch has a response
|
||||
*/
|
||||
ScenarioManager.prototype.loadIfEmpty = function (id) {
|
||||
var self = this;
|
||||
var scenario = config[id];
|
||||
if (!scenario) throw new Error('No scenario found for ' + id);
|
||||
|
||||
var self = this;
|
||||
return Promise.all(scenario.bulk.map(function mapBulk(bulk) {
|
||||
var loadIndexDefinition;
|
||||
|
||||
return self.client.count({
|
||||
index: bulk.indexName
|
||||
}, function handleCountResponse(error, response) {
|
||||
// if (error) {
|
||||
// console.log('Need to load index. error=' + error);
|
||||
// } else {
|
||||
// console.log('index=' + bulk.indexName + ' count=' + response.count);
|
||||
// }
|
||||
// if the index is undefined or count ===0 then call the load function above
|
||||
if (error || response.count === 0) {
|
||||
self.load(id);
|
||||
}
|
||||
});
|
||||
}));
|
||||
};
|
||||
|
||||
module.exports = ScenarioManager;
|
||||
|
|
|
@ -15,6 +15,6 @@ define(function (require) {
|
|||
'test/functional/status.js',
|
||||
'test/functional/testSettings'
|
||||
],
|
||||
excludeInstrumentation: /^(?:tests|fixtures|node_modules)\//
|
||||
excludeInstrumentation: /(fixtures|node_modules)\//
|
||||
}, serverConfig);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue