Skip to content

test: adopt-or-create adoption-policy #158

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 1 commit into from
May 5, 2025

Conversation

michaelhtm
Copy link
Member

@michaelhtm michaelhtm commented Apr 8, 2025

Description of changes:
Adding two new tests for adopt-or-create:

  • Test that adopts an existing resource, and updates it with manifest configurations
  • Test that attempts to adopt a non-existent resource, so it creates it instead

:)
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-prow ack-prow bot requested review from a-hilaly and jlbutler April 8, 2025 17:33
@ack-prow ack-prow bot added the approved label Apr 8, 2025
@michaelhtm michaelhtm force-pushed the test/adopt-or-create branch 7 times, most recently from 7c2c0e5 to 4962194 Compare April 8, 2025 22:11
@michaelhtm michaelhtm changed the title test: adopt-or-create adoption-policy test: adopt-or-create adoption-policy Apr 21, 2025
@michaelhtm michaelhtm force-pushed the test/adopt-or-create branch from 4962194 to d1a7386 Compare April 22, 2025 17:12
@michaelhtm michaelhtm force-pushed the test/adopt-or-create branch from d1a7386 to ad234b2 Compare May 2, 2025 20:21
Copy link

ack-prow bot commented May 2, 2025

@michaelhtm: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
s3-verify-attribution ad234b2 link false /test s3-verify-attribution

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

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.

noice!

@@ -101,10 +118,11 @@ def adopt_stack_bucket(s3_client):
@service_marker
@pytest.mark.canary
class TestAdoptionPolicyBucket:
def test_adoption_policy(
self, s3_client, adoption_policy_adopt_bucket, s3_resource
@pytest.mark.resource_data({'adoption-policy': AdoptionPolicy.ADOPT, 'filename': 'bucket_adopt', 'resource-name': 'adopt'})
Copy link

Choose a reason for hiding this comment

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

Q: Where is the "adopt" bucket being created?

Copy link
Member Author

Choose a reason for hiding this comment

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

it get's created in bucket_adoption_policy fixture. The bucket itself is bootstrapped aws-controllers-k8s/community#2425

@@ -132,6 +150,49 @@ def test_adoption_policy(
assert latest is not None
versioning = latest.Versioning()
assert versioning.status == status

@pytest.mark.resource_data({'adoption-policy': AdoptionPolicy.ADOPT_OR_CREATE, 'filename': 'bucket_adopt_or_create', 'resource-name': 'adopt-or-create'})
Copy link

Choose a reason for hiding this comment

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

Q: Is there any validation that the "adopt-or-create" bucket doesn't exist prior to the test running?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, but we use the same bucket we used in the previous test. Just to ensure the bucket can also get adopted with adopt-or-create policy, and update is called immediately after

@rushmash91
Copy link
Member

nice 👍
/lgtm

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

ack-prow bot commented May 5, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-hilaly, michaelhtm, rushmash91

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:
  • OWNERS [a-hilaly,michaelhtm,rushmash91]

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 merged commit 375fc38 into aws-controllers-k8s:main May 5, 2025
6 of 7 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants