Skip to content

Commit

Permalink
Fix tests when running the daskhub tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgianaElena committed Jun 28, 2024
1 parent 81440ef commit 736fcad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 11 additions & 1 deletion deployer/commands/deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,17 @@ def run_hub_health_check(
values_file = config_file_path.parent.joinpath(values_file)
config = yaml.load(values_file)
# Check if there's config that enables dask-gateway
dask_gateway_enabled = config.get("dask-gateway", {}).get("enabled", False)
if config.get("basehub", {}):
dask_gateway_enabled = (
config.get("basehub", {})
.get("dask-gateway", {})
.get("enabled", False)
)
else:
dask_gateway_enabled = config.get("dask-gateway", {}).get(
"enabled", False
)

if dask_gateway_enabled:
break

Expand Down
6 changes: 3 additions & 3 deletions deployer/health_check_tests/test_hub_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ async def check_hub_health(hub_url, test_notebook_path, service_api_token):
async def test_hub_healthy(hub_url, api_token, notebook_dir, check_dask_scaling):
try:
print(f"Starting hub {hub_url} health validation...")
for root, directories, files in os.walk(notebook_dir, topdown=False):
for i, name in enumerate(files):
for root, _, files in os.walk(notebook_dir, topdown=False):
for _, name in enumerate(files):
# We only want to run the "scale_dask_workers.ipynb" file if the
# check_dask_scaling variable is true. We continue in the loop if
# check_dask_scaling == False when we iterate over this file.
print(f"Running {name} test notebook...")
if (not check_dask_scaling) and (name == "scale_dask_workers.ipynb"):
continue

print(f"Running {name} test notebook...")
test_notebook_path = os.path.join(root, name)
await check_hub_health(hub_url, test_notebook_path, api_token)

Expand Down

0 comments on commit 736fcad

Please sign in to comment.