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

[Tests] Adding New Tests For Create Experiment API with VPA Modes #1467

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

Conversation

shekhar316
Copy link
Contributor

Description

POST /createExperiment API

  • valid container experiment without experiment_type and mode=auto

  • valid container experiment without experiment_type and mode=recreate

  • valid container experiment with experiment_type and mode=auto

  • valid container experiment with experiment_type and mode=recreate

  • invalid namespace experiment with mode=auto

  • invalid namespace experiment with mode=recreate

  • invalid container experiment with experiment_type, target_cluster=remote and mode=recreate

  • invalid container experiment with experiment_type, target_cluster=remote and mode=auto

  • invalid container experiment without experiment_type, target_cluster=remote and mode=recreate

  • invalid container experiment without experiment_type, target_cluster=remote and mode=auto

  • invalid container experiment with auto mode with invalid kubernetes object type

  • invalid container experiment with recreate mode with invalid kubernetes object type

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?

On Openshift Cluster

  • New Test X
  • Functional testsuite

Test Configuration

  • Kubernetes clusters tested on: Openshift

Checklist 🎯

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

Additional information

PR # 1463 https://github.com/kruize/autotune/pull/1463/ and #1437 needs to be merged before this one.

@shekhar316 shekhar316 self-assigned this Jan 21, 2025
@shekhar316 shekhar316 added this to the Kruize 0.4 Release milestone Jan 21, 2025
@shekhar316 shekhar316 linked an issue Jan 21, 2025 that may be closed by this pull request
@shekhar316
Copy link
Contributor Author

vpatest.pdf

pytest -vv --html=tmp/report.html --cluster_type openshift test_create_experiment.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 13 items                                                                                                                                                                      

test_create_experiment.py::test_create_exp_valid_tests[valid_auto_mode_exp_with_exp_type-201-v2.0-tfb-auto-container-exp-default-resource-optimization-local-monitoring-auto-local-prometheus-1-None-deployment-tfb-qrh-sample-default-None-kruize/tfb-qrh:1.13.2.F_et17-tfb-server-15min-0.1] PASSED [  7%]
test_create_experiment.py::test_create_exp_valid_tests[valid_recreate_mode_exp_with_exp_type-201-v2.0-tfb-recreate-container-exp-default-resource-optimization-local-monitoring-recreate-local-prometheus-1-container-deployment-tfb-qrh-sample-default-None-kruize/tfb-qrh:1.13.2.F_et17-tfb-server-15min-0.1] PASSED [ 15%]
test_create_experiment.py::test_create_exp_valid_tests[valid_auto_mode_exp_without_exp_type-201-v2.0-tfb-auto-default-resource-optimization-local-monitoring-auto-local-prometheus-1-None-deployment-tfb-qrh-sample-default-None-kruize/tfb-qrh:1.13.2.F_et17-tfb-server-15min-0.1] PASSED [ 23%]
test_create_experiment.py::test_create_exp_valid_tests[valid_recreate_mode_exp_without_exp_type-201-v2.0-tfb-recreate-default-resource-optimization-local-monitoring-recreate-local-prometheus-1-container-deployment-tfb-qrh-sample-default-None-kruize/tfb-qrh:1.13.2.F_et17-tfb-server-15min-0.1] PASSED [ 30%]
test_create_experiment.py::test_create_exp_invalid_tests[invalid_namespace_exp_with_auto_mode-400-Auto or recreate mode is not supported for namespace experiment.-v2.0-tfb-workload-namespace-auto-default-resource-optimization-local-monitoring-auto-local-prometheus-1-namespace-None-None-None-default-None-None-15min-0.1] PASSED [ 38%]
test_create_experiment.py::test_create_exp_invalid_tests[invalid_namespace_exp_with_recreate_mode-400-Auto or recreate mode is not supported for namespace experiment.-v2.0-tfb-workload-namespace-recreate-default-resource-optimization-local-monitoring-recreate-local-prometheus-1-namespace-None-None-None-default-None-None-15min-0.1] PASSED [ 46%]
test_create_experiment.py::test_create_exp_invalid_tests[invalid_auto_mode_exp_with_exp_type_remote_cluster-400-Auto or recreate mode is not supported for remote monitoring use case.-v2.0-tfb-auto-container-exp-remote-default-resource-optimization-local-monitoring-auto-remote-prometheus-1-None-deployment-tfb-qrh-sample-default-None-kruize/tfb-qrh:1.13.2.F_et17-tfb-server-15min-0.1] PASSED [ 53%]
test_create_experiment.py::test_create_exp_invalid_tests[invalid_recreate_mode_exp_with_exp_type_remote_cluster-400-Auto or recreate mode is not supported for remote monitoring use case.-v2.0-tfb-recreate-container-exp-remote-default-resource-optimization-local-monitoring-recreate-remote-prometheus-1-container-deployment-tfb-qrh-sample-default-None-kruize/tfb-qrh:1.13.2.F_et17-tfb-server-15min-0.1] PASSED [ 61%]
test_create_experiment.py::test_create_exp_invalid_tests[invalid_auto_mode_exp_without_exp_type_remote_cluster-400-Auto or recreate mode is not supported for remote monitoring use case.-v2.0-tfb-auto-remote-default-resource-optimization-local-monitoring-auto-remote-prometheus-1-None-deployment-tfb-qrh-sample-default-None-kruize/tfb-qrh:1.13.2.F_et17-tfb-server-15min-0.1] PASSED [ 69%]
test_create_experiment.py::test_create_exp_invalid_tests[invalid_recreate_mode_exp_without_exp_type_remote_cluster-400-Auto or recreate mode is not supported for remote monitoring use case.-v2.0-tfb-recreate-remote-default-resource-optimization-local-monitoring-recreate-remote-prometheus-1-container-deployment-tfb-qrh-sample-default-None-kruize/tfb-qrh:1.13.2.F_et17-tfb-server-15min-0.1] PASSED [ 76%]
test_create_experiment.py::test_create_exp_invalid_tests[invalid_auto_mode_with_unsupported_object_type-400-Kubernetes object type is not supported for auto or recreate mode.-v2.0-tfb-auto-invalid-object-default-resource-optimization-local-monitoring-auto-local-prometheus-1-container-statefulset-tfb-qrh-sample-default-None-kruize/tfb-qrh:1.13.2.F_et17-tfb-server-15min-0.1] PASSED [ 84%]
test_create_experiment.py::test_create_exp_invalid_tests[invalid_recreate_mode_with_unsupported_object_type-400-Kubernetes object type is not supported for auto or recreate mode.-v2.0-tfb-recreate-invalid-object-default-resource-optimization-local-monitoring-recreate-local-prometheus-1-container-job-tfb-qrh-sample-default-None-kruize/tfb-qrh:1.13.2.F_et17-tfb-server-15min-0.1] PASSED [ 92%]
test_create_experiment.py::test_create_multiple_namespace_exp PASSED                                                                                                              [100%]

--------------------- generated html file: file:///home/shesaxen/redhat/codebase/testKruize/autotune/tests/scripts/local_monitoring_tests/rest_apis/tmp/report.html ---------------------
================================================================================== 13 passed in 13.44s ==================================================================================
~/redhat/codebase/testKruize/autotune/tests/scripts/local_monitoring_tests/rest_apis git:[vpa-test]

@shekhar316 shekhar316 requested a review from chandrams January 21, 2025 07:29
Copy link
Contributor

@chandrams chandrams left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Test Scenarios for CreateExperiment API with New VPA Modes
2 participants