Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions tests/smoke_tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,13 +1071,15 @@ def test_kubernetes_show_gpus(generic_cloud: str):
[(
's=$(SKYPILOT_DEBUG=0 sky show-gpus --infra kubernetes) && '
'echo "$s" && '
# Grab the table header by querying for `REQUESTABLE_QTY_PER_NODE`
# using -A 1 to grab the next line as well.
# Then get the last line of the output
# (only the first line of values, exluding the table header.)
# Then, search for the correct utilization string.
'echo "$s" | grep "REQUESTABLE_QTY_PER_NODE" -A 1 | tail -n 1 | grep "8 of 8 free"'
)],
# Verify either:
# 1. We have at least one GPU entry with utilization info
# Match pattern: "<GPU_TYPE> <qty> <X> of <Y> free"
# Example : H100 1, 2, 4, 8 16 of 16 free
# OR
# 2. The cluster has no GPUs, and the expected message is shown
'(echo "$s" | grep -A 1 "REQUESTABLE_QTY_PER_NODE" | '
'grep -E "^[A-Z0-9]+[[:space:]]+[0-9, ]+[[:space:]]+[0-9]+ of [0-9]+ free" || '
'echo "$s" | grep "No GPUs found in any Kubernetes clusters")')],
)
smoke_tests_utils.run_one_test(test)

Expand Down