Skip to content
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

Upload results.json using raw api, rather than test-collector #433

Merged
merged 11 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pipelines/main/launch_signed_jobs.yml.signature
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Salted__~ xHE�H��$B0_ ��(��������,#ag�(��9��xS��y.�vq��g�����:�Ek0�j�L��#�_�$�c�="�+�1E
Salted__،���;�lh�)L+�P��8����J�͟h�l[X��8O��zf�sފ�Q�ƛJu}�'�I��+f�Lh�BupPz=QH-{t��pm
Expand Down
Binary file modified pipelines/main/launch_upload_jobs.yml.signature
Binary file not shown.
32 changes: 28 additions & 4 deletions pipelines/main/misc/upload_buildkite_results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,38 @@ steps:
- staticfloat/cryptic#v2:
variables:
- BUILDKITE_ANALYTICS_TOKEN="U2FsdGVkX18BUSpNWNimRUOAh2ku0ugS7x3RRy1CfJBCxTLWArJpa1PXKoILfI7q"
- test-collector#v1.10.1:
files: "results*.json"
format: "json"
missing-error: 0
timeout_in_minutes: ${TIMEOUT?}
soft_fail: true
commands: |
echo "--- Downloading test results from test step"
buildkite-agent artifact download --step "test_${TRIPLET?}" "results*.json" . || true

echo "--- Uploading test results and assigning them to the test run"
export JOB_ID="$$(buildkite-agent meta-data get BUILDKITE_TEST_JOB_ID_test_${TRIPLET?} || echo "unknown")"

shopt -s nullglob # Ensure empty glob does not return a literal string
for file in results*.json; do
echo "Uploading $$file..."
# We can't use the test-collector plugin because it doesn't provide a way to set a custom `job_id`
curl \
-X POST \
--silent \
--show-error \
--max-time "${TIMEOUT?}" \
-H "Authorization: Token token=\"$$BUILDKITE_ANALYTICS_TOKEN\"" \
-F "data=@\"$$file\"" \
-F "format=json" \
-F "run_env[CI]=buildkite" \
-F "run_env[key]=\"$$BUILDKITE_BUILD_ID\"" \
-F "run_env[url]=\"$$BUILDKITE_BUILD_URL\"" \
-F "run_env[branch]=\"$$BUILDKITE_BRANCH\"" \
-F "run_env[commit_sha]=\"$$BUILDKITE_COMMIT\"" \
-F "run_env[number]=\"$$BUILDKITE_BUILD_NUMBER\"" \
-F "run_env[job_id]=\"$$JOB_ID\"" \
-F "run_env[message]=\"$$(printf “%q” “$$BUILDKITE_MESSAGE”)\"" \
https://analytics-api.buildkite.com/v1/uploads
echo "\n"
done
agents:
queue: "julia"
env:
Expand Down
3 changes: 1 addition & 2 deletions pipelines/scheduled/coverage/coverage.yml.signature
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Salted___��x^�|gB�>��O$9���'����ZW�ҷ�fSiqy�VՌ���`rIW�
��h���6�Yq.�5�����2����
Salted__F5*�P3ߩ��oi'��� 4:�1�s�A:�U��=t���!�:_�`}��o����>K0�,d�Q��~d3)Q�^�xFK��
Binary file modified pipelines/scheduled/launch_signed_jobs.yml.signature
Binary file not shown.
3 changes: 2 additions & 1 deletion pipelines/scheduled/launch_upload_jobs.yml.signature
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Salted__���`��&Z��AkY�c�Æ"Y�O��H�M�M���Y��叱k �Gq��H��_L�I.'�8�$�Z�}X NA. rh� �xɈ
Salted__��F�"� ���z5���!@6�C`s_2�b��I�ti�s�FN �ԂKڹn2��y���~��.�P�
�f����C�dHwh9L�.�}�hE�
Expand Down
7 changes: 5 additions & 2 deletions utilities/test_julia.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ if [[ "${USE_RR-}" == "rr" ]] || [[ "${USE_RR-}" == "rr-net" ]]; then

# Do not run Pkg tests on rr
TESTS_TO_SKIP+=( Pkg )

# rr: all tests EXCEPT the network-related tests
# rr-net: ONLY the network-related tests
NETWORK_RELATED_TESTS=( Artifacts Downloads download LazyArtifacts LibGit2/online)
Expand Down Expand Up @@ -160,8 +160,11 @@ else
fi

echo "--- Upload results.json report"
# store the test job id so that the upload job can assign the results to the right job id
buildkite-agent meta-data set BUILDKITE_TEST_JOB_ID_${BUILDKITE_STEP_KEY} "${BUILDKITE_JOB_ID}"
echo "meta-data BUILDKITE_TEST_JOB_ID_${BUILDKITE_STEP_KEY} has been set to \"$(buildkite-agent meta-data get BUILDKITE_TEST_JOB_ID_${BUILDKITE_STEP_KEY})\""
if compgen -G "${JULIA_INSTALL_DIR}/share/julia/test/results*.json"; then
(cd "${JULIA_INSTALL_DIR}/share/julia/test"; buildkite-agent artifact upload results*.json)
(cd "${JULIA_INSTALL_DIR}/share/julia/test"; buildkite-agent artifact upload "results*.json")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes this from JuliaLang/julia#57686

2025-03-09 20:18:09 INFO   Found 1 files that match "results_ArgTools_1.json"
fatal: failed to upload artifacts: uploading artifacts: creating uploader: invalid upload destination: 'results_Artifacts_1.json'. Only s3://*, gs://*, rt://*, or https://*.blob.core.windows.net destinations are allowed. Did you forget to surround your artifact upload pattern in double quotes?

else
echo "no JSON results files found"
fi
Expand Down