78
78
jobs_url="https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/jobs"
79
79
# tricky: we are searching job with name that contains build_preset
80
80
check_url=$(curl -s $jobs_url | jq --arg n "$BUILD_PRESET" -r '.jobs[] | select(.name | contains($n)) | .html_url')
81
-
81
+
82
82
platform_name="$(echo "$(uname -s)-$(uname -p)" | tr '[:upper:]' '[:lower:]')-$BUILD_PRESET"
83
83
echo "Pre-commit [check]($check_url) **$platform_name** for $(git rev-parse HEAD) has started." | .github/scripts/tests/comment-pr.py --rewrite
84
84
@@ -91,19 +91,19 @@ runs:
91
91
https://api.github.com/repos/${{github.repository}}/statuses/${{github.event.pull_request.head.sha}} \
92
92
-d '{"state":"pending","description":"The check has been started","context":"test_${{inputs.build_preset}}"}'
93
93
fi
94
-
94
+
95
95
- name : Clean ya cache
96
96
shell : bash
97
97
run : rm -rf ~/.ya
98
-
98
+
99
99
- name : Init
100
100
id : init
101
101
shell : bash
102
102
run : |
103
103
set -x
104
-
104
+
105
105
echo "$(pwd)/ydb/ci/scripts" >> $GITHUB_PATH
106
-
106
+
107
107
export TMP_DIR=$(pwd)/tmp
108
108
rm -rf $TMP_DIR
109
109
mkdir -p $TMP_DIR
@@ -129,14 +129,14 @@ runs:
129
129
openssl req -x509 -newkey rsa:2048 \
130
130
-keyout $TMP_DIR/key.pem -out $TMP_DIR/cert.pem \
131
131
-sha256 -days 1 -nodes -subj "/CN=127.0.0.1"
132
-
132
+
133
133
TESTMO_TOKEN=${{ inputs.testman_token }} ./ydb/ci/testmo-proxy/testmo-proxy.py -l $TESTMO_PROXY_ADDR \
134
134
--cert-file "$TMP_DIR/cert.pem" \
135
135
--cert-key "$TMP_DIR/key.pem" \
136
136
--target-timeout 3,60 \
137
137
--max-request-time 200 \
138
138
"$TESTMO_URL" > $PUBLIC_DIR/testmo_proxy_log.txt 2>&1 &
139
-
139
+
140
140
TESTMO_PROXY_PID=$!
141
141
echo "TESTMO_PROXY_ADDR=$TESTMO_PROXY_ADDR" >> $GITHUB_ENV
142
142
echo "TESTMO_PROXY_PID=$TESTMO_PROXY_PID" >> $GITHUB_ENV
@@ -160,7 +160,7 @@ runs:
160
160
echo "Artifacts will be uploaded [here](${PUBLIC_DIR_URL}/index.html)" | GITHUB_TOKEN="${{ github.token }}" .github/scripts/tests/comment-pr.py
161
161
162
162
ORIGINAL_HEAD=$(git rev-parse HEAD)
163
-
163
+
164
164
if [ "${{ inputs.increment }}" = "true" ]; then
165
165
GRAPH_COMPARE_OUTPUT="$PUBLIC_DIR/graph_compare_log.txt"
166
166
GRAPH_COMPARE_OUTPUT_URL="$PUBLIC_DIR_URL/graph_compare_log.txt"
@@ -177,7 +177,7 @@ runs:
177
177
echo "Graph compare failed, see the [logs]($GRAPH_COMPARE_OUTPUT_URL)." | GITHUB_TOKEN="${{ github.token }}" .github/scripts/tests/comment-pr.py --color red
178
178
exit $RC
179
179
fi
180
-
180
+
181
181
git checkout $ORIGINAL_HEAD
182
182
YA_MAKE_TARGET=.
183
183
else
@@ -197,15 +197,15 @@ runs:
197
197
198
198
TEST_RETRY_COUNT=${{ inputs.test_retry_count }}
199
199
IS_TEST_RESULT_IGNORED=0
200
-
200
+
201
201
case "$BUILD_PRESET" in
202
202
debug)
203
203
params+=(--build "debug")
204
204
;;
205
205
relwithdebinfo)
206
206
params+=(--build "relwithdebinfo")
207
207
;;
208
- release)
208
+ release)
209
209
params+=(--build "release")
210
210
;;
211
211
release-asan)
@@ -237,14 +237,14 @@ runs:
237
237
exit 1
238
238
;;
239
239
esac
240
-
240
+
241
241
echo "IS_TEST_RESULT_IGNORED=$IS_TEST_RESULT_IGNORED" >> $GITHUB_ENV
242
242
243
243
if [ $TEST_RETRY_COUNT -z ]; then
244
244
# default is 3 for ordinary build and 1 for sanitizer builds
245
245
TEST_RETRY_COUNT=3
246
246
fi
247
-
247
+
248
248
if [ ! -z "${{ inputs.additional_ya_make_args }}" ]; then
249
249
params+=(${{ inputs.additional_ya_make_args }})
250
250
fi
@@ -267,15 +267,15 @@ runs:
267
267
268
268
params+=(
269
269
--stat -DCONSISTENT_DEBUG --no-dir-outputs
270
- --test-failure-code 0 --build-all
270
+ --test-failure-code 0 --build-all
271
271
--cache-size 2TB --force-build-depends
272
272
)
273
273
274
274
275
275
TESTMO_BRANCH_TAG="$GITHUB_REF_NAME"
276
276
TESTMO_ARCH="${{ runner.arch == 'X64' && 'x86-64' || runner.arch == 'ARM64' && 'arm64' || 'unknown' }}"
277
277
TESTMO_PR_NUMBER=${{ github.event.number }}
278
-
278
+
279
279
case "$BUILD_PRESET" in
280
280
relwithdebinfo)
281
281
TESTMO_SOURCE="ya-${TESTMO_ARCH}"
@@ -329,7 +329,7 @@ runs:
329
329
;;
330
330
esac
331
331
332
- echo "TESTMO_RUN_NAME=$TESTMO_RUN_NAME" >> $GITHUB_ENV
332
+ echo "TESTMO_RUN_NAME=$TESTMO_RUN_NAME" >> $GITHUB_ENV
333
333
if [ $RETRY != 1 ]; then
334
334
IS_RETRY=1
335
335
TESTMO_RUN_NAME="$TESTMO_RUN_NAME A$RETRY"
@@ -342,6 +342,8 @@ runs:
342
342
export CURRENT_PUBLIC_DIR=$PUBLIC_DIR/$CURRENT_PUBLIC_DIR_RELATIVE
343
343
export CURRENT_PUBLIC_DIR_URL=$PUBLIC_DIR_URL/$CURRENT_PUBLIC_DIR_RELATIVE
344
344
mkdir $CURRENT_PUBLIC_DIR
345
+ export TEST_META_INFO=$CURRENT_PUBLIC_DIR/tests_meta
346
+ mkdir $TEST_META_INFO
345
347
346
348
if [ ${{ inputs.testman_token }} ]; then
347
349
# inititalize testmo session
@@ -362,7 +364,7 @@ runs:
362
364
echo "10 [Test history](${TESTMO_HISTORY_URL})" >> $SUMMARY_LINKS
363
365
fi
364
366
365
- CURRENT_MESSAGE="ya make is running..."
367
+ CURRENT_MESSAGE="ya make is running..."
366
368
if [ $IS_RETRY = 0 ]; then
367
369
CURRENT_MESSAGE="$CURRENT_MESSAGE"
368
370
RERUN_FAILED_OPT=""
@@ -409,9 +411,15 @@ runs:
409
411
fi
410
412
411
413
# fix junit files (add links, logs etc)
412
- # archive unitest reports (orig)
414
+ # archive unitest reports (orig)
413
415
gzip -c $CURRENT_JUNIT_XML_PATH > $CURRENT_PUBLIC_DIR/orig_junit.xml.gz
414
416
417
+ # postprocess junit user_attributesreport
418
+ .github/scripts/tests/apply_user_properties_to_junit.py \
419
+ --test_dir="$TEST_META_INFO" \
420
+ --in_file="$CURRENT_JUNIT_XML_PATH" \
421
+ --out_file="$CURRENT_JUNIT_XML_PATH" || true
422
+
415
423
# postprocess junit report
416
424
.github/scripts/tests/transform_ya_junit.py -i \
417
425
-m .github/config/muted_ya.txt \
@@ -433,7 +441,7 @@ runs:
433
441
IS_LAST_RETRY=1
434
442
fi
435
443
436
- if [ $FAILED_TESTS_COUNT -gt 500 ]; then
444
+ if [ $FAILED_TESTS_COUNT -gt 500 ]; then
437
445
IS_LAST_RETRY=1
438
446
TOO_MANY_FAILED="Too many tests failed, NOT going to retry"
439
447
echo $TOO_MANY_FAILED | GITHUB_TOKEN="${{ github.token }}" .github/scripts/tests/comment-pr.py --color red
@@ -459,7 +467,7 @@ runs:
459
467
if [ "${{ inputs.run_tests }}" = "true" ]; then
460
468
cat summary_text.txt | GITHUB_TOKEN="${{ github.token }}" .github/scripts/tests/comment-pr.py --color `cat summary_color.txt`
461
469
fi
462
-
470
+
463
471
# upload tests results to YDB
464
472
ydb_upload_run_name="${TESTMO_RUN_NAME// /"_"}"
465
473
result=`.github/scripts/analytics/upload_tests_results.py --test-results-file ${CURRENT_JUNIT_XML_PATH} --run-timestamp $(date +%s) --commit $(git rev-parse HEAD) --build-type ${BUILD_PRESET} --pull $ydb_upload_run_name --job-name "${{ github.workflow }}" --job-id "${{ github.run_id }}" --branch ${GITHUB_REF_NAME}`
@@ -473,7 +481,7 @@ runs:
473
481
.github/scripts/tests/split-junit.py -o "$TESTMO_JUNIT_REPORT_PARTS" "$CURRENT_JUNIT_XML_PATH"
474
482
# archive unitest reports (transformed)
475
483
tar -C $TESTMO_JUNIT_REPORT_PARTS/.. -czf $PUBLIC_DIR/junit_parts.xml.tar.gz $(basename $TESTMO_JUNIT_REPORT_PARTS)
476
-
484
+
477
485
TESTMO_TOKEN=${{ inputs.testman_token }} retry.sh -- testmo automation:run:submit-thread \
478
486
--instance "https://$TESTMO_PROXY_ADDR" --run-id "$TESTMO_RUN_ID" \
479
487
--results "$TESTMO_JUNIT_REPORT_PARTS/*.xml"
@@ -499,7 +507,7 @@ runs:
499
507
GITHUB_TOKEN : ${{ github.token }}
500
508
run : |
501
509
set -x
502
-
510
+
503
511
if [ "${{ steps.build.outputs.status }}" == "failed" ]; then
504
512
curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{github.token}}" -H "X-GitHub-Api-Version: 2022-11-28" \
505
513
https://api.github.com/repos/${{github.repository}}/statuses/${{github.event.pull_request.head.sha}} \
@@ -509,7 +517,7 @@ runs:
509
517
https://api.github.com/repos/${{github.repository}}/statuses/${{github.event.pull_request.head.sha}} \
510
518
-d '{"state":"success","description":"The check has been completed successfully","context":"build_${{inputs.build_preset}}"}'
511
519
fi
512
-
520
+
513
521
- name : Clean up unfinished testmo sessions
514
522
if : always()
515
523
shell : bash
@@ -536,12 +544,12 @@ runs:
536
544
curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{github.token}}" -H "X-GitHub-Api-Version: 2022-11-28" \
537
545
https://api.github.com/repos/${{github.repository}}/statuses/${{github.event.pull_request.head.sha}} \
538
546
-d '{"state":"'$teststatus'","description":"'"$testmessage"'","context":"test_${{inputs.build_preset}}"}'
539
-
547
+
540
548
if [[ $teststatus != "success" ]]; then
541
549
echo "status=failed" >> $GITHUB_OUTPUT
542
550
fi
543
551
fi
544
-
552
+
545
553
- name : check test results
546
554
if : inputs.run_tests
547
555
shell : bash
@@ -587,7 +595,7 @@ runs:
587
595
fi
588
596
fi
589
597
590
-
598
+
591
599
- name : sync results to s3 and publish links
592
600
if : always()
593
601
shell : bash
@@ -611,7 +619,7 @@ runs:
611
619
if : always()
612
620
run : |
613
621
set -x
614
- export build_preset="${{ inputs.build_preset }}"
622
+ export build_preset="${{ inputs.build_preset }}"
615
623
export commit_git_sha="$(git rev-parse HEAD)"
616
624
617
625
python3 .github/scripts/send_build_stats.py
@@ -624,15 +632,15 @@ runs:
624
632
GITHUB_TOKEN : ${{ github.token }}
625
633
run : |
626
634
set -x
627
- export build_preset="${{ inputs.build_preset }}"
628
- export branch_to_compare="$GITHUB_REF_NAME"
635
+ export build_preset="${{ inputs.build_preset }}"
636
+ export branch_to_compare="$GITHUB_REF_NAME"
629
637
export yellow_treshold=102400
630
- export red_treshold=2097152
638
+ export red_treshold=2097152
631
639
export commit_git_sha="$(git rev-parse HEAD)"
632
640
633
641
get_sizes_comment_script=.github/scripts/get_build_diff.py
634
642
comment_raw=`$get_sizes_comment_script`
635
-
643
+
636
644
IFS=';;;'
637
645
read -ra comment_arr <<< "$comment_raw"
638
646
@@ -641,7 +649,7 @@ runs:
641
649
color=${comment_arr[0]}
642
650
replace=$color";;;"
643
651
comment=${comment_raw/$replace/""}
644
-
652
+
645
653
printf "$comment" | .github/scripts/tests/comment-pr.py --color $color
646
654
647
655
else
0 commit comments