|
@@ -4,14 +4,22 @@ inputs:
|
|
|
build_target:
|
|
|
required: false
|
|
|
description: "build target"
|
|
|
-
|
|
|
- sanitizer:
|
|
|
- required: false
|
|
|
- description: "sanitizer type (address, memory, thread, undefined, leak)"
|
|
|
-
|
|
|
- log_suffix:
|
|
|
+
|
|
|
+ build_preset:
|
|
|
required: true
|
|
|
- description: "log suffix"
|
|
|
+ default: "relwithdebinfo"
|
|
|
+ description: "relwithdebinfo, release-asan, release-tsan"
|
|
|
+
|
|
|
+ test_size:
|
|
|
+ required: false
|
|
|
+ default: "small,medium,large"
|
|
|
+ description: "small or small-medium or all"
|
|
|
+
|
|
|
+ test_type:
|
|
|
+ required: false
|
|
|
+ default: "unittest,py3test,py2test,pytest"
|
|
|
+ description: "run "
|
|
|
+
|
|
|
test_threads:
|
|
|
required: false
|
|
|
default: "28"
|
|
@@ -74,8 +82,24 @@ runs:
|
|
|
run: |
|
|
|
RUN_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
|
|
|
BRANCH_TAG="$GITHUB_REF_NAME"
|
|
|
- TESTMO_SOURCE="${{ inputs.log_suffix }}"
|
|
|
- TESTMO_SOURCE="${TESTMO_SOURCE/_/-}"
|
|
|
+ ARCH="${{ runner.arch == 'X64' && 'x86-64' || runner.arch == 'ARM64' && 'arm64' || 'unknown' }}"
|
|
|
+
|
|
|
+
|
|
|
+ case "${{ inputs.build_preset }}" in
|
|
|
+ relwithdebinfo)
|
|
|
+ TESTMO_SOURCE="ya-${ARCH}"
|
|
|
+ ;;
|
|
|
+ release-asan)
|
|
|
+ TESTMO_SOURCE="ya-${ARCH}-asan"
|
|
|
+ ;;
|
|
|
+ release-tsan)
|
|
|
+ TESTMO_SOURCE="ya-${ARCH}-tsan"
|
|
|
+ ;;
|
|
|
+ *)
|
|
|
+ echo "Invalid preset: ${{ inputs.build_preset }}"
|
|
|
+ exit 1
|
|
|
+ ;;
|
|
|
+ esac
|
|
|
|
|
|
case $GITHUB_EVENT_NAME in
|
|
|
workflow_dispatch)
|
|
@@ -99,15 +123,18 @@ runs:
|
|
|
|
|
|
testmo automation:resources:add-link --name build --url "$RUN_URL" --resources testmo.json
|
|
|
testmo automation:resources:add-field --name git-sha --type string --value "${GITHUB_SHA:0:7}" --resources testmo.json
|
|
|
- testmo automation:run:create --instance "$TESTMO_URL" --project-id "${{ inputs.testman_project_id }}" --name "$TESTMO_RUN_NAME" \
|
|
|
- --source "$TESTMO_SOURCE" --resources testmo.json \
|
|
|
- --tags "$BRANCH_TAG" --tags "$EXTRA_TAG" | \
|
|
|
- echo "runid=$(cat)" >> $GITHUB_OUTPUT
|
|
|
+ RUN_ID=$(
|
|
|
+ testmo automation:run:create --instance "$TESTMO_URL" --project-id ${{ inputs.testman_project_id }} \
|
|
|
+ --name "$TESTMO_RUN_NAME" --source "$TESTMO_SOURCE" --resources testmo.json \
|
|
|
+ --tags "$BRANCH_TAG" --tags "$EXTRA_TAG"
|
|
|
+ )
|
|
|
+ echo "runid=${RUN_ID}" >> $GITHUB_OUTPUT
|
|
|
+ echo "TEST_HISTORY_URL=${TESTMO_URL}/automation/runs/view/${RUN_ID}" >> $GITHUB_ENV
|
|
|
|
|
|
- name: Print test history link
|
|
|
shell: bash
|
|
|
run: |
|
|
|
- echo "10 [Test history](${TESTMO_URL}/automation/runs/view/${{steps.th.outputs.runid}})" >> $SUMMARY_LINKS
|
|
|
+ echo "10 [Test history](${TEST_HISTORY_URL})" >> $SUMMARY_LINKS
|
|
|
|
|
|
- name: set environment variables required by some tests
|
|
|
shell: bash
|
|
@@ -118,23 +145,49 @@ runs:
|
|
|
shell: bash
|
|
|
run: |
|
|
|
extra_params=()
|
|
|
+
|
|
|
+ # FIXME: copy-paste from build_ya
|
|
|
+ case "${{ inputs.build_preset }}" in
|
|
|
+ relwithdebinfo)
|
|
|
+ build_type=relwithdebinfo
|
|
|
+ ;;
|
|
|
+ release-asan)
|
|
|
+ build_type=release
|
|
|
+ extra_params+=(--sanitize="address")
|
|
|
+ extra_params+=(-DSKIP_JUNK -DUSE_EAT_MY_DATA -DDEBUGINFO_LINES_ONLY)
|
|
|
+ ;;
|
|
|
+ release-tsan)
|
|
|
+ build_type=release
|
|
|
+ extra_params+=(--sanitize="thread")
|
|
|
+ extra_params+=(-DSKIP_JUNK -DUSE_EAT_MY_DATA -DDEBUGINFO_LINES_ONLY)
|
|
|
+ ;;
|
|
|
+ *)
|
|
|
+ echo "Invalid preset: ${{ inputs.build_preset }}"
|
|
|
+ exit 1
|
|
|
+ ;;
|
|
|
+ esac
|
|
|
+
|
|
|
|
|
|
if [ ! -z "${{ inputs.build_target }}" ]; then
|
|
|
extra_params+=(--target="${{ inputs.build_target }}")
|
|
|
fi
|
|
|
|
|
|
- if [ ! -z "${{ inputs.sanitizer }}" ] && [ "${{ inputs.sanitizer }}" != "none" ]; then
|
|
|
- extra_params+=(--sanitize="${{ inputs.sanitizer }}")
|
|
|
- fi
|
|
|
-
|
|
|
if [ ! -z "${{ inputs.bazel_remote_uri }}" ]; then
|
|
|
extra_params+=(--bazel-remote-store)
|
|
|
extra_params+=(--bazel-remote-base-uri "${{ inputs.bazel_remote_uri }}")
|
|
|
fi
|
|
|
|
|
|
- ./ya test -A --build relwithdebinfo -D'BUILD_LANGUAGES=CPP PY3' \
|
|
|
+ # FIXME: remove after KIKIMR-19209
|
|
|
+ sed -i 's/^END()/SKIP_TEST("wait for KIKIMR-19209") END()/' ydb/library/yql/tests/sql/sql2yql/ya.make
|
|
|
+
|
|
|
+
|
|
|
+ readarray -d ',' -t test_size < <(printf "%s" "${{ inputs.test_size }}")
|
|
|
+ readarray -d ',' -t test_type < <(printf "%s" "${{ inputs.test_type }}")
|
|
|
+
|
|
|
+ ./ya test -k --build "${build_type}" -D'BUILD_LANGUAGES=CPP PY3' \
|
|
|
+ ${test_size[@]/#/--test-size=} ${test_type[@]/#/--test-type=} \
|
|
|
--test-threads "${{ inputs.test_threads }}" --link-threads "${{ inputs.link_threads }}" \
|
|
|
- --cache-size 512G --regular-tests --do-not-output-stderrs -T \
|
|
|
+ --cache-size 512G --do-not-output-stderrs -T \
|
|
|
--stat --log-file "$LOG_DIR/ya_log.txt" --evlog-file "$LOG_DIR/ya_evlog.jsonl" \
|
|
|
--dump-graph --dump-graph-to-file "$LOG_DIR/ya_graph.json" \
|
|
|
--junit "$JUNIT_REPORT_XML" --output "$OUT_DIR" "${extra_params[@]}" || (
|
|
@@ -158,24 +211,26 @@ runs:
|
|
|
"$JUNIT_REPORT_XML"
|
|
|
|
|
|
- name: write tests summary
|
|
|
- if: always()
|
|
|
shell: bash
|
|
|
env:
|
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
|
run: |
|
|
|
-
|
|
|
+ mkdir $ARTIFACTS_DIR/summary/
|
|
|
+
|
|
|
cat $SUMMARY_LINKS | python3 -c 'import sys; print(" | ".join([v for _, v in sorted([l.strip().split(" ", 1) for l in sys.stdin], key=lambda a: (int(a[0]), a))]))' >> $GITHUB_STEP_SUMMARY
|
|
|
|
|
|
- mkdir $ARTIFACTS_DIR/summary/
|
|
|
+ platform_name=$(uname | tr '[:upper:]' '[:lower:]')-$(arch)
|
|
|
|
|
|
.github/scripts/tests/generate-summary.py \
|
|
|
- --summary-out-path $ARTIFACTS_DIR/summary/ \
|
|
|
- --summary-url-prefix $S3_URL_PREFIX/summary/ \
|
|
|
- "Tests" ya-test.html "$JUNIT_REPORT_XML"
|
|
|
+ --summary-out-path $ARTIFACTS_DIR/summary/ \
|
|
|
+ --summary-url-prefix $S3_URL_PREFIX/summary/ \
|
|
|
+ --test-history-url $TEST_HISTORY_URL \
|
|
|
+ --build-preset "${platform_name}-${{ inputs.build_preset }}" \
|
|
|
+ "Tests" ya-test.html "$JUNIT_REPORT_XML"
|
|
|
|
|
|
|
|
|
- name: Unit test history upload results
|
|
|
- if: always() && inputs.testman_token
|
|
|
+ if: inputs.testman_token
|
|
|
shell: bash
|
|
|
run: |
|
|
|
testmo automation:run:submit-thread \
|