diff --git a/.circleci/create_circleci_config.py b/.circleci/create_circleci_config.py index e000733e7159..cfd785f47ebc 100644 --- a/.circleci/create_circleci_config.py +++ b/.circleci/create_circleci_config.py @@ -133,11 +133,10 @@ def __post_init__(self): def to_dict(self): env = COMMON_ENV_VARIABLES.copy() - if self.job_name != "tests_hub": - # fmt: off - # not critical - env.update({"HF_TOKEN": "".join(["h", "f", "_", "H", "o", "d", "V", "u", "M", "q", "b", "R", "m", "t", "b", "z", "F", "Q", "O", "Q", "A", "J", "G", "D", "l", "V", "Q", "r", "R", "N", "w", "D", "M", "V", "C", "s", "d"])}) - # fmt: on + # fmt: off + # not critical + env.update({"HF_TOKEN": "".join(["h", "f", "_", "H", "o", "d", "V", "u", "M", "q", "b", "R", "m", "t", "b", "z", "F", "Q", "O", "Q", "A", "J", "G", "D", "l", "V", "Q", "r", "R", "N", "w", "D", "M", "V", "C", "s", "d"])}) + # fmt: on # Do not run tests decorated by @is_flaky on pull requests env['RUN_FLAKY'] = os.environ.get("CIRCLE_PULL_REQUEST", "") == "" @@ -284,20 +283,6 @@ def job_name(self): pytest_num_workers=4, ) -hub_job = CircleCIJob( - "hub", - additional_env={"HUGGINGFACE_CO_STAGING": True}, - docker_image=[{"image":"huggingface/transformers-torch-light"}], - install_steps=[ - 'uv pip install .', - 'git config --global user.email "ci@dummy.com"', - 'git config --global user.name "ci"', - ], - marker="is_staging_test", - pytest_num_workers=2, - resource_class="medium", -) - exotic_models_job = CircleCIJob( "exotic_models", docker_image=[{"image":"huggingface/transformers-exotic-models"}], @@ -364,7 +349,7 @@ def job_name(self): pytest_num_workers=1, ) -REGULAR_TESTS = [torch_job, hub_job, tokenization_job, processor_job, generate_job, non_model_job] # fmt: skip +REGULAR_TESTS = [torch_job, tokenization_job, processor_job, generate_job, non_model_job] # fmt: skip EXAMPLES_TESTS = [examples_torch_job] PIPELINE_TESTS = [pipelines_torch_job] REPO_UTIL_TESTS = [repo_utils_job] diff --git a/tests/repo_utils/test_tests_fetcher.py b/tests/repo_utils/test_tests_fetcher.py index d8d074ba2f4d..22e14dcbb9fe 100644 --- a/tests/repo_utils/test_tests_fetcher.py +++ b/tests/repo_utils/test_tests_fetcher.py @@ -284,6 +284,13 @@ def test_create_test_list_from_filter_routes_repo_utils_tests(self): "tests/repo_utils/test_tests_fetcher.py", ] + def test_create_test_list_from_filter_does_not_create_hub_job(self): + with tempfile.TemporaryDirectory() as tmp_folder: + create_test_list_from_filter(["tests/models/bert/test_modeling_bert.py"], out_path=tmp_folder) + + assert (Path(tmp_folder) / "tests_torch_test_list.txt").exists() + assert not (Path(tmp_folder) / "tests_hub_test_list.txt").exists() + def test_infer_tests_to_run_adds_repo_utils_for_utils_changes(self): with ExitStack() as stack: stack.enter_context(patch.object(tests_fetcher, "commit_flags", {"test_all": False}, create=True)) diff --git a/utils/tests_fetcher.py b/utils/tests_fetcher.py index 6e7b723d8f92..a138ef2eaacb 100644 --- a/utils/tests_fetcher.py +++ b/utils/tests_fetcher.py @@ -1096,7 +1096,6 @@ def parse_commit_message(commit_message: str) -> dict[str, bool]: "tests_custom_tokenizers": r"tests/models/.*/test_tokenization_(?=bert_japanese|openai|clip).*", "tests_repo_utils": r"tests/repo_utils/test_.*\.py", "pipelines_torch": r"tests/models/.*/test_modeling_.*", - "tests_hub": r"tests/.*", "tests_non_model": r"tests/[^/]*?/test_.*\.py", "tests_training_ci": r"tests/models/.*/test_modeling_.*", "tests_tensor_parallel_ci": r"(tests/models/.*/test_modeling_.*|tests/tensor_parallel(?:/test_tensor_parallel\.py)?)", @@ -1111,21 +1110,13 @@ def create_test_list_from_filter(full_test_list, out_path): to_output = [] for job_name, _filter in JOB_TO_TEST_FILE.items(): file_name = os.path.join(out_path, f"{job_name}_test_list.txt") - if job_name == "tests_hub": - files_to_test = ["tests"] - else: - files_to_test = list(re.findall(_filter, all_test_files)) + files_to_test = list(re.findall(_filter, all_test_files)) print(job_name, file_name, len(files_to_test)) if len(files_to_test) > 0: # No tests -> no file with test list to_output.append((job_name, file_name, files_to_test)) - # Only get `tests_hub`, which means we have 0 test file for all other jobs --> No job at all to run. - if len(to_output) == 1: - print("No test file found for any job, skipping `tests_hub` as well.") - to_output = [] - for _, file_name, files_to_test in to_output: with open(file_name, "w") as f: f.write("\n".join(files_to_test))