Skip to content

[Test] Read stored lifecycle hooks without the sqlite3 CLI - #11375

Merged
lloyd-brown merged 1 commit into
masterfrom
lloyd/fix-hook-tests-sqlite3-cli
Nov 19, 2026
Merged

lloyd-brown merged 1 commit into
masterfrom
lloyd/fix-hook-tests-sqlite3-cli

Conversation

@lloyd-brown

@lloyd-brown lloyd-brown commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Several lifecycle hook smoke tests (test_hook_lifecycle_combined, test_hook_clear_via_relaunch, test_hook_sky_exec_does_not_clear_stored_hooks, test_hook_relaunch_propagates_after_stop, test_hook_relaunch_preserves_autostop) inspect ~/.sky/skylet_config.db by running the sqlite3 CLI on the cluster via sky exec. That binary is not present on every cloud's default image (the Nebius default image, ubuntu24.04-driverless, is the likely case), so those steps fail with exit 100 on Nebius while passing on AWS, GCP, Azure and Kubernetes.

This replaces the inline sqlite3 commands with a shared _INSPECT_STORED_HOOKS_CMD that reads the same key with Python's built-in sqlite3 module from the SkyPilot runtime env (constants.SKY_REMOTE_PYTHON_ENV). Output format (one value per row, nothing if the key is absent) and all grep assertions are unchanged. Also fixes pre-existing pylint warnings in the file so it scores 10.00.

Tested

  • Simulated both call patterns (sky exec c '<cmd>' and inspect='<cmd>' && sky exec c "$inspect") locally against a sample skylet_config.db; output matches and grep assertions pass.
  • bash format.sh; pylint 10.00/10 on the file.
  • Nebius smoke test triggered below.

🤖 Generated with Claude Code


Devin Review

The lifecycle hook smoke tests inspected ~/.sky/skylet_config.db by
running the `sqlite3` CLI on the cluster, which is not installed on
every cloud's default image (e.g. Nebius), so those steps failed with
exit 100 there. Read the DB with Python's built-in sqlite3 module from
the SkyPilot runtime env instead, via a shared constant. The queried key
and the grep assertions are unchanged.

Also fix pre-existing pylint warnings in the file (long lines, an
unused variable, a double-quoted string).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lloyd-brown

Copy link
Copy Markdown
Collaborator Author

FILE_PATTERN=test_lifecycle_hooks.py /smoke-test -k "test_hook_lifecycle_combined or test_hook_clear_via_relaunch" --nebius

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@lloyd-brown
lloyd-brown merged commit 0daf335 into master Nov 19, 2026
22 of 23 checks passed
@lloyd-brown
lloyd-brown deleted the lloyd/fix-hook-tests-sqlite3-cli branch November 19, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants