Skip to content

Commit 17ce7b5

Browse files
authored
Merge pull request #215 from strongloop/update-readme-postgres-setup
update README for local postgres setup
2 parents e4078c5 + 531e49d commit 17ce7b5

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,3 +356,38 @@ to run them using our preconfigured test server.
356356
1. Ask a core developer for instructions on how to set up test server
357357
credentials on your machine
358358
2. `npm test`
359+
360+
If you wish to run the tests using your own test database instance,
361+
362+
__Set up the database__
363+
364+
1. Go to pgAdmin.
365+
By default, the local database is one of the servers under Server Groups > Servers.
366+
2. Under Login Roles, add a user called ```strongloop```.
367+
368+
__Change configuration for database connection__
369+
370+
In ```test\init.js```, change the value of ```config``` to be pointing to the local database. For example,
371+
```
372+
var config = {
373+
host: 'localhost',
374+
port: '5432',
375+
database:'strongloop',
376+
username: 'postgres',
377+
password: 'postgres',
378+
};
379+
```
380+
381+
__Troubleshooting__
382+
383+
When running npm test, it runs the ```pretest.js``` which eventually runs ```schema.sql``` to set up the database and tables.
384+
If there is problem, you can run the ```schema.sql``` manually. To do this:
385+
386+
1. Go to SQL Shell (psql)
387+
2. Run:
388+
```
389+
\i <<file path>>
390+
391+
For example on Windows,
392+
\i c:\somepath\test\schema.sql
393+
```

0 commit comments

Comments
 (0)