Skip to content
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

[Test]Refactor backward compatibility test #4906

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

zpoint
Copy link
Collaborator

@zpoint zpoint commented Mar 6, 2025

  • Remove bash
  • Run with pytest
  • Enable parallel support
    • The 50-minute tests now finish under 15 minutes

Tested (run the relevant ones):

  • Code formatting: install pre-commit (auto-check on commit) or bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • All smoke tests: /smoke-test (CI) or pytest tests/test_smoke.py (local)
  • Relevant individual tests: /smoke-test -k test_name (CI) or pytest tests/test_smoke.py::test_name (local)
  • Backward compatibility: /quicktest-core (CI) or conda deactivate; bash -i tests/backward_compatibility_tests.sh (local)

@zpoint zpoint marked this pull request as draft March 6, 2025 14:16
@zpoint
Copy link
Collaborator Author

zpoint commented Mar 10, 2025

/quicktest-core

@zpoint
Copy link
Collaborator Author

zpoint commented Mar 10, 2025

/quicktest-core

@zpoint
Copy link
Collaborator Author

zpoint commented Mar 10, 2025

/quicktest-core

@zpoint
Copy link
Collaborator Author

zpoint commented Mar 10, 2025

/quicktest-core

@zpoint zpoint requested a review from Michaelvll March 10, 2025 07:44
@zpoint zpoint marked this pull request as ready for review March 10, 2025 07:45
@Michaelvll Michaelvll requested a review from cg505 March 10, 2025 16:26
Copy link
Collaborator

@cg505 cg505 left a comment

Choose a reason for hiding this comment

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

I like the idea here! Much cleaner, thanks @zpoint!
Left some comments on the installation/setup.
Will backward compatibility testing still be included in quicktest-core?
Also, did you change any of the commands from the test, or just restructure it?

Comment on lines 17 to 35
GCLOUD_INSTALL_CMD = """
wget --quiet https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-424.0.0-linux-x86_64.tar.gz &&
tar xzf google-cloud-sdk-424.0.0-linux-x86_64.tar.gz &&
rm -rf ~/google-cloud-sdk &&
mv google-cloud-sdk ~/ &&
~/google-cloud-sdk/install.sh -q &&
echo "source ~/google-cloud-sdk/path.bash.inc" >> ~/.bashrc &&
. ~/google-cloud-sdk/path.bash.inc
"""
UV_INSTALL_CMD = 'curl -LsSf https://astral.sh/uv/install.sh | sh'

# Environment paths
BASE_ENV_DIR = pathlib.Path(
'~/sky-back-compat-base').expanduser().absolute()
CURRENT_ENV_DIR = pathlib.Path(
'~/sky-back-compat-current').expanduser().absolute()
BASE_SKY_DIR = pathlib.Path('~/sky-base').expanduser().absolute()
CURRENT_SKY_DIR = pathlib.Path('./').expanduser().absolute()
SKY_WHEEL_DIR = pathlib.Path(SKY_REMOTE_PATH).expanduser().absolute()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we avoid hardcoding the installation and specific paths? We still want people to be able to run it locally and we should let them do the tool installation, since they may want to do it another way (e.g. homebrew).
We can have a wrapper that runs on CI with the install commands and hardcoded paths.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the original logic in the sh file.
Since CI already has gcloud installed, I can raise an exception if gcloud is not installed, if that's the concern.

# Create and set up virtual environments using uv
for env_dir in [self.BASE_ENV_DIR, self.CURRENT_ENV_DIR]:
if not env_dir.exists():
_run_cmd(f'~/.local/bin/uv venv --seed --python=3.9 {env_dir}',)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we just add uv to the PATH in the CI wrapper? A dev running locally may have uv installed somewhere else.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same for gcloud. I kept the install command from sh. Do we need to remove the installation of gcloud and sh?

We already have those set up on CI.
Wondering if it would be easier for users to run and install automatically.

@zpoint
Copy link
Collaborator Author

zpoint commented Mar 11, 2025

Will backward compatibility testing still be included in quicktest-core?

Yes

Also, did you change any of the commands from the test, or just restructure it?

No, just restructured it. 8 test functions map to the original 8 steps in the sh.

@zpoint zpoint requested a review from cg505 March 11, 2025 06:17
@zpoint
Copy link
Collaborator Author

zpoint commented Mar 11, 2025

Don't commit the changes yet. Need a reply to confirm if we should remove the gcloud/uv install command since Bash already has them.

@cg505
Copy link
Collaborator

cg505 commented Mar 11, 2025

I see. I didn't realize these installations were added - they are tracing back to the client server PR (#4660). In my opinion we should avoid it, but @Michaelvll should chime in.

Also, did you change any of the commands from the test, or just restructure it?

No, just restructured it. 8 test functions map to the original 8 steps in the sh.

sounds good

@zpoint zpoint changed the title Refactor backward compatibility test [Test]Refactor backward compatibility test Mar 13, 2025
@zpoint
Copy link
Collaborator Author

zpoint commented Mar 13, 2025

/quicktest-core

@zpoint
Copy link
Collaborator Author

zpoint commented Mar 13, 2025

/quicktest-core

@zpoint
Copy link
Collaborator Author

zpoint commented Mar 14, 2025

Could u help review, thanks @Michaelvll

@Michaelvll Michaelvll requested a review from aylei March 14, 2025 02:07
@@ -0,0 +1,288 @@
import os
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we place this in the smoke test, what will happen if we trigger smoke test locally?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This cannot be run with smoke tests in parallel locally, right? Otherwise, the wheel deletion will not work correctly ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Concurrency is limited to 1 in this line.

Buildkite uses multiple workers to allow concurrent runs, but running locally with concurrency set to 1 should be fine.

Otherwise, if we want to support local concurrency, we would need to use a locking mechanism (e.g., file lock) or create 8 separate environments, which would make the test too complicated.

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.

3 participants