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

SageMaker endpoint: enhance integ test coverage for failure conditions #730

Merged
merged 1 commit into from
Mar 30, 2021

Conversation

surajkota
Copy link
Member

@surajkota surajkota commented Mar 24, 2021

Description of changes:

  • endpoint resource tests for both failure and recovery cases and asserts on conditions. See PR for details
  • tests for retainAllVariantProperties used in udpateEndpoint code path
  • enhance test coverage with multivariant endpoint config and using containers field instead or primary container and ImageConfig in model
  • wrap up resource and reference creation to helper methods to reduce duplicate code. see k8s.load_and_create_resource and related methods
  • bug fix: k8s.py helper methods related to conditions
    • wait_for_condition pre-maturely exited if the condition is nil. Depending on the case the condition maybe set later
    • _get_terminal_condition and is_resource_in_terminal_condition implementations was not correct, replaced with generic methods

Testing

Locally using pytest

Related PR: aws-controllers-k8s/sagemaker-controller#7

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

test/e2e/sagemaker/__init__.py Outdated Show resolved Hide resolved
test/e2e/sagemaker/tests/test_endpoint.py Outdated Show resolved Hide resolved
test/e2e/sagemaker/__init__.py Outdated Show resolved Hide resolved
test/e2e/sagemaker/tests/test_endpoint.py Show resolved Hide resolved
test/e2e/sagemaker/tests/test_endpoint.py Outdated Show resolved Hide resolved
@RedbackThomson
Copy link
Contributor

These helper methods should make things a lot cleaner, and the fixtures much more clearly show the test setup as compared to our previous system. Thank you!

@surajkota surajkota force-pushed the endpoint_tests_2 branch 2 times, most recently from 3c21e1f to e0345b4 Compare March 25, 2021 08:07
test/e2e/common/k8s.py Outdated Show resolved Hide resolved
test/e2e/common/k8s.py Show resolved Hide resolved
test/e2e/common/k8s.py Outdated Show resolved Hide resolved
test/e2e/common/k8s.py Outdated Show resolved Hide resolved
test/e2e/sagemaker/tests/test_transformjob.py Outdated Show resolved Hide resolved
@surajkota surajkota force-pushed the endpoint_tests_2 branch 2 times, most recently from d3d9ed8 to 53004f0 Compare March 25, 2021 18:44
@surajkota surajkota changed the title sagemaker endpoint: enhance integ test coverage for failure conditions SageMaker endpoint: enhance integ test coverage for failure conditions Mar 26, 2021

return None

def assert_condition_state_message(reference: CustomResourceReference,
Copy link
Contributor

Choose a reason for hiding this comment

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

Not seeing where assert_condition_state_message is used

Copy link
Member Author

@surajkota surajkota Mar 26, 2021

Choose a reason for hiding this comment

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

test/e2e/sagemaker/tests/test_endpoint.py line#324

Copy link
Collaborator

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

I presume a lot of the style-only changes are due to running black on the files, so this is fine. In the future, consider submitting separate PRs with style-only changes since that helps reviewers know what is a functional change and what isn't.

@jaypipes jaypipes merged commit 0fa6336 into aws-controllers-k8s:main Mar 30, 2021
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.

4 participants