-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix compatibility issues with generic-pool v3
- restore Client.poolDefaults to allow dialect overrides - connection validators should always resolve with a boolean - rely on generic pool acquire timeouts to avoid unhandled rejections - simplify promise usage, avoiding Promise constructor anti-pattern - enable testOnBorrow in docker tests to evict broken connections - enable docker tests on Darwin - enable docker tests for mysql2 dialect
- Loading branch information
Showing
10 changed files
with
86 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
/*global describe*/ | ||
|
||
'use strict'; | ||
|
||
var os = require('os'); | ||
var proc = require('child_process') | ||
var config = require('../knexfile'); | ||
var knex = require('../../knex'); | ||
const os = require('os'); | ||
const proc = require('child_process') | ||
const config = require('../knexfile'); | ||
const knex = require('../../knex'); | ||
|
||
if (canRunDockerTests()) { | ||
var dialectName; | ||
for (dialectName in config) { | ||
for (const dialectName in config) { | ||
if (config[dialectName].docker) { | ||
require('./reconnect')(config[dialectName], knex); | ||
describe(`${dialectName} dialect`, function() { | ||
require('./reconnect')(config[dialectName], knex); | ||
}) | ||
} | ||
} | ||
} | ||
|
||
function canRunDockerTests() { | ||
var isLinux = os.platform() === 'linux'; | ||
|
||
const isLinux = os.platform() === 'linux'; | ||
const isDarwin = os.platform() === 'darwin' | ||
// dont even try on windows / osx for now | ||
var hasDocker = false; | ||
if (isLinux) { | ||
let hasDocker = false; | ||
if (isLinux || isDarwin) { | ||
hasDocker = proc.execSync('docker -v 1>/dev/null 2>&1 ; echo $?').toString('utf-8') === '0\n'; | ||
} | ||
|
||
return isLinux && hasDocker; | ||
return hasDocker; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters