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

[Kruize VPA Integration] [Tests] e2e Test For VPA #1498

Open
wants to merge 4 commits into
base: mvp_demo
Choose a base branch
from

Conversation

shekhar316
Copy link
Contributor

Description

Added an end-to-end test to verify the VPA workflow.
This test will -

  • Verify if vpa is created with correct name
  • Verify if vpa has correct containers
  • Verify if the recommendations are present in VPA object for each container

Fixes # (issue)
#1468

Type of change

  • Bug fix
  • New feature
  • Docs update
  • Breaking change (What changes might users need to make in their application due to this PR?)
  • Requires DB changes

How has this been tested?

Please describe the tests that were run to verify your changes and steps to reproduce. Please specify any test configuration required.

Test Configuration

  • Kubernetes clusters tested on: Openshift

Checklist 🎯

  • Followed coding guidelines
  • Comments added
  • Dependent changes merged
  • Documentation updated
  • Tests added or updated

Additional information

Future Considerations - Also verify if the pod is re created with the same recommendations.

Signed-off-by: Shekhar Saxena <[email protected]>
@shekhar316
Copy link
Contributor Author

Results on Openshift Cluster -

(Commented the delete experiment line before running, since it is still not working)

report.html.pdf

pytest -vv --html=tmp/report.html --cluster_type openshift test_vpa_e2e_workflow.py
================================================================================== test session starts ==================================================================================
platform linux -- Python 3.12.4, pytest-8.0.0, pluggy-1.4.0 -- /usr/bin/python3
cachedir: .pytest_cache
metadata: {'Python': '3.12.4', 'Platform': 'Linux-6.10.3-200.fc40.x86_64-x86_64-with-glibc2.39', 'Packages': {'pytest': '8.0.0', 'pluggy': '1.4.0'}, 'Plugins': {'metadata': '3.1.0', 'html': '3.2.0'}, 'JAVA_HOME': '/opt/jdk-21.0.1+12'}
rootdir: /home/shesaxen/redhat/codebase/testKruize/autotune/tests/scripts/local_monitoring_tests
configfile: pytest.ini
plugins: metadata-3.1.0, html-3.2.0
collected 1 item                                                                                                                                                                        

test_vpa_e2e_workflow.py::test_workflow_for_vpa_exps PASSED                                                                                                                       [100%]

=================================================================================== warnings summary ====================================================================================
rest_apis/test_vpa_e2e_workflow.py::test_workflow_for_vpa_exps
  /usr/lib/python3.12/site-packages/urllib3/connectionpool.py:1063: InsecureRequestWarning: Unverified HTTPS request is being made to host 'api.kruizevpa.lab.psi.pnq2.redhat.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
    warnings.warn(

rest_apis/test_vpa_e2e_workflow.py::test_workflow_for_vpa_exps
  /home/shesaxen/.local/lib/python3.12/site-packages/kubernetes/client/rest.py:44: DeprecationWarning: HTTPResponse.getheaders() is deprecated and will be removed in urllib3 v2.1.0. Instead access HTTPResponse.headers directly.
    return self.urllib3_response.getheaders()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
--------------------- generated html file: file:///home/shesaxen/redhat/codebase/testKruize/autotune/tests/scripts/local_monitoring_tests/rest_apis/tmp/report.html ---------------------
======================================================================= 1 passed, 2 warnings in 305.37s (0:05:05) =======================================================================

@shekhar316 shekhar316 requested a review from chandrams February 10, 2025 08:29
@shekhar316 shekhar316 marked this pull request as ready for review February 10, 2025 08:29
@chandrams chandrams added this to the Kruize 0.5 Release milestone Feb 18, 2025
@pytest.mark.test_e2e
def test_workflow_for_vpa_exps(cluster_type):
"""
Test Description: This test validates the workflow for auto and recreate mode experiments
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update test documentation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated documentation for end-to-end (e2e) tests and create experiments tests, which have been merged under PR #1467.

Signed-off-by: Shekhar Saxena <[email protected]>
@chandrams
Copy link
Contributor

@shekhar316 Has this been tested on minikube as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Under Review
Development

Successfully merging this pull request may close these issues.

2 participants