minor PR comments
This commit is contained in:
parent
8d46780006
commit
27eb00223d
@ -27,14 +27,6 @@ const PUBLIC_USER = environment.postgres.user;
|
|||||||
const PUBLIC_USER_PASSWORD = environment.postgres.password;
|
const PUBLIC_USER_PASSWORD = environment.postgres.password;
|
||||||
const TEST_DB = `${TEST_USER}_db`;
|
const TEST_DB = `${TEST_USER}_db`;
|
||||||
|
|
||||||
async function startRedis () {
|
|
||||||
// await exec(`redis-server --port ${REDIS_PORT} --loadmodule ${REDIS_CELL_PATH} --logfile ${__dirname}/redis-server.log --daemonize yes`);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function stopRedis () {
|
|
||||||
// await exec(`redis-cli -p ${REDIS_PORT} shutdown`);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function dropDatabase () {
|
async function dropDatabase () {
|
||||||
await exec(`dropdb --if-exists ${TEST_DB}`, {
|
await exec(`dropdb --if-exists ${TEST_DB}`, {
|
||||||
env: Object.assign({ PGUSER: 'postgres', PGHOST: PGHOST, PGPORT: PGPORT }, process.env)
|
env: Object.assign({ PGUSER: 'postgres', PGHOST: PGHOST, PGPORT: PGPORT }, process.env)
|
||||||
@ -153,7 +145,6 @@ async function main (args) {
|
|||||||
try {
|
try {
|
||||||
switch (args[0]) {
|
switch (args[0]) {
|
||||||
case 'setup':
|
case 'setup':
|
||||||
await startRedis();
|
|
||||||
await populateRedis();
|
await populateRedis();
|
||||||
await dropDatabase();
|
await dropDatabase();
|
||||||
await createDatabase();
|
await createDatabase();
|
||||||
@ -161,7 +152,6 @@ async function main (args) {
|
|||||||
await populateDatabase();
|
await populateDatabase();
|
||||||
break;
|
break;
|
||||||
case 'teardown':
|
case 'teardown':
|
||||||
await stopRedis();
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Error('Missing "mode" argument. Valid ones: "setup" or "teardown"');
|
throw new Error('Missing "mode" argument. Valid ones: "setup" or "teardown"');
|
||||||
|
Loading…
Reference in New Issue
Block a user