From 745cf598c5b5f7e5cf035c462e93ff1a254bb107 Mon Sep 17 00:00:00 2001 From: zpoint Date: Thu, 19 Dec 2024 12:29:33 +0800 Subject: [PATCH] rename pre-merge test to quicktest-core (#4486) * rename to test core * rename file --- .buildkite/generate_pipeline.py | 14 +++++++------- ...est_pre_merge.py => test_quick_tests_core.py} | 16 ++++++++++------ ...e.yaml => minimal_test_quick_tests_core.yaml} | 2 +- 3 files changed, 18 insertions(+), 14 deletions(-) rename tests/smoke_tests/{test_pre_merge.py => test_quick_tests_core.py} (63%) rename tests/test_yamls/{minimal_test_pre_merge.yaml => minimal_test_quick_tests_core.yaml} (62%) diff --git a/.buildkite/generate_pipeline.py b/.buildkite/generate_pipeline.py index 2b0f1cec788..99f29ee258a 100644 --- a/.buildkite/generate_pipeline.py +++ b/.buildkite/generate_pipeline.py @@ -5,7 +5,7 @@ tests/smoke_tests ├── test_*.py -> release pipeline -├── test_pre_merge.py -> pre-merge pipeline +├── test_quick_tests_core.py -> run quick tests on PR before merging run `PYTHONPATH=$(pwd)/tests:$PYTHONPATH python .buildkite/generate_pipeline.py` to generate the pipeline for testing. The CI will run this script as a pre-step, @@ -208,8 +208,8 @@ def _convert_release(test_files: List[str]): extra_env={cloud: '1' for cloud in CLOUD_QUEUE_MAP}) -def _convert_pre_merge(test_files: List[str]): - yaml_file_path = '.buildkite/pipeline_smoke_tests_pre_merge.yaml' +def _convert_quick_tests_core(test_files: List[str]): + yaml_file_path = '.buildkite/pipeline_smoke_tests_quick_tests_core.yaml' output_file_pipelines = [] for test_file in test_files: print(f'Converting {test_file} to {yaml_file_path}') @@ -234,18 +234,18 @@ def _convert_pre_merge(test_files: List[str]): def main(): test_files = os.listdir('tests/smoke_tests') release_files = [] - pre_merge_files = [] + quick_tests_core_files = [] for test_file in test_files: if not test_file.startswith('test_'): continue test_file_path = os.path.join('tests/smoke_tests', test_file) - if "test_pre_merge" in test_file: - pre_merge_files.append(test_file_path) + if "test_quick_tests_core" in test_file: + quick_tests_core_files.append(test_file_path) else: release_files.append(test_file_path) _convert_release(release_files) - _convert_pre_merge(pre_merge_files) + _convert_quick_tests_core(quick_tests_core_files) if __name__ == '__main__': diff --git a/tests/smoke_tests/test_pre_merge.py b/tests/smoke_tests/test_quick_tests_core.py similarity index 63% rename from tests/smoke_tests/test_pre_merge.py rename to tests/smoke_tests/test_quick_tests_core.py index 4890ac15ce4..48df4ef9a2b 100644 --- a/tests/smoke_tests/test_pre_merge.py +++ b/tests/smoke_tests/test_quick_tests_core.py @@ -1,23 +1,27 @@ # Smoke tests for SkyPilot required before merging +# If the change includes an interface modification or touches the core API, +# the reviewer could decide it’s necessary to trigger a pre-merge test and +# leave a comment /quicktest-core will then trigger this test. +# # Default options are set in pyproject.toml # Example usage: # Run all tests except for AWS and Lambda Cloud -# > pytest tests/smoke_tests/test_pre_merge.py +# > pytest tests/smoke_tests/test_quick_tests_core.py # # Terminate failed clusters after test finishes -# > pytest tests/smoke_tests/test_pre_merge.py --terminate-on-failure +# > pytest tests/smoke_tests/test_quick_tests_core.py --terminate-on-failure # # Re-run last failed tests # > pytest --lf # # Run one of the smoke tests -# > pytest tests/smoke_tests/test_pre_merge.py::test_yaml_launch_and_mount +# > pytest tests/smoke_tests/test_quick_tests_core.py::test_yaml_launch_and_mount # # Only run test for AWS + generic tests -# > pytest tests/smoke_tests/test_pre_merge.py --aws +# > pytest tests/smoke_tests/test_quick_tests_core.py --aws # # Change cloud for generic tests to aws -# > pytest tests/smoke_tests/test_pre_merge.py --generic-cloud aws +# > pytest tests/smoke_tests/test_quick_tests_core.py --generic-cloud aws from smoke_tests import smoke_tests_utils @@ -29,7 +33,7 @@ def test_yaml_launch_and_mount(generic_cloud: str): test = smoke_tests_utils.Test( 'test_yaml_launch_and_mount', [ - f'sky launch -y -c {name} tests/test_yamls/minimal_test_pre_merge.yaml', + f'sky launch -y -c {name} tests/test_yamls/minimal_test_quick_tests_core.yaml', smoke_tests_utils. get_cmd_wait_until_job_status_contains_matching_job_id( cluster_name=name, diff --git a/tests/test_yamls/minimal_test_pre_merge.yaml b/tests/test_yamls/minimal_test_quick_tests_core.yaml similarity index 62% rename from tests/test_yamls/minimal_test_pre_merge.yaml rename to tests/test_yamls/minimal_test_quick_tests_core.yaml index 583575bee5c..15857e972dd 100644 --- a/tests/test_yamls/minimal_test_pre_merge.yaml +++ b/tests/test_yamls/minimal_test_quick_tests_core.yaml @@ -10,4 +10,4 @@ workdir: . num_nodes: 1 run: | - ls -l ~/aws/tests/test_yamls/minimal_test_pre_merge.yaml + ls -l ~/aws/tests/test_yamls/minimal_test_quick_tests_core.yaml