Compare commits

...

2 Commits

Author SHA1 Message Date
dbf50e4f9d run 2023-10-06 18:10:28 +02:00
62df8adb7d run 2023-10-06 16:54:54 +02:00
3 changed files with 38 additions and 40 deletions

View File

@ -217,9 +217,6 @@ workflows:
when:
not: <<pipeline.parameters.nightly>>
jobs:
- check_circleci_user
- check_code_quality
- check_repository_consistency
- fetch_tests
nightly:

View File

@ -311,7 +311,7 @@ torch_job = CircleCIJob(
"pip install -U --upgrade-strategy eager git+https://github.com/huggingface/accelerate",
],
parallelism=1,
pytest_num_workers=8,
pytest_num_workers=6,
)
@ -347,6 +347,7 @@ pipelines_torch_job = CircleCIJob(
"pip install -U --upgrade-strategy eager .[sklearn,torch,testing,sentencepiece,torch-speech,vision,timm,video]",
],
marker="is_pipeline_test",
pytest_num_workers=6,
)
@ -536,15 +537,15 @@ doc_test_job = CircleCIJob(
)
REGULAR_TESTS = [
torch_and_tf_job,
torch_and_flax_job,
# torch_and_tf_job,
# torch_and_flax_job,
torch_job,
tf_job,
flax_job,
custom_tokenizers_job,
hub_job,
onnx_job,
exotic_models_job,
# tf_job,
# flax_job,
# custom_tokenizers_job,
# hub_job,
# onnx_job,
# exotic_models_job,
]
EXAMPLES_TESTS = [
examples_torch_job,
@ -553,7 +554,7 @@ EXAMPLES_TESTS = [
]
PIPELINE_TESTS = [
pipelines_torch_job,
pipelines_tf_job,
# pipelines_tf_job,
]
REPO_UTIL_TESTS = [repo_utils_job]
DOC_TESTS = [doc_test_job]
@ -622,8 +623,8 @@ def create_circleci_config(folder=None):
else:
job.tests_to_run = [f for f in example_tests.split(" ") if f.startswith(f"examples/{framework}")]
if len(job.tests_to_run) > 0:
jobs.append(job)
# if len(job.tests_to_run) > 0:
# jobs.append(job)
doctest_file = os.path.join(folder, "doctest_list.txt")
if os.path.exists(doctest_file):
@ -631,12 +632,12 @@ def create_circleci_config(folder=None):
doctest_list = f.read()
else:
doctest_list = []
if len(doctest_list) > 0:
jobs.extend(DOC_TESTS)
# if len(doctest_list) > 0:
# jobs.extend(DOC_TESTS)
repo_util_file = os.path.join(folder, "test_repo_utils.txt")
if os.path.exists(repo_util_file) and os.path.getsize(repo_util_file) > 0:
jobs.extend(REPO_UTIL_TESTS)
# if os.path.exists(repo_util_file) and os.path.getsize(repo_util_file) > 0:
# jobs.extend(REPO_UTIL_TESTS)
if len(jobs) == 0:
jobs = [EmptyJob()]

View File

@ -946,28 +946,28 @@ def infer_tests_to_run(
print(f"\n### IMPACTED FILES ###\n{_print_list(impacted_files)}")
# Grab the corresponding test files:
if "setup.py" in modified_files:
test_files_to_run = ["tests", "examples"]
repo_utils_launch = True
else:
# All modified tests need to be run.
test_files_to_run = [
f for f in modified_files if f.startswith("tests") and f.split(os.path.sep)[-1].startswith("test")
]
# Then we grab the corresponding test files.
test_map = create_module_to_test_map(reverse_map=reverse_map, filter_models=filter_models)
for f in modified_files:
if f in test_map:
test_files_to_run.extend(test_map[f])
test_files_to_run = sorted(set(test_files_to_run))
# Remove repo utils tests
test_files_to_run = [f for f in test_files_to_run if not f.split(os.path.sep)[1] == "repo_utils"]
# Remove SageMaker tests
test_files_to_run = [f for f in test_files_to_run if not f.split(os.path.sep)[1] == "sagemaker"]
# Make sure we did not end up with a test file that was removed
test_files_to_run = [f for f in test_files_to_run if (PATH_TO_REPO / f).exists()]
repo_utils_launch = any(f.split(os.path.sep)[0] == "utils" for f in modified_files)
test_files_to_run = ["tests", "examples"]
repo_utils_launch = True
# else:
# # All modified tests need to be run.
# test_files_to_run = [
# f for f in modified_files if f.startswith("tests") and f.split(os.path.sep)[-1].startswith("test")
# ]
# # Then we grab the corresponding test files.
# test_map = create_module_to_test_map(reverse_map=reverse_map, filter_models=filter_models)
# for f in modified_files:
# if f in test_map:
# test_files_to_run.extend(test_map[f])
# test_files_to_run = sorted(set(test_files_to_run))
# # Remove repo utils tests
# test_files_to_run = [f for f in test_files_to_run if not f.split(os.path.sep)[1] == "repo_utils"]
# # Remove SageMaker tests
# test_files_to_run = [f for f in test_files_to_run if not f.split(os.path.sep)[1] == "sagemaker"]
# # Make sure we did not end up with a test file that was removed
# test_files_to_run = [f for f in test_files_to_run if (PATH_TO_REPO / f).exists()]
#
# repo_utils_launch = any(f.split(os.path.sep)[0] == "utils" for f in modified_files)
if repo_utils_launch:
repo_util_file = Path(output_file).parent / "test_repo_utils.txt"