New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

elastictest

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elastictest - npm Package Compare versions

Comparing version 1.2.0 to 2.0.0

42

lib/Suite.js

@@ -10,6 +10,5 @@

this.client = null;
this.clientOpts = clientOpts || {
this.clientOpts = clientOpts && clone( clientOpts ) || {
host: 'localhost:9200',
keepAlive: true,
// log: 'trace'
keepAlive: true
};

@@ -53,7 +52,11 @@ this.props = props || {};

// note: this was replaced in version ES@2.0, use this instead for later versions:
// note: optimize was replaced in version ES@2.0, forcemerge used for later versions:
// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html
Suite.prototype.optimize = function( cb ){
var cmd = { index: this.props.index, waitForMerge: true, force: true };
this.client.indices.optimize( cmd, cb );
try {
this.client.indices.forcemerge({ index: this.props.index }, cb );
} catch (e) {
var cmd = { index: this.props.index, waitForMerge: true, force: true };
this.client.indices.optimize( cmd, cb );
}
};

@@ -68,10 +71,16 @@

var self = this;
self.start( function(){
self.waitForStatus( 'yellow', function(){
self.start( function( err ){
if( err ){ throw new Error( err ); }
self.waitForStatus( 'yellow', function( err ){
if( err ){ throw new Error( err ); }
self.create( function( err ){
if( err ) throw new Error( err );
async.series( self.actions, function(){
self.refresh( function(){
self.optimize( async.series( self.asserts, function(){
self.delete( function(){
if( err ){ throw new Error( err ); }
async.series( self.actions, function( err ){
if( err ){ throw new Error( err ); }
self.refresh( function( err ){
if( err ){ throw new Error( err ); }
self.optimize( async.series( self.asserts, function( err ){
if( err ){ throw new Error( err ); }
self.delete( function( err ){
if( err ){ throw new Error( err ); }
self.client.close();

@@ -90,2 +99,9 @@ if( 'function' === typeof cb ){

// elasticsearch client requires that config objects not be reused.
// Error: Do not reuse objects to configure the elasticsearch Client class:
// https://github.com/elasticsearch/elasticsearch-js/issues/33
function clone( obj ){
return JSON.parse( JSON.stringify( obj ) );
}
module.exports = Suite;
{
"name": "elastictest",
"version": "1.2.0",
"version": "2.0.0",
"description": "A simple test harness for elasticsearch functional testing",

@@ -29,6 +29,6 @@ "main": "index.js",

"dependencies": {
"async": "^1.5.2",
"elasticsearch": "^10.1.3",
"randomstring": "^1.1.4"
"async": "^2.6.1",
"elasticsearch": "^15.1.1",
"randomstring": "^1.1.5"
}
}

@@ -7,4 +7,4 @@

var custom_schema = {
settings: { index: { index_concurrency: '999' } },
mappings: { mytype: { properties: { name: { type: 'string' } } } }
settings: { index: { refresh_interval: '-1' } },
mappings: { mytype: { properties: { name: { type: 'long' } } } }
};

@@ -63,6 +63,7 @@

suite.client.indices.getMapping({
index: suite.props.index,
type: 'mytype'
index: suite.props.index
}, function( err, res ){
t.deepEqual( res, {}, 'default mappings' );
var expected = {};
expected[suite.props.index] = { mappings: {} };
t.deepEqual( res, expected, 'default mappings' );
done();

@@ -69,0 +70,0 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc