Skip to content

Use Deno for setting up test fixtures#154

Merged
bokuweb merged 7 commits into
raiden-rs:masterfrom
magurotuna:use-deno
Sep 6, 2021
Merged

Use Deno for setting up test fixtures#154
bokuweb merged 7 commits into
raiden-rs:masterfrom
magurotuna:use-deno

Conversation

@magurotuna
Copy link
Copy Markdown
Collaborator

What does this change?

This PR replaces Node.js with Deno, and cleans up the setup script by splitting fixture data into files by table names for readability and maintainability.

Because the existing test suite pass, we can confirm that this new setup script works fine.

Comment thread setup/dynamo_util.ts
Comment on lines +36 to +37
const accessKeyId = Deno.env.get("AWS_ACCESS_KEY_ID");
const secretAccessKey = Deno.env.get("AWS_SECRET_ACCESS_KEY");
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure, but aws-sdk doesn't seem to fetch credentials from ~/.aws in Deno. Seems like we have to use environment variables to specify them.

Comment thread makefile Outdated
- docker stop dynamodb
docker run --rm -d --name dynamodb -p 8000:8000 amazon/dynamodb-local:latest
node setup
AWS_ACCESS_KEY_ID=dummy AWS_SECRET_ACCESS_KEY=dummy deno run --allow-net=localhost:8000 --allow-env --no-check ./setup/setup.ts
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, without --no-check we'd get TypeError:

error: TS2503 [ERROR]: Cannot find namespace 'NodeJS'.
export declare type GetterFromEnv<T> = (env: NodeJS.ProcessEnv) => T | undefined;
                                             ~~~~~~
    at https://cdn.skypack.dev/-/@aws-sdk/node-config-provider@v3.22.0-uQRNvqhcRLA9SCx4qjpg/dist=es2020,mode=types/dist/types/fromEnv.d.ts:3:46

@magurotuna
Copy link
Copy Markdown
Collaborator Author

@bokuweb could you rerun CI? I believe 4962f66 fixed the issue

Copy link
Copy Markdown
Member

@bokuweb bokuweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great :)

@bokuweb bokuweb merged commit dd02811 into raiden-rs:master Sep 6, 2021
@magurotuna magurotuna deleted the use-deno branch September 6, 2021 07:41
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

Successfully merging this pull request may close these issues.

2 participants