diff --git a/bin/cli b/bin/cli index c5c61fbf6..002288648 100755 --- a/bin/cli +++ b/bin/cli @@ -7,6 +7,7 @@ const program = require('commander'); const pkg = require('../package.json'); const dotenv = require('dotenv'); +const util = require('../util'); //============================================================================== // Setting up the program command line arguments. @@ -15,6 +16,7 @@ const dotenv = require('dotenv'); program .version(pkg.version) .option('-c, --config [path]', 'Specify the configuration file to load') + .option('--pid [path]', 'Specify a path to output the current PID to') .parse(process.argv); if (program.config) { @@ -27,6 +29,11 @@ if (program.config) { } } +// If the `--pid` flag is used, put the current pid there. +if (program.pid) { + util.pid(program.pid); +} + // Perform rewrites to the runtime environment variables based on the contents // of the process.env.REWRITE_ENV if it exists. This is done here as it is the // entrypoint for the entire application. @@ -43,4 +50,15 @@ program // If there is no command listed, output help. if (!process.argv.slice(2).length) { program.outputHelp(); + return; } + +// The ensures that the child process that is created here is always cleaned up +// properly when the parent process dies. +util.onshutdown([ + (signal) => { + if ((program.runningCommand.killed === false) && (program.runningCommand.exitCode === null)) { + program.runningCommand.kill(signal); + } + } +]); diff --git a/circle.yml b/circle.yml index 160bc7bb9..c511715a5 100644 --- a/circle.yml +++ b/circle.yml @@ -21,6 +21,8 @@ test: override: # Run the tests using the junit reporter. - MOCHA_FILE=$CIRCLE_TEST_REPORTS/junit/test-results.xml NPM_PACKAGE_CONFIG_MOCHA_REPORTER=mocha-junit-reporter npm run test + # Run the e2e test suite + - E2E_REPORT_PATH=$CIRCLE_TEST_REPORTS/e2e npm run e2e deployment: release: diff --git a/client/coral-admin/src/components/ModerationList.js b/client/coral-admin/src/components/ModerationList.js index 8ce3ec4a4..c1df40d31 100644 --- a/client/coral-admin/src/components/ModerationList.js +++ b/client/coral-admin/src/components/ModerationList.js @@ -8,10 +8,10 @@ import SuspendUserModal from './SuspendUserModal'; // Each action has different meaning and configuration const menuOptionsMap = { - 'reject': {status: 'rejected', icon: 'close', key: 'r'}, - 'approve': {status: 'accepted', icon: 'done', key: 't'}, - 'flag': {status: 'flagged', icon: 'flag', filter: 'Untouched'}, - 'ban': {status: 'banned', icon: 'not interested'} + 'reject': {status: 'REJECTED', icon: 'close', key: 'r'}, + 'approve': {status: 'ACCEPTED', icon: 'done', key: 't'}, + 'flag': {status: 'FLAGGED', icon: 'flag', filter: 'Untouched'}, + 'ban': {status: 'BANNED', icon: 'not interested'} }; // Renders a comment list and allow performing actions @@ -135,9 +135,9 @@ export default class ModerationList extends React.Component { } else if (action.item_type === 'USERS') { // If a user bio or name is rejected, bring up a dialog before suspending them. - if (menuOption === 'rejected') { + if (menuOption === 'REJECTED') { this.setState({suspendUserModal: action}); - } else if (menuOption === 'accepted') { + } else if (menuOption === 'ACCEPTED') { this.props.userStatusUpdate('ACTIVE', action.item_id); } } diff --git a/client/coral-embed-stream/src/Comment.js b/client/coral-embed-stream/src/Comment.js index 93c89ffb0..529420941 100644 --- a/client/coral-embed-stream/src/Comment.js +++ b/client/coral-embed-stream/src/Comment.js @@ -87,7 +87,7 @@ class Comment extends React.Component { return (