-
Notifications
You must be signed in to change notification settings - Fork 28.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CircleCI nightly run #33558
Fix CircleCI nightly run #33558
Conversation
- 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: | | ||
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 | ||
if [ ! -s test_preparation/generated_config.yml ]; then | ||
echo "No tests to run, exiting early!" | ||
circleci-agent step halt | ||
fi | ||
|
||
- 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: | ||
configuration_path: test_preparation/generated_config.yml | ||
parameters: test_preparation/transformed_artifacts.json | ||
configuration_path: test_preparation/generated_config.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just copied from - fetch_tests
with a single difference
run: python utils/tests_fetcher.py | tee tests_fetched_summary.txt
becomes
run: python utils/tests_fetcher.py --fetch_all | tee tests_fetched_summary.txt
@@ -1193,9 +1193,9 @@ def create_test_list_from_filter(full_test_list, out_path): | |||
default=None, | |||
) | |||
parser.add_argument( | |||
"--commit_message", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is never used.
(The actual used one is commit_message = repo.head.commit.message
)
if args.fetch_all: | ||
commit_flags["test_all"] = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might not be perfect to do this, but it's a minimal change to make it work
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for cleaning up after my mess!
fix Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
What does this PR do?
Currently on
main
, it always givesempty
as jobs.