-
Notifications
You must be signed in to change notification settings - Fork 402
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
[Feature] Improve the observability of integration tests #775
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this contribution!
@kevin85421 @DmitriGekhtman Thanks for the suggestion. I have updated my pr. |
Was there a Git issue? I think we lost most of the changes (I see |
@DmitriGekhtman Because the label utilized in the original |
To improve the observability of integration tests, I called |
LGTM, I'll merge this after the CI finishes running. |
tests/compatibility-test.py
Outdated
@@ -198,6 +193,7 @@ def test_ray_serve(self): | |||
exit_code, _ = utils.exec_run_container(container, f'python3 /usr/local/test_ray_serve_1.py {ray_namespace}', timeout_sec = 180) | |||
|
|||
if exit_code != 0: | |||
show_cluster_info("default") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found that we hard-coded a lot of "default" in both test_ray_serve
and test_detached_actor
. How about creating a local variable in each test to replace this hard-coded method?
For example,
utils.get_pod(namespace='default', label_selector='ray.io/node-type=head')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests/compatibility-test.py
Outdated
'kubectl logs $(kubectl get pods | grep -e "-head" | awk "{print \$1}")') | ||
shell_subprocess_run( | ||
'kubectl logs -n $(kubectl get pods -A | grep -e "-operator" | awk \'{print $1 " " $2}\')') | ||
show_cluster_info("default") | ||
assert rtn == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the assert and raise an exception in the if
statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated 7d640b0.
@kevin85421 Thanks for the suggestion. I have updated the pr. |
tests/compatibility-test.py
Outdated
|
||
def test_ray_serve(self): | ||
cluster_name_space = "default" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cluster_namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update in bc948f2.
@kevin85421 Thanks for the suggestion. I have updated the pr. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Wait for CI to pass.
…#775) Show debug information in failed test cases. Make operator label consistent across Kustomize and Helm deployment methods.
…#775) Show debug information in failed test cases. Make operator label consistent across Kustomize and Helm deployment methods.
Why are these changes needed?
Add
app.kubernetes.io/component: kuberay-operator
label in helm-chart/kuberay-operator/templates/deployment.yaml to make operator pod can be selected inshow_cluster_info()
.Why not call
show_cluster_info()
in tearDown()?The only way I found to check if the test pass in
teardown()
is to access the private fieldself._outcome
in unittest.TestCase object(reference). The fields inself._outcome
changes in Python 3.11. It seems like accessingself._outcome
in unittest.TestCase is not a robust approach.Why added hard code label
app.kubernetes.io/component=kuberay-operator
?Because all of the labels app.kubernetes.io/component: for the operator is hard code with value kuberay-operato, I added app.kubernetes.io/component: kuberay-operator to the helm chart to make
show_cluster_info
able to get logs from the operator pod.Related issue number
Closes #766
Checks