From 9bc652d60fd1df7e86ca36b1f1e447e4ac4330f3 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 15 Apr 2015 23:44:12 +0000 Subject: [PATCH] Fix test fallout from botched test index --- .gitmodules | 2 +- crater-db.js | 5 +++-- test.js | 10 +++++----- test/crates.io-index | 1 + 4 files changed, 10 insertions(+), 8 deletions(-) create mode 160000 test/crates.io-index diff --git a/.gitmodules b/.gitmodules index eb81a98..0483ecc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "test/crates.io-index"] path = test/crates.io-index - url = https://github.com/rust-lang/crates.io-index + url = git://github.com/rust-lang/crates.io-index diff --git a/crater-db.js b/crater-db.js index c22c579..f112a58 100644 --- a/crater-db.js +++ b/crater-db.js @@ -15,13 +15,14 @@ var util = require('./crater-util'); */ function connect(config) { var credentials = config.dbCredentials; - var dbname = config.dbName; var dbctx = new Promise(function(resolve, reject) { var client = new pg.Client({ + database: config.dbName, user: credentials.username, password: credentials.password, - database: dbname + host: credentials.host || null, + port: credentials.port || null }); client.connect(function(err) { diff --git a/test.js b/test.js index e1b97c4..e6fca20 100644 --- a/test.js +++ b/test.js @@ -116,8 +116,8 @@ suite("local crate-index tests", function() { p.then(function(crateData) { return crates.getMostRecentRevs(crateData); }).then(function(recent) { - assert(recent["toml"].vers == "0.1.18"); - assert(recent["obj-rs"].vers == "0.4.2"); + assert(recent["toml"].vers == "0.1.20"); + assert(recent["obj-rs"].vers == "0.4.7"); done(); }).catch(function(e) { done(e); }); }); @@ -136,9 +136,9 @@ suite("local crate-index tests", function() { var p = crates.loadCrates(testConfig); p.then(function(crateData) { var pop = crates.getPopularityMap(crateData); - assert(pop.time == 72); - assert(pop.num == 17); - assert(pop.piston == 0); + assert(pop.time == 92); + assert(pop.num == 66); + assert(pop.piston == 1); done(); }).catch(function(e) { done(e); }); }); diff --git a/test/crates.io-index b/test/crates.io-index new file mode 160000 index 0000000..d243699 --- /dev/null +++ b/test/crates.io-index @@ -0,0 +1 @@ +Subproject commit d2436996579fefb19d66ff3269f1e99285ee0341