Skip to content

Commit

Permalink
use cluster name to filter pods for test
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Aikawa committed Jul 26, 2024
1 parent f8de244 commit b94cb07
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -2054,9 +2054,9 @@ def test_container_logs_multinode_kubernetes():
'container_logs_multinode_kubernetes',
[
f'sky launch -y -c {name} {task_yaml} --num-nodes 2',
'kubectl get pods -o jsonpath="{.items[*].metadata.name}" | tr " " "\n" | grep worker'
f'kubectl get pods -l skypilot-cluster-name={name} " -o jsonpath="{.items[*].metadata.name}" | tr " " "\n" | grep worker'
'| xargs -I {} kubectl logs {} | wc -l | grep 9',
'kubectl get pods -o jsonpath="{.items[*].metadata.name}" | tr " " "\n" | grep head'
f'kubectl get pods -l skypilot-cluster-name={name} -o jsonpath="{.items[*].metadata.name}" | tr " " "\n" | grep head'
'| xargs -I {} kubectl logs {} | wc -l | grep 9',
],
f'sky down -y {name}',
Expand All @@ -2069,7 +2069,8 @@ def test_container_logs_two_jobs_kubernetes():
name = _get_cluster_name()
task_yaml = 'tests/test_yamls/test_k8s_logs.yaml'
pod_logs = (
'kubectl get pods -o jsonpath="{.items[*].metadata.name}"| grep head | xargs -I {} kubectl logs {}'
f'kubectl get pods -l skypilot-cluster-name={name}'
'-o jsonpath="{.items[*].metadata.name}"| grep head | xargs -I {} kubectl logs {}'
)
with tempfile.NamedTemporaryFile(suffix='.yaml', mode='w') as f:
test = Test(
Expand Down Expand Up @@ -2099,7 +2100,8 @@ def test_container_logs_two_simultaneous_jobs_kubernetes():
name = _get_cluster_name()
task_yaml = 'tests/test_yamls/test_k8s_logs.yaml'
pod_logs = (
'kubectl get pods -o jsonpath="{.items[*].metadata.name}"| grep head | xargs -I {} kubectl logs {}'
f'kubectl get pods -l skypilot-cluster-name={name}'
'-o jsonpath="{.items[*].metadata.name}"| grep head | xargs -I {} kubectl logs {}'
)
with tempfile.NamedTemporaryFile(suffix='.yaml', mode='w') as f:
test = Test(
Expand Down

0 comments on commit b94cb07

Please sign in to comment.