-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add e2e tests for LayerVersion
resource update operation
#68
Conversation
Skipping CI for Draft Pull Request. |
/test all |
70973a1
to
e63af8b
Compare
/test all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Vandita2020 the PR summary says you are just updating e2e tests for layer versions, however I see some functional changes in this PR (to delta.go and sdk.go) which indicates this is more than just a change to e2e tests :) Can you either update the PR summary and description to incorporate those functional changes or remove the functional changes from this PR?
Thank you!
-jay
e63af8b
to
001512e
Compare
/test all |
Hey @jaypipes, |
001512e
to
4df5b40
Compare
/test all |
test/e2e/tests/test_layer_version.py
Outdated
@@ -79,6 +79,19 @@ def test_smoke(self, lambda_client): | |||
# Check layer version exists | |||
assert lambda_validator.layer_version_exists(resource_name, version_number) | |||
|
|||
logging.info(cr['spec']['description']) | |||
# Update cr | |||
cr['spec']['description'] = 'new description' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Vandita2020 Instead of passing in an updated cr
object, try just passing in the things you want to update.
Follow this example which shows you how to do this:
(I agree it's a bit weird! :) )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaypipes Thanks so much for sharing this, I was really looking for another way to update the fields.
4df5b40
to
e3cc9db
Compare
/test all |
e3cc9db
to
37b5b15
Compare
/test all |
1 similar comment
/test all |
37b5b15
to
245d0f8
Compare
/test all |
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.9.2 | ||
controller-gen.kubebuilder.io/version: v0.7.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to install codegen v0.9.2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
cr = k8s.wait_resource_consumed_by_controller(ref) | ||
version_number = cr['status']['versionNumber'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
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
config/controller/kustomization.yaml
Outdated
@@ -6,4 +6,4 @@ kind: Kustomization | |||
images: | |||
- name: controller | |||
newName: public.ecr.aws/aws-controllers-k8s/lambda-controller | |||
newTag: v0.1.4 | |||
newTag: v0.1.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and pull the all the repository tags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
name: v1 | ||
annotations: | ||
services.k8s.aws/region: us-west-2 | ||
spec: | ||
layerName: $LAYER_VERSION | ||
layerName: v1 | ||
content: | ||
s3Bucket: $BUCKET_NAME | ||
s3Key: $LAMBDA_FILE_NAME | ||
s3Bucket: 322962841005-lambda-test | ||
s3Key: my-deployment-package.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the reason e2e tests are failing is that you forgot to undo the changes made to this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks
245d0f8
to
7875344
Compare
/test all |
LayerVersion
resource update operation
|
7875344
to
258d338
Compare
/test all |
go.mod
Outdated
k8s.io/api v0.24.0 | ||
k8s.io/apimachinery v0.24.0 | ||
k8s.io/client-go v0.24.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert the changes made in go.mod
and go.sum
files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
build_date: "2022-12-13T20:52:55Z" | ||
build_hash: 39d7c30b8df3c44a9804f578cd6acc9a3f669b03 | ||
go_version: go1.19 | ||
version: v0.20.1-15-g39d7c30-dirty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: make sure that you're generating the controller with a non dirty version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -2,7 +2,7 @@ apiVersion: lambda.services.k8s.aws/v1alpha1 | |||
kind: LayerVersion | |||
metadata: | |||
name: $LAYER_VERSION | |||
annotations: | |||
annotations: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: unnecessary space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
test/e2e/tests/test_layer_version.py
Outdated
CREATE_WAIT_AFTER_SECONDS = 30 | ||
UPDATE_WAIT_AFTER_SECONDS = 30 | ||
DELETE_WAIT_AFTER_SECONDS = 30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you figured out what was the issue with layer_version tests, shall we reduce those values to 10?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
258d338
to
b5aaced
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @Vandita2020 !
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thanks @Vandita2020!
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: A-Hilaly, jaypipes, Vandita2020 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 |
Description of changes:
Add e2e tests for
LayerVersion
resource update operationBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.