From: Chocobozzz Date: Thu, 30 Jun 2016 19:58:48 +0000 (+0200) Subject: Do not generate a random password for test env X-Git-Tag: v0.0.1-alpha~845 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=d14b3e37a2c0d647b59259bf2ca059b5817f144c;p=github%2FChocobozzz%2FPeerTube.git Do not generate a random password for test env --- diff --git a/server/initializers/installer.js b/server/initializers/installer.js index 53b07903c..059fcd8d8 100644 --- a/server/initializers/installer.js +++ b/server/initializers/installer.js @@ -81,7 +81,18 @@ function createOAuthUserIfNotExist (callback) { logger.info('Creating the administrator.') const username = 'root' - const password = passwordGenerator(8, true) + let password = '' + + // Do not generate a random password for tests + if (process.env.NODE_ENV === 'test') { + password = 'test' + + if (process.env.NODE_APP_INSTANCE) { + password += process.env.NODE_APP_INSTANCE + } + } else { + password = passwordGenerator(8, true) + } Users.createUser(username, password, function (err) { if (err) return callback(err)