Skip to content

Commit ce514c5

Browse files
authored
chore: fix test cloud e2e engine workflow error (#565)
* chore: fix test cloud e2e engine * chore: fix Invalid format * chore: add set_engine_summary_result_url_2 * chore: change test title
1 parent 7441851 commit ce514c5

File tree

4 files changed

+265
-81
lines changed

4 files changed

+265
-81
lines changed

.github/utils/utils.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,31 @@ set_engine_summary_result_url() {
10521052
echo "$ENGINE_SUMMARY_RESULT_TEMP"
10531053
}
10541054

1055+
set_engine_summary_result_url_2() {
1056+
TEST_RESULT="$(echo "${TEST_RESULT}" | sed 's/ /#/g')"
1057+
ENGINE_SUMMARY_RESULT_TEMP=""
1058+
for coverage_result in $(echo "$COVERAGE_RESULT" | sed 's/##/ /g'); do
1059+
engine_name=${coverage_result%%|*}
1060+
job_url="null"
1061+
for test_result in `echo "$TEST_RESULT" | sed 's/##/ /g'`; do
1062+
test_types=${test_result%%|*}
1063+
for test_type in `echo "$test_types" | sed 's/,/ /g'`; do
1064+
if [[ "$test_type" == "$engine_name" ]]; then
1065+
job_url=${test_result##*|}
1066+
break
1067+
fi
1068+
done
1069+
if [[ "${job_url}" != "null" ]] then
1070+
break
1071+
fi
1072+
done
1073+
1074+
coverage_result=${coverage_result/\#/ }
1075+
ENGINE_SUMMARY_RESULT_TEMP="${ENGINE_SUMMARY_RESULT_TEMP}##${coverage_result}|${REPORT_URL}|${job_url}"
1076+
done
1077+
echo "$ENGINE_SUMMARY_RESULT_TEMP"
1078+
}
1079+
10551080
get_gh_job_url() {
10561081
gh_job_url="https://github.com/$GITHUB_REPO/actions/runs/$RUN_ID"
10571082
for i in {1..2}; do
@@ -1417,6 +1442,9 @@ main() {
14171442
44)
14181443
get_gh_job_url
14191444
;;
1445+
45)
1446+
set_engine_summary_result_url_2
1447+
;;
14201448
esac
14211449
}
14221450

.github/workflows/cloud-e2e-api.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
description: "The specify version of GO (e.g. openapi-test|adminapi-test)"
88
type: string
99
required: false
10-
default: 'openapi-test'
10+
default: 'openapi-test|adminapi-test'
1111
CLOUD_ENV_NAME:
1212
description: "The cloud env name of test (e.g. dev) "
1313
type: string
@@ -34,7 +34,7 @@ on:
3434
description: "The specify version of GO (e.g. openapi-test|adminapi-test)"
3535
type: string
3636
required: false
37-
default: 'openapi-test'
37+
default: 'openapi-test|adminapi-test'
3838
CLOUD_ENV_NAME:
3939
description: "The cloud env name of test (e.g. dev) "
4040
type: string
@@ -107,7 +107,7 @@ jobs:
107107
108108
e2e-api-test:
109109
needs: [ get-test-type ]
110-
name: ${{ matrix.test-type }}-${{ needs.get-test-type.outputs.cloud-env-name }}
110+
name: ${{ matrix.test-type }}
111111
strategy:
112112
fail-fast: false
113113
matrix: ${{ fromJSON(needs.get-test-type.outputs.test-type) }}
@@ -347,7 +347,6 @@ jobs:
347347
fi
348348
349349
- name: Get ${{ matrix.test-type }} API Coverage List
350-
if: ${{ always() && matrix.test-type != 'engine-test' }}
351350
run: |
352351
coverage_file_log="test_api_coverage_result.log"
353352
coverage_file_log_path="${{ github.workspace }}/${coverage_file_log}"
@@ -396,19 +395,19 @@ jobs:
396395
for test_type_tmp in $(echo "${TEST_TYPES}" | sed 's/|/ /g' ); do
397396
case "$test_type_tmp" in
398397
openapi-test)
399-
TEST_RESULT="${TEST_RESULT}##${test_type_tmp}-${CLOUD_ENV_NAME}|${{ needs.e2e-api-test.outputs.openapi-test-result }}"
398+
TEST_RESULT="${TEST_RESULT}##${test_type_tmp}|${{ needs.e2e-api-test.outputs.openapi-test-result }}"
400399
if [[ -n "${{ needs.e2e-api-test.outputs.openapi-summary }}" ]]; then
401400
API_COVERAGE_SUMMARY="${API_COVERAGE_SUMMARY}##openapi|${{ needs.e2e-api-test.outputs.openapi-summary }}"
402401
fi
403402
;;
404403
adminapi-test)
405-
TEST_RESULT="${TEST_RESULT}##${test_type_tmp}-${CLOUD_ENV_NAME}|${{ needs.e2e-api-test.outputs.adminapi-test-result }}"
404+
TEST_RESULT="${TEST_RESULT}##${test_type_tmp}|${{ needs.e2e-api-test.outputs.adminapi-test-result }}"
406405
if [[ -n "${{ needs.e2e-api-test.outputs.adminapi-summary }}" ]]; then
407406
API_COVERAGE_SUMMARY="${API_COVERAGE_SUMMARY}##adminapi|${{ needs.e2e-api-test.outputs.adminapi-summary }}"
408407
fi
409408
;;
410409
*)
411-
TEST_RESULT="${TEST_RESULT}##${test_type_tmp}-${CLOUD_ENV_NAME}|${{ needs.e2e-api-test.outputs.test-result }}"
410+
TEST_RESULT="${TEST_RESULT}##${test_type_tmp}|${{ needs.e2e-api-test.outputs.test-result }}"
412411
if [[ -n "${{ needs.e2e-api-test.outputs.api-summary }}" ]]; then
413412
API_COVERAGE_SUMMARY="${API_COVERAGE_SUMMARY}##api|${{ needs.e2e-api-test.outputs.api-summary }}"
414413
fi
@@ -426,15 +425,15 @@ jobs:
426425
427426
export TZ='Asia/Shanghai'
428427
date_ret=$(date +%Y-%m-%d-%T)
429-
TEST_TITLE="[${CLOUD_BRANCH}] Cloud E2E API Test [${date_ret}]"
428+
TEST_TITLE="[${CLOUD_BRANCH}][${CLOUD_ENV_NAME}] Cloud E2E API Test [${date_ret}]"
430429
431430
python3 .github/utils/send_mesage.py \
432431
--send-type ginkgo \
433432
--url "${{ vars.CLOUD_E2E_BOT_WEBHOOK }}" \
434433
--title "$TEST_TITLE" \
435434
--result "$TEST_RESULT"
436435
437-
TEST_TITLE_SUMMARY="[${CLOUD_BRANCH}] Cloud E2E API Coverage Summary [${date_ret}]"
436+
TEST_TITLE_SUMMARY="[${CLOUD_BRANCH}][${CLOUD_ENV_NAME}] Cloud E2E API Coverage Summary [${date_ret}]"
438437
if [[ -n "${API_COVERAGE_SUMMARY}" && "${{ needs.get-test-type.outputs.cloud-branch }}" == "main" ]]; then
439438
echo "API_COVERAGE_SUMMARY:${API_COVERAGE_SUMMARY}"
440439
API_COVERAGE_SUMMARY_TMP="$(bash .github/utils/utils.sh \

0 commit comments

Comments
 (0)