Skip to content

Add e2e tests for LayerVersion resource update operation #68

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apis/v1alpha1/ack-generate-metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ack_generate_info:
build_date: "2022-12-08T19:01:42Z"
build_date: "2022-12-13T23:07:54Z"
build_hash: 12246c7da82841b351ec7a9e1f139f9338f2784b
go_version: go1.17.5
version: v0.21.0
go_version: go1.19
version: v0.20.1-14-g12246c7
api_directory_checksum: 90c9337a64415662f698cf6cd270706cd560bd16
api_version: v1alpha1
aws_sdk_go_version: v1.44.93
Expand Down
20 changes: 20 additions & 0 deletions test/e2e/tests/test_layer_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,26 @@ def test_smoke(self, lambda_client):
# Check layer version exists
assert lambda_validator.layer_version_exists(resource_name, version_number)

# Update cr
new_description = "new description"
updates = {
"spec": {
"description": new_description
},
}

#Patch k8s resource
k8s.patch_custom_resource(ref, updates)
time.sleep(UPDATE_WAIT_AFTER_SECONDS)

cr = k8s.wait_resource_consumed_by_controller(ref)
version_number = cr['status']['versionNumber']
Comment on lines +94 to +95
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member Author

Choose a reason for hiding this comment

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

controller-gen v0.9.0 needs to be used to regenerate the controller - also we need to keep the current tag. /hold

Done


#Check layer version description
layer_version = lambda_validator.get_layer_version(resource_name, version_number)
assert layer_version is not None
assert layer_version['Description'] == 'new description'

# Delete k8s resource
_, deleted = k8s.delete_custom_resource(ref)
assert deleted is True
Expand Down