Skip to content

Conversation

@khansaad
Copy link
Contributor

@khansaad khansaad commented Jul 31, 2025

Description

This PR contains functional tests for the request_id feature added as part of the PR #1620

Fixes # (issue)

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.

  • 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

$ pytest -m requestId -v --html=/tmp/req-id.html --cluster_type openshift
============================================================ test session starts ============================================================
platform linux -- Python 3.13.5, pytest-8.4.1, pluggy-1.6.0 -- /usr/bin/python3
cachedir: .pytest_cache
metadata: {'Python': '3.13.5', 'Platform': 'Linux-6.15.6-200.fc42.x86_64-x86_64-with-glibc2.41', 'Packages': {'pytest': '8.4.1', 'pluggy': '1.6.0'}, 'Plugins': {'metadata': '3.1.1', 'html': '3.2.0', 'anyio': '4.9.0'}, 'JAVA_HOME': '/home/saakhan/Documents/java/jdk-17.0.1+12'}
rootdir: /home/saakhan/Saad/Autotune/Tasks/request-id-tests/autotune/tests/scripts/remote_monitoring_tests
configfile: pytest.ini
plugins: metadata-3.1.1, html-3.2.0, anyio-4.9.0
collected 440 items / 422 deselected / 18 selected                                                                                          

test_create_experiment.py::test_create_exp_with_valid_request_id PASSED                                                               [  5%]
test_create_experiment.py::test_create_exp_with_invalid_request_id[] PASSED                                                           [ 11%]
test_create_experiment.py::test_create_exp_with_invalid_request_id[abc123] PASSED                                                     [ 16%]
test_create_experiment.py::test_create_exp_with_invalid_request_id[zABkkM9D0aKG2vZWcPQueCoum5o00NjEj] PASSED                          [ 22%]
test_create_experiment.py::test_create_exp_with_invalid_request_id[1234567890abcdef!@#$%^&*()] PASSED                                 [ 27%]
test_create_experiment.py::test_create_exp_with_invalid_request_id[                                ] PASSED                           [ 33%]
test_update_recommendations.py::test_update_recommendations_with_valid_request_id PASSED                                              [ 38%]
test_update_recommendations.py::test_update_recommendations_with_invalid_request_id[] PASSED                                          [ 44%]
test_update_recommendations.py::test_update_recommendations_with_invalid_request_id[abc123] PASSED                                    [ 50%]
test_update_recommendations.py::test_update_recommendations_with_invalid_request_id[q6sDBkyA5MTV0uodBR1yB2xRXau2uPEgY] PASSED         [ 55%]
test_update_recommendations.py::test_update_recommendations_with_invalid_request_id[1234567890abcdef!@#$%^&*()] PASSED                [ 61%]
test_update_recommendations.py::test_update_recommendations_with_invalid_request_id[                                ] PASSED          [ 66%]
test_update_results.py::test_update_results_with_valid_request_id PASSED                                                              [ 72%]
test_update_results.py::test_update_results_with_invalid_request_id[] PASSED                                                          [ 77%]
test_update_results.py::test_update_results_with_invalid_request_id[abc123] PASSED                                                    [ 83%]
test_update_results.py::test_update_results_with_invalid_request_id[pmo3hwL7N8PiG6tNpgYJ9dkPat2jVBTDr] PASSED                         [ 88%]
test_update_results.py::test_update_results_with_invalid_request_id[1234567890abcdef!@#$%^&*()] PASSED                                [ 94%]
test_update_results.py::test_update_results_with_invalid_request_id[                                ] PASSED                          [100%]

----------------------------------------------- generated html file: file:///tmp/req-id.html ------------------------------------------------
============================================== 18 passed, 422 deselected in 134.81s (0:02:14) ===============================================

@khansaad khansaad added this to the Kruize 0.7_prod release milestone Jul 31, 2025
@khansaad khansaad requested a review from chandrams July 31, 2025 14:56
@khansaad khansaad self-assigned this Jul 31, 2025
@khansaad khansaad added the test label Jul 31, 2025
@khansaad khansaad moved this to Under Review in Monitoring Jul 31, 2025
Signed-off-by: Saad Khan <[email protected]>
request_id = generate_request_id(32)
temp_file_path = inject_request_id_and_save(result_json_file, request_id)

response = update_results(temp_file_path)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add validation to check the logs for the presence of request_id messages

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@chandrams
Copy link
Contributor

@khansaad Can you please share the test results?

# Conflicts:
#	tests/scripts/remote_monitoring_tests/rest_apis/test_update_results.py
@khansaad
Copy link
Contributor Author

khansaad commented Aug 2, 2025

@khansaad Can you please share the test results?
kruize_test_results.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Under Review

Development

Successfully merging this pull request may close these issues.

2 participants