Trouble running tests while setting up dev environment

126 views
Skip to first unread message

David Gudeman

unread,
Apr 10, 2016, 3:53:25 AM4/10/16
to Sequelize
Hi,
I am interested in contributing to sequelize however I am having trouble getting my development environment working. I followed the instructions on CONTRIBUTING.md but I get stuck on the 'npm run test-docker' step. It seems that there is a dependency issue, it complains:

An unhandled exception occured:

/sequelize/test/support.js:23

  throw e;

        ^

Error: Cannot find module '/sequelize/node_modules/sqlite3/lib/binding/node-v43-linux-x64/node_sqlite3.node'


Installing the module by itself doesn't help, because this is all happening in docker containers I'm sure.


Anyways I would really like to contribute but I am at a loss in terms of getting this to work. Help would be greatly appreciated.


-David

Screen Shot 2016-04-10 at 12.52.42 AM.png

Mick Hansen

unread,
Apr 10, 2016, 5:34:03 AM4/10/16
to David Gudeman, Sequelize
Hey there David,

It's quirk with sharing files (including node_modules) between your local repository and docker.
When you NPM install native libraries are compiled for that version - So you have to make sure that the node version you npm install with is the same as the one used in docker.

As a work around you can also run the postgres tests only.
--
Mick Hansen
@mhansendev
mhansen.io

David Gudeman

unread,
Apr 10, 2016, 11:58:25 PM4/10/16
to Sequelize, dcgu...@gmail.com
Hi Mick,

I appreciate the timely response. Since your reply I installed an up-to-date version of node (v5.10.1). Unfortunately I still get the same error:

npm info test-integration sequ...@3.21.0


> sequ...@3.21.0 test-integration /sequelize

> mocha --globals setImmediate,clearImmediate --ui tdd --check-leaks --colors -t 15000 --reporter spec --grep "$GREP" 'test/integration/**/*.test.js'


An unhandled exception occured:

/sequelize/test/support.js:23

  throw e;

        ^

Error: Cannot find module '/sequelize/node_modules/sqlite3/lib/binding/node-v43-linux-x64/node_sqlite3.node'


I then tried to run just the postgres tests with the command npm run test-postgres but I get this error:


> sequ...@3.21.0 test-integration /Users/davidgudeman/sequelize

> mocha --globals setImmediate,clearImmediate --ui tdd --check-leaks --colors -t 15000 --reporter spec --grep "$GREP" 'test/integration/**/*.test.js'


Using database:  sequelize-test-30

FIXME: I want to be supported in this dialect as well :-(



  1) "before all" hook


  0 passing (48ms)

  1 failing


  1)  "before all" hook:

     SequelizeConnectionRefusedError: connect ECONNREFUSED 127.0.0.1:5432

      at lib/dialects/postgres/connection-manager.js:95:20

      at null.<anonymous> (node_modules/pg/lib/client.js:176:5)

      at Socket.<anonymous> (node_modules/pg/lib/connection.js:59:10)

      at emitErrorNT (net.js:1249:8)

      at _combinedTickCallback (internal/process/next_tick.js:74:11)

      at process._tickCallback (internal/process/next_tick.js:98:9)


Any quick fixes come to mind?


Best,

David

npm run test-docker.png
npm run test-postgres.png

Mick Hansen

unread,
Apr 11, 2016, 1:35:10 AM4/11/16
to David Gudeman, Sequelize
Did you remove and reinstall npm dependencies?
Reply all
Reply to author
Forward
0 new messages