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

Add new e2e test case for creating GSI's with already existing attributes #88

Conversation

joaquinservetto
Copy link
Contributor

@joaquinservetto joaquinservetto commented Nov 27, 2023

Issue aws-controllers-k8s/community#1920

Description of changes:

Add e2e test for table GSIs

@ack-prow ack-prow bot requested review from a-hilaly and jaypipes November 27, 2023 20:21
@ack-prow ack-prow bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 27, 2023
Copy link

ack-prow bot commented Nov 27, 2023

Hi @joaquinservetto. Thanks for your PR.

I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

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

Thanks you @joaquinservetto !
/ok-to-test

@ack-prow ack-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 28, 2023
@a-hilaly a-hilaly changed the title e2e test new gsi with existing attributes Add new e2e test case for creating GSI's with already existing attributes Nov 28, 2023
Comment on lines +853 to +868
gsi = {
"indexName": "total-bill",
"keySchema": [
{
"attributeName": "Total",
"keyType": "HASH",
},
{
"attributeName": "Bill",
"keyType": "RANGE",
}
],
"projection": {
"projectionType": "ALL",
}
}
Copy link
Member

Choose a reason for hiding this comment

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

the controller is not able to patch this gsi and logs the error ValidationException: One or more parameter values were invalid: Both ReadCapacityUnits and WriteCapacityUnits must be specified for index: total-bill

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Weird, since It's n on-demand table It should not require the Read and Write capacity to be set, It's the bug that was solved by Julian here. But let me check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you review again? @a-hilaly

Copy link
Member

Choose a reason for hiding this comment

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

Looks good to me and tests are passing, but still wondering why do we need to use a new table here? /cc @Julian-Chu can you please take a look?

Copy link
Contributor

Choose a reason for hiding this comment

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

@a-hilaly do you mean table_basic_gsi_same_attr is not needed or combine the new test case into existing test case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you guys, I'm not an expert either, should I modify the scope then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe class or just function as the scope make more sense here.

Copy link
Contributor

Choose a reason for hiding this comment

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

withscope="class", pytest will cache the fixture for entire class, so if we want table_basic to return different table name for different methods in a class, like @joaquinservetto mentioned, I think function is more suitable.

ref: https://docs.pytest.org/en/6.2.x/fixture.html#scope-sharing-fixtures-across-classes-modules-packages-or-session

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you take a look again? @Julian-Chu @a-hilaly

Copy link
Contributor

@Julian-Chu Julian-Chu Dec 1, 2023

Choose a reason for hiding this comment

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

LGTM, my original idea is to reuse table_basic with function scope. it can be refactored later.

@ack-prow ack-prow bot added lgtm Indicates that a PR is ready to be merged. approved labels Nov 29, 2023
@a-hilaly
Copy link
Member

/test all

@ack-prow ack-prow bot removed lgtm Indicates that a PR is ready to be merged. approved labels Nov 29, 2023
Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

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

Thank you folks!! @joaquinservetto @Julian-Chu !
/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Dec 5, 2023
Copy link

ack-prow bot commented Dec 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-hilaly, joaquinservetto, Julian-Chu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-prow ack-prow bot added the approved label Dec 5, 2023
@ack-prow ack-prow bot merged commit 0aeffae into aws-controllers-k8s:main Dec 5, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants