-
Notifications
You must be signed in to change notification settings - Fork 71
Extract build mode from relocatable packages for proper timeout configuration #705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Modified ScyllaCluster.__init__ to extract build mode from install_dir when both install_dir and cassandra_version are provided - Moved __set_default_timeouts() call after parent init to ensure scylla_mode is properly set - Added comprehensive tests for build mode extraction with different modes (debug, dev, release) - All existing tests pass Co-authored-by: fruch <[email protected]>
tests/test_build_mode_extraction.py
Outdated
| def test_scylla_cluster_init_extracts_mode_from_install_dir(): | ||
| """Test that ScyllaCluster.__init__ extracts build mode from install_dir when cassandra_version is also provided.""" | ||
|
|
||
| with tempfile.TemporaryDirectory() as tmpdir: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there a pytest fixture for this, please use that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use the tmp_path pytest fixture in commit 38a90c9.
tests/test_build_mode_extraction.py
Outdated
| """Test that timeouts are correctly set based on build mode.""" | ||
|
|
||
| with tempfile.TemporaryDirectory() as tmpdir: | ||
| test_cases = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot use parmeterize for those cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use @pytest.mark.parametrize in commit 3d35f1b. The test now runs as 3 separate test instances (one for each mode: debug, release, dev).
Replaced manual tempfile usage with the tmp_path pytest fixture as suggested in code review. This is the standard pytest approach for temporary directories and is more consistent with other tests in the repository. Co-authored-by: fruch <[email protected]>
Refactored test_scylla_cluster_timeout_settings to use @pytest.mark.parametrize instead of a for loop. This creates 3 separate test instances (one for each mode) which provides better test isolation and clearer output when tests fail. Co-authored-by: fruch <[email protected]>
Plan to add build mode support for relocatable packages
Summary of Changes
Problem: Relocatable packages had
scylla_modehardcoded toNone, which prevented proper support for different build types (debug/dev/release).Solution:
Modified
ScyllaCluster.__init__(ccmlib/scylla_cluster.py):install_dirandcassandra_versionare provided (e.g., when loading a cluster from disk), the build mode is now extracted from the install directory usingscylla_extract_install_dir_and_mode()load_from_repository(), but wasn't being used when loading from diskFixed timeout calculation:
__set_default_timeouts()call to afterCluster.__init__()to ensurescylla_modeis properly set before calculating timeoutsAdded comprehensive tests (tests/test_build_mode_extraction.py):
tmp_pathpytest fixture per code review@pytest.mark.parametrizefor better test isolationImpact: Relocatable packages now properly support different build modes (debug/dev/release), with appropriate timeout values for each mode.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.