Skip to content

Commit b8cf852

Browse files
committed
Merge branch 'YQ-3560-pq' of github.com:kardymonds/ydb into YQ_3583
2 parents a886f70 + b0e74de commit b8cf852

File tree

329 files changed

+8187
-4450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

329 files changed

+8187
-4450
lines changed

.github/actions/test_ya/action.yml

Lines changed: 65 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ runs:
8686
https://api.github.com/repos/${{github.repository}}/statuses/${{github.event.pull_request.head.sha}} \
8787
-d '{"state":"pending","description":"The check has been started","context":"build_${{inputs.build_preset}}"}'
8888
89-
if [[ "${{inputs.run_tests}}" == "true" ]];then
89+
if [[ "${{inputs.run_tests}}" == "true" ]]; then
9090
curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{github.token}}" -H "X-GitHub-Api-Version: 2022-11-28" \
9191
https://api.github.com/repos/${{github.repository}}/statuses/${{github.event.pull_request.head.sha}} \
9292
-d '{"state":"pending","description":"The check has been started","context":"test_${{inputs.build_preset}}"}'
@@ -143,11 +143,18 @@ runs:
143143
echo "NODE_TLS_REJECT_UNAUTHORIZED=0" >> $GITHUB_ENV
144144
fi
145145
146+
- name: Setup cache
147+
shell: bash
148+
run: |
149+
export BAZEL_REMOTE_PASSWORD_FILE=$(mktemp)
150+
echo "${{ inputs.bazel_remote_password }}" > $BAZEL_REMOTE_PASSWORD_FILE
151+
echo "BAZEL_REMOTE_PASSWORD_FILE=$BAZEL_REMOTE_PASSWORD_FILE" >> $GITHUB_ENV
152+
146153
- name: ya build and test
147154
id: build
148155
shell: bash
149156
run: |
150-
set -x
157+
set -ex
151158
echo "Artifacts will be uploaded [here](${PUBLIC_DIR_URL}/index.html)" | GITHUB_TOKEN="${{ github.token }}" .github/scripts/tests/comment-pr.py
152159
153160
ORIGINAL_HEAD=$(git rev-parse HEAD)
@@ -187,6 +194,7 @@ runs:
187194
)
188195
189196
TEST_RETRY_COUNT=${{ inputs.test_retry_count }}
197+
IS_TEST_RESULT_IGNORED=0
190198
191199
case "$BUILD_PRESET" in
192200
debug)
@@ -212,6 +220,7 @@ runs:
212220
if [ $TEST_RETRY_COUNT -z ]; then
213221
TEST_RETRY_COUNT=1
214222
fi
223+
IS_TEST_RESULT_IGNORED=1
215224
;;
216225
release-tsan)
217226
params+=(
@@ -221,6 +230,7 @@ runs:
221230
if [ $TEST_RETRY_COUNT -z ]; then
222231
TEST_RETRY_COUNT=1
223232
fi
233+
IS_TEST_RESULT_IGNORED=1
224234
;;
225235
release-msan)
226236
params+=(
@@ -230,12 +240,15 @@ runs:
230240
if [ $TEST_RETRY_COUNT -z ]; then
231241
TEST_RETRY_COUNT=1
232242
fi
243+
IS_TEST_RESULT_IGNORED=1
233244
;;
234245
*)
235246
echo "Invalid preset: $BUILD_PRESET"
236247
exit 1
237248
;;
238249
esac
250+
251+
echo "IS_TEST_RESULT_IGNORED=$IS_TEST_RESULT_IGNORED" >> $GITHUB_ENV
239252
240253
if [ $TEST_RETRY_COUNT -z ]; then
241254
# default is 3 for ordinary build and 1 for sanitizer builds
@@ -253,7 +266,7 @@ runs:
253266

254267
if [ "${{ inputs.put_build_results_to_cache }}" = "true" ]; then
255268
params+=(--bazel-remote-username "${{ inputs.bazel_remote_username }}")
256-
params+=(--bazel-remote-password "${{ inputs.bazel_remote_password }}")
269+
params+=(--bazel-remote-password-file "$BAZEL_REMOTE_PASSWORD_FILE")
257270
params+=(--bazel-remote-put --dist-cache-max-file-size=209715200)
258271
fi
259272

@@ -371,12 +384,12 @@ runs:
371384

372385
CURRENT_JUNIT_XML_PATH=$CURRENT_PUBLIC_DIR/junit.xml
373386
CURRENT_REPORT=$CURRENT_PUBLIC_DIR/report.json
374-
set +ex
387+
set +e
375388
(./ya make $YA_MAKE_TARGET "${params[@]}" \
376389
$RERUN_FAILED_OPT --log-file "$PUBLIC_DIR/ya_log.log" \
377390
--evlog-file "$CURRENT_PUBLIC_DIR/ya_evlog.jsonl" \
378391
--junit "$CURRENT_JUNIT_XML_PATH" --build-results-report "$CURRENT_REPORT" --output "$YA_MAKE_OUT_DIR"; echo $? > exit_code) |& cat >> $YA_MAKE_OUTPUT
379-
set -ex
392+
set -e
380393
RC=`cat exit_code`
381394

382395
.github/scripts/tests/report_analyzer.py --report_file "$CURRENT_REPORT" --summary_file $CURRENT_PUBLIC_DIR/summary_report.txt || true
@@ -399,7 +412,7 @@ runs:
399412
gzip -c $CURRENT_JUNIT_XML_PATH > $CURRENT_PUBLIC_DIR/orig_junit.xml.gz
400413

