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

Use Deno for setting up test fixtures #154

Merged
merged 7 commits into from
Sep 6, 2021
Merged

Conversation

magurotuna
Copy link
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 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
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.

makefile Outdated
dynamo:
- docker rm -f dynamodb
- 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
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
Collaborator Author

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

Copy link
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.

None yet

2 participants