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: when:
not: <<pipeline.parameters.nightly>> not: <<pipeline.parameters.nightly>>
jobs: jobs:
- check_circleci_user
- check_code_quality
- check_repository_consistency
- fetch_tests - fetch_tests
nightly: nightly:

View File

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

View File

@ -946,28 +946,28 @@ def infer_tests_to_run(
print(f"\n### IMPACTED FILES ###\n{_print_list(impacted_files)}") print(f"\n### IMPACTED FILES ###\n{_print_list(impacted_files)}")
# Grab the corresponding test 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: if repo_utils_launch:
repo_util_file = Path(output_file).parent / "test_repo_utils.txt" repo_util_file = Path(output_file).parent / "test_repo_utils.txt"