diff --git a/.travis.yml b/.travis.yml index e1013586..d283e1c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,12 @@ node_js: - "0.10" - "0.8" env: - - INFLUX=0.5.5 - - INFLUX=0.4.0 + - INFLUX=0.8.0 before_script: - wget "http://s3.amazonaws.com/influxdb/influxdb_$(echo $INFLUX)_amd64.deb" - sudo dpkg -i "influxdb_$(echo $INFLUX)_amd64.deb" - - sleep 15 + - sudo service influxdb start + - sleep 5 script: npm run travis-test after_script: - cat ./coverage/lcov.info | ./node_modules/.bin/coveralls && rm -rf ./coverage diff --git a/index.js b/index.js index 84b17f1d..0fe02385 100644 --- a/index.js +++ b/index.js @@ -116,11 +116,11 @@ InfluxDB.prototype.getSeriesNames = function(databaseName,callback) { this.request.get({ url: this.url('db/' + databaseName + '/series', {q: 'list series'}), json: true - }, this._parseCallback(function(err, series) { + }, this._parseCallback(function(err, results) { if(err) { - return callback(err, series); + return callback(err, results); } - return callback(err, _.map(series, function(series) { return series.name; })); + return callback(err, _.map(results[0].points, function(series) { return series[1]; })); })); }; diff --git a/test.js b/test.js index c897d86a..f5407a8f 100644 --- a/test.js +++ b/test.js @@ -34,9 +34,9 @@ describe('InfluxDB', function () { describe('create client', function () { it('should create an instance without error', function () { - client = influx({host : info.server.host, port: info.server.port, username: info.server.username, passwort : info.server.password, database : info.db.name}); - dbClient = influx({host : info.server.host, port: info.server.port, username: info.server.username, passwort : info.server.password, database : info.db.name}); - failClient = influx({host : info.server.host, port: 6543, username: info.server.username, passwort : info.server.password, database : info.db.name}); + client = influx({host : info.server.host, port: info.server.port, username: info.server.username, password : info.server.password, database : info.db.name}); + dbClient = influx({host : info.server.host, port: info.server.port, username: info.server.username, password : info.server.password, database : info.db.name}); + failClient = influx({host : info.server.host, port: 6543, username: info.server.username, password : info.server.password, database : info.db.name}); failoverClient = influx({hosts : [ {host : '192.168.1.1'}, {host : '192.168.1.2'}, @@ -52,8 +52,8 @@ describe('InfluxDB', function () { describe('#setRequestTimeout', function () { it('should set the default request timeout value', function () { - var timeout= failoverClient.setRequestTimeout(2000); - assert.equal(timeout,2000); + var timeout= failoverClient.setRequestTimeout(5000); + assert.equal(timeout,5000); }); });