Skip to content

Commit 453a70e

Browse files
dresendedougwilson
authored andcommitted
tests: use MYSQL_SOCKET env var to define socketPath
1 parent 753cc7d commit 453a70e

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,9 @@ $ FILTER=unit npm test
13211321
### Running integration tests
13221322

13231323
Set the environment variables `MYSQL_DATABASE`, `MYSQL_HOST`, `MYSQL_PORT`,
1324-
`MYSQL_USER` and `MYSQL_PASSWORD`. Then run `npm test`.
1324+
`MYSQL_USER` and `MYSQL_PASSWORD`. `MYSQL_SOCKET` can also be used in place
1325+
of `MYSQL_HOST` and `MYSQL_PORT` to connect over a UNIX socket. Then run
1326+
`npm test`.
13251327

13261328
For example, if you have an installation of mysql running on localhost:3306
13271329
and no password set for the `root` user, run:

test/common.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,11 @@ common.getSSLConfig = function() {
146146

147147
function mergeTestConfig(config) {
148148
config = common.extend({
149-
host : process.env.MYSQL_HOST,
150-
port : process.env.MYSQL_PORT,
151-
user : process.env.MYSQL_USER,
152-
password : process.env.MYSQL_PASSWORD
149+
host : process.env.MYSQL_HOST,
150+
port : process.env.MYSQL_PORT,
151+
user : process.env.MYSQL_USER,
152+
password : process.env.MYSQL_PASSWORD,
153+
socketPath : process.env.MYSQL_SOCKET
153154
}, config);
154155

155156
return config;

0 commit comments

Comments
 (0)