mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-15 18:48:24 +06:00
Fix CircleCI nightly run (#33558)
fix Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
parent
bdf4649f67
commit
6dc364616d
@ -82,21 +82,48 @@ jobs:
|
|||||||
parallelism: 1
|
parallelism: 1
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: uv pip install -e .
|
- run: uv pip install -U -e .
|
||||||
|
- run: echo 'export "GIT_COMMIT_MESSAGE=$(git show -s --format=%s)"' >> "$BASH_ENV" && source "$BASH_ENV"
|
||||||
|
- run: mkdir -p test_preparation
|
||||||
|
- run: python utils/tests_fetcher.py --fetch_all | tee tests_fetched_summary.txt
|
||||||
|
- run: python utils/tests_fetcher.py --filter_tests
|
||||||
|
- run: export "GIT_COMMIT_MESSAGE=$(git show -s --format=%s)" && echo $GIT_COMMIT_MESSAGE && python .circleci/create_circleci_config.py --fetcher_folder test_preparation
|
||||||
- run: |
|
- run: |
|
||||||
mkdir test_preparation
|
if [ ! -s test_preparation/generated_config.yml ]; then
|
||||||
echo -n "tests" > test_preparation/test_list.txt
|
echo "No tests to run, exiting early!"
|
||||||
echo -n "all" > test_preparation/examples_test_list.txt
|
circleci-agent step halt
|
||||||
echo -n "tests/repo_utils" > test_preparation/test_repo_utils.txt
|
fi
|
||||||
- run: |
|
|
||||||
echo -n "tests" > test_list.txt
|
|
||||||
python utils/tests_fetcher.py --filter_tests
|
|
||||||
mv test_list.txt test_preparation/filtered_test_list.txt
|
|
||||||
- run: python .circleci/create_circleci_config.py --fetcher_folder test_preparation
|
|
||||||
- run: cp test_preparation/generated_config.yml test_preparation/generated_config.txt
|
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: test_preparation/generated_config.txt
|
path: test_preparation
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: "Retrieve Artifact Paths"
|
||||||
|
env:
|
||||||
|
CIRCLE_TOKEN: ${{ secrets.CI_ARTIFACT_TOKEN }}
|
||||||
|
command: |
|
||||||
|
project_slug="gh/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"
|
||||||
|
job_number=${CIRCLE_BUILD_NUM}
|
||||||
|
url="https://circleci.com/api/v2/project/${project_slug}/${job_number}/artifacts"
|
||||||
|
curl -o test_preparation/artifacts.json ${url}
|
||||||
|
- run:
|
||||||
|
name: "Prepare pipeline parameters"
|
||||||
|
command: |
|
||||||
|
python utils/process_test_artifacts.py
|
||||||
|
|
||||||
|
# To avoid too long generated_config.yaml on the continuation orb, we pass the links to the artifacts as parameters.
|
||||||
|
# Otherwise the list of tests was just too big. Explicit is good but for that it was a limitation.
|
||||||
|
# We used:
|
||||||
|
|
||||||
|
# https://circleci.com/docs/api/v2/index.html#operation/getJobArtifacts : to get the job artifacts
|
||||||
|
# We could not pass a nested dict, which is why we create the test_file_... parameters for every single job
|
||||||
|
|
||||||
|
- store_artifacts:
|
||||||
|
path: test_preparation/transformed_artifacts.json
|
||||||
|
- store_artifacts:
|
||||||
|
path: test_preparation/artifacts.json
|
||||||
- continuation/continue:
|
- continuation/continue:
|
||||||
|
parameters: test_preparation/transformed_artifacts.json
|
||||||
configuration_path: test_preparation/generated_config.yml
|
configuration_path: test_preparation/generated_config.yml
|
||||||
|
|
||||||
check_code_quality:
|
check_code_quality:
|
||||||
|
@ -1193,9 +1193,9 @@ if __name__ == "__main__":
|
|||||||
default=None,
|
default=None,
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--commit_message",
|
"--fetch_all",
|
||||||
type=str,
|
action="store_true",
|
||||||
help="The commit message (which could contain a command to force all tests or skip the CI).",
|
help="Will fetch all tests.",
|
||||||
default=None,
|
default=None,
|
||||||
)
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
@ -1212,6 +1212,9 @@ if __name__ == "__main__":
|
|||||||
quit()
|
quit()
|
||||||
if commit_flags["no_filter"]:
|
if commit_flags["no_filter"]:
|
||||||
print("Running all tests fetched without filtering.")
|
print("Running all tests fetched without filtering.")
|
||||||
|
|
||||||
|
if args.fetch_all:
|
||||||
|
commit_flags["test_all"] = True
|
||||||
if commit_flags["test_all"]:
|
if commit_flags["test_all"]:
|
||||||
print("Force-launching all tests")
|
print("Force-launching all tests")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user