401414
# postprocess junit report
402-
.github/scripts/tests/transform-ya-junit.py -i \
415+
.github/scripts/tests/transform_ya_junit.py -i \
403416
-m .github/config/muted_ya.txt \
404417
--ya_out "$YA_MAKE_OUT_DIR" \
405418
--public_dir "$PUBLIC_DIR" \
@@ -434,6 +447,7 @@ runs:
434447
--status_report_file statusrep.txt \
435448
--is_retry $IS_RETRY \
436449
--is_last_retry $IS_LAST_RETRY \
450+
--is_test_result_ignored $IS_TEST_RESULT_IGNORED \
437451
--comment_color_file summary_color.txt \
438452
--comment_text_file summary_text.txt \
439453
"Tests" $CURRENT_PUBLIC_DIR/ya-test.html "$CURRENT_JUNIT_XML_PATH"
@@ -513,7 +527,7 @@ runs:
513527
set -x
514528
if [ true = ${{ inputs.run_tests }} ]; then
515529
teststatus=$(cat statusrep.txt)
516-
if [[ $teststatus == "success" ]];then
530+
if [[ $teststatus == "success" ]]; then
517531
testmessage="The check has been completed successfully"
518532
else
519533
testmessage="The check has been failed"
@@ -522,7 +536,7 @@ runs:
522536
https://api.github.com/repos/${{github.repository}}/statuses/${{github.event.pull_request.head.sha}} \
523537
-d '{"state":"'$teststatus'","description":"'"$testmessage"'","context":"test_${{inputs.build_preset}}"}'
524538
525-
if [[ $teststatus != "success" ]];then
539+
if [[ $teststatus != "success" ]]; then
526540
echo "status=failed" >> $GITHUB_OUTPUT
527541
fi
528542
fi
@@ -531,8 +545,48 @@ runs:
531545
if: inputs.run_tests
532546
shell: bash
533547
run: |
534-
.github/scripts/tests/fail-checker.py "$LAST_JUNIT_REPORT_XML"
548+
if [ $IS_TEST_RESULT_IGNORED == 0 ]; then
549+
.github/scripts/tests/fail-checker.py "$LAST_JUNIT_REPORT_XML"
550+
fi
535551
552+
- name: show diff mute_ya.txt
553+
if: inputs.build_preset == 'relwithdebinfo' && (github.event_name == 'pull_request' || github.event_name == 'pull_request_target')
554+
shell: bash
555+
continue-on-error: true
556+
env:
557+
GITHUB_TOKEN: ${{ github.token }}
558+
run: |
559+
ORIGINAL_HEAD=$(git rev-parse HEAD)
560+
get_file_diff_script=.github/scripts/tests/get_diff_lines_of_file.py
561+
file_to_check=.github/config/muted_ya.txt
562+
check_result=`$get_file_diff_script --base_sha $ORIGINAL_HEAD~1 --head_sha $ORIGINAL_HEAD --file_path $file_to_check`
563+
if [[ ${check_result} == *"not changed" ]];then
564+
echo file ${file_to_check} NOT changed
565+
else
566+
echo file ${file_to_check} changed
567+
.github/scripts/tests/get_muted_tests.py --output_folder "$PUBLIC_DIR/mute_info/" get_mute_diff --base_sha $ORIGINAL_HEAD~1 --head_sha $ORIGINAL_HEAD --job-id "${{ github.run_id }}" --branch "${GITHUB_REF_NAME}"
568+
FILE_PATH=$PUBLIC_DIR/mute_info/2_new_muted_tests.txt
569+
SEPARATOR=""
570+
if [ -f "$FILE_PATH" ]; then
571+
LINE_COUNT=$(wc -l < "$FILE_PATH")
572+
if [ "$LINE_COUNT" -gt 0 ]; then
573+
SEPARATOR=', '
574+
MESSAGE="Muted new $LINE_COUNT [tests](${PUBLIC_DIR_URL}/mute_info/2_new_muted_tests.txt)"
575+
fi
576+
fi
577+
FILE_PATH=$PUBLIC_DIR/mute_info/3_unmuted_tests.txt
578+
if [ -f "$FILE_PATH" ]; then
579+
LINE_COUNT_unmute=$(wc -l < "$FILE_PATH")
580+
if [ "$LINE_COUNT_unmute" -gt 0 ]; then
581+
MESSAGE="${MESSAGE}${SEPARATOR}Unmuted $LINE_COUNT_unmute [tests](${PUBLIC_DIR_URL}/mute_info/3_unmuted_tests.txt)"
582+
fi
583+
fi
584+
if [ -n "$MESSAGE" ]; then
585+
printf "$MESSAGE" | .github/scripts/tests/comment-pr.py --color orange
586+
fi
587+
fi
588+
589+
536590
- name: sync results to s3 and publish links
537591
if: always()
538592
shell: bash
@@ -585,7 +639,7 @@ runs:
585639
read -ra comment_arr <<< "$comment_raw"
586640
587641
printf "$comment"
588-
if [[ ${comment_raw} != "Error"* ]];then
642+
if [[ ${comment_raw} != "Error"* ]]; then
589643
color=${comment_arr[0]}
590644
replace=$color";;;"
591645
comment=${comment_raw/$replace/""}
@@ -602,4 +656,4 @@ runs:
602656
env:
603657
BUILD_PRESET: ${{ inputs.build_preset }}
604658
GITHUB_TOKEN: ${{ github.token }}
605-
run: echo "Check cancelled" | .github/scripts/tests/comment-pr.py --color black
659+
run: echo "Check cancelled" | .github/scripts/tests/comment-pr.py --color black

0 commit comments

Comments
 (0)