dynamodb-localhost icon indicating copy to clipboard operation
dynamodb-localhost copied to clipboard

Allow to run in the background

Open mathieudevos opened this issue 6 years ago • 1 comments

As simple as this command is, this is truly required on any setup that requires testing.

Ideally in my mocha tests, I would write in the global_config.js:

/* eslint-disable */
const dynamodbLocal = require('dynamodb-localhost');

// setup the database
before(async function () {
  await dynamodbLocal.install();
  await dynamodbLocal.start({ port: 8000 });
});

// teardown
after(async function() {
  await dynamodbLocal.stop();
});

// run before each test
beforeEach(() => {});

// run after each test
afterEach(() => {});

Obviously with other test files next to it, who just make a dynamodb connection to the local test database. This setup, the serverless plugin, or the original dynamodb-local, none of them support the option to run this in the background, as such, these are all useless when attempting to run a CI/CD job on. I can't tell a pipeline to "press ctrl-c" when you're done.

mathieudevos avatar Apr 04 '18 06:04 mathieudevos

https://www.npmjs.com/package/dynamodb-local allows for running detached

ThorstenBux avatar Sep 19 '18 03:09 ThorstenBux