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

feat: Initial dynamodb-ns implementation #800

Merged
merged 3 commits into from
Mar 17, 2023
Merged

Conversation

jhvhs
Copy link
Member

@jhvhs jhvhs commented Mar 16, 2023

#184673495

Checklist:

Copy link
Member

@blgm blgm left a comment

Choose a reason for hiding this comment

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

Looks good. There's an improvement to the test code that would be good to do, but I'd be happy with it being fixed in a subsequent PR.

terraformProvisionDir string
)

defaultVars := map[string]any{
Copy link
Member

Choose a reason for hiding this comment

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

From the Ginkgo docs:

Information is shared between closures via closure variables. It is idiomatic for these closure variables to be declared within the container node closure and initialized in the setup node closure. Doing so ensures that each spec has a pristine, correctly initialized, copy of the shared variable.

Initialising a non-const outside of a BeforeEach() can lead to subtle issues that are hard to debug as if one testcase alters the value, another testcase will the the altered value and not the original (expected) value. Because testcases run in random order, these issues take ages to debug.

Copy link
Member

Choose a reason for hiding this comment

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

On seconds thoughts, this is an ordered test with a BeforeAll() rather than a BeforeEach(), so while the above point is true, the risk is lower as the tests are not randomised.

@blgm blgm merged commit 2553af4 into main Mar 17, 2023
@blgm blgm deleted the 184673495-dynamo-bootstrap branch March 17, 2023 14:08
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