Skip to content

Commit

Permalink
Enhance widgets unit tests and increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianZaccaria committed Oct 4, 2024
1 parent 9483f60 commit f1c94f0
Show file tree
Hide file tree
Showing 2 changed files with 249 additions and 111 deletions.
17 changes: 11 additions & 6 deletions src/codeflare_sdk/common/widgets/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def _on_delete_button_click(self, b):

# Refresh the dataframe
new_df = _fetch_cluster_data(namespace)
self.ray_clusters_df = new_df
if new_df.empty:
self.classification_widget.close()
self.delete_button.close()
Expand Down Expand Up @@ -387,15 +388,19 @@ def _fetch_cluster_data(namespace):
namespaces = [item.namespace for item in rayclusters]
num_workers = [item.num_workers for item in rayclusters]
head_extended_resources = [
f"{list(item.head_extended_resources.keys())[0]}: {list(item.head_extended_resources.values())[0]}"
if item.head_extended_resources
else "0"
(
f"{list(item.head_extended_resources.keys())[0]}: {list(item.head_extended_resources.values())[0]}"
if item.head_extended_resources
else "0"
)
for item in rayclusters
]
worker_extended_resources = [
f"{list(item.worker_extended_resources.keys())[0]}: {list(item.worker_extended_resources.values())[0]}"
if item.worker_extended_resources
else "0"
(
f"{list(item.worker_extended_resources.keys())[0]}: {list(item.worker_extended_resources.values())[0]}"
if item.worker_extended_resources
else "0"
)
for item in rayclusters
]
head_cpu_requests = [
Expand Down
Loading

0 comments on commit f1c94f0

Please sign in to comment.