Skip to content

Commit

Permalink
Add symlink log smoke test and fix formatting in warning string
Browse files Browse the repository at this point in the history
  • Loading branch information
ShreyasKallingal committed Jul 22, 2024
1 parent 79ae197 commit b967306
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sky/utils/log_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def create_and_symlink_log_dir(log_dir: str):
os.remove(symlink_path)
else:
logger.warning((
'Failed to create symlink to latest logs at \'{symlink_path}\'.'
f'Failed to create symlink to latest logs at \'{symlink_path}\'.'
'Please remove the existing file/directory.'))
return
os.symlink(log_dir, symlink_path)
18 changes: 18 additions & 0 deletions tests/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,24 @@ def test_scp_logs():
run_one_test(test)


@pytest.mark.kubernetes
def test_symlink_latest_logs():
test = Test(
'symlink_latest_logs',
[
'sky local up || true',
'eval symlink_path="~/sky_logs/sky_latest"; [ -L "$symlink_path" ] || exit 1 ;'
'target_file=$(readlink -f "$symlink_path") || exit 1 ;'
'sky local down || true ;'
'[ -L "$symlink_path" ] || exit 1 ;'
'target_file2=$(readlink -f "$symlink_path") ;'
'[ "$target_file" != "$target_file2" ] || exit 1'
],
'sky local down',
)
run_one_test(test)


# ---------- Job Queue. ----------
@pytest.mark.no_fluidstack # FluidStack DC has low availability of T4 GPUs
@pytest.mark.no_lambda_cloud # Lambda Cloud does not have T4 gpus
Expand Down

0 comments on commit b967306

Please sign in to comment.