Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local testing with Dynamo DB #139

Closed
daemonsy opened this issue Jun 27, 2017 · 9 comments
Closed

Local testing with Dynamo DB #139

daemonsy opened this issue Jun 27, 2017 · 9 comments

Comments

@daemonsy
Copy link

daemonsy commented Jun 27, 2017

Hey Amazon, thanks for the ASK SDK. It made skill development much nicer.

I made a skill for NYC's subway and implemented some tests.

The next feature I wanted to add was persisting state and it seems that I should be able to write some tests using DynamoDB local. I was wondering if there's any way to expose the dynamo client so we can use a local client by via something like new AWS.DynamoDB({ endpoint: <local endpoint> }). This will make the skill testing much more meaningful.

Also, if you're willing to accept PRs, happy to take a stab at this.

@daemonsy
Copy link
Author

Hi, I added a very naive PR for this.

#140

@daemonsy
Copy link
Author

Anyone had a chance to take a look at this?

@abhilash1in
Copy link

@daemonsy Does the official SDK support alexa.dynamoDBClient?

@daemonsy
Copy link
Author

daemonsy commented Jul 29, 2017

The official one doesn't, this is the PR #140 to attempt to add support for it

@jhurliman
Copy link

Allowing a custom AWS client to be passed in would also make this library compatible with AWS X-Ray (see https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-nodejs-awssdkclients.html).

@daemonsy
Copy link
Author

hi, thanks everyone for the interest on this. I haven't heard anything from Amazon yet. It originally came with a PR, but now so much time's passed, not sure if the PR still works anymore.

I will strongly advise not to use my branch.

Adding another ping for Amazon here. @Amazon-tianrenz

@tianrenz
Copy link
Contributor

Hi all,

thanks for all the discussion on this thread. The latest SDK release 1.0.25 has enabled developer to inject their own dynamoDB client.

Regards

@adamgruber
Copy link

@Amazon-tianrenz Is there documentation or an example for how to inject a local dynamoDB client for testing?

@tianrenz
Copy link
Contributor

Hi @adamgruber,

We currently do not have such a sample. But now it's very easy to inject your own DynamoDB client into the DynamoDBPersistenceAdapter (see here). You can setup your local DynamoDB follow this link. And then in your DynamoDBClient, just set the endpoint to point to local host.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants