mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2026-04-22 16:07:51 +08:00
[CI] Add pytest timeout and enable workflow rerun (#6645)
This commit is contained in:
@@ -54,7 +54,27 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
OWNER: ${{ github.repository_owner }}
|
||||
REPO: ${{ github.event.repository.name }}
|
||||
JOB_NAME: 'CI_XPU'
|
||||
JOB_NAME: 'xpu_build_test / xpu-build-test'
|
||||
|
||||
- name: Rerun run_xpu_4cards_cases
|
||||
if: ${{ contains(github.event.comment.body, 'run_xpu_4cards_cases') }}
|
||||
uses: ./.github/actions/rerun-workflow
|
||||
with:
|
||||
PR_ID: ${{ github.event.issue.number }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
OWNER: ${{ github.repository_owner }}
|
||||
REPO: ${{ github.event.repository.name }}
|
||||
JOB_NAME: 'xpu_4cards_case_test / run_xpu_4cards_cases'
|
||||
|
||||
- name: Rerun run_xpu_8cards_cases
|
||||
if: ${{ contains(github.event.comment.body, 'run_xpu_8cards_cases') }}
|
||||
uses: ./.github/actions/rerun-workflow
|
||||
with:
|
||||
PR_ID: ${{ github.event.issue.number }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
OWNER: ${{ github.repository_owner }}
|
||||
REPO: ${{ github.event.repository.name }}
|
||||
JOB_NAME: 'xpu_8cards_case_test / run_xpu_8cards_cases'
|
||||
|
||||
- name: Rerun CI_HPU
|
||||
if: ${{ contains(github.event.comment.body, 'ci_hpu') }}
|
||||
@@ -185,3 +205,13 @@ jobs:
|
||||
OWNER: ${{ github.repository_owner }}
|
||||
REPO: ${{ github.event.repository.name }}
|
||||
JOB_NAME: 'Run Stable Tests / stable_tests'
|
||||
|
||||
- name: Rerun run_4_cards_tests
|
||||
if: ${{ contains(github.event.comment.body, 'run_4_cards_tests') }}
|
||||
uses: ./.github/actions/rerun-workflow
|
||||
with:
|
||||
PR_ID: ${{ github.event.issue.number }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
OWNER: ${{ github.repository_owner }}
|
||||
REPO: ${{ github.event.repository.name }}
|
||||
JOB_NAME: 'Run Four Cards Tests / run_4_cards_tests'
|
||||
|
||||
@@ -37,11 +37,12 @@ for file in $TEST_FILES; do
|
||||
# Clean up previous logs
|
||||
rm -rf "${run_path}"/log* || true
|
||||
for f in "${run_path}"/*.log; do
|
||||
[[ "$(basename "$f")" != "failed_tests.log" ]] && rm -f "$f"
|
||||
[[ "$(basename "$f")" != "${failed_tests_file}" ]] && rm -f "$f"
|
||||
done
|
||||
|
||||
# Run pytest with coverage for the current file
|
||||
python -m coverage run -m pytest -c ${PYTEST_INI} "$file" -vv -s
|
||||
# Set timeout to 600 seconds to avoid infinite loop
|
||||
timeout 600 python -m coverage run -m pytest -c ${PYTEST_INI} "$file" -vv -s
|
||||
status=$?
|
||||
if [ "$status" -ne 0 ]; then
|
||||
echo "$file" >> "$failed_tests_file"
|
||||
@@ -78,6 +79,8 @@ for file in $TEST_FILES; do
|
||||
server_logs=("${run_path}"/*.log)
|
||||
if [ "${#server_logs[@]}" -gt 0 ]; then
|
||||
for server_log in "${server_logs[@]}"; do
|
||||
# skip failed_tests_file
|
||||
[ "${server_log}" == "${failed_tests_file}" ] && continue
|
||||
if [ -f "${server_log}" ]; then
|
||||
echo
|
||||
echo "---------------- ${server_log} (last 100 lines) ----------------"
|
||||
|
||||
Reference in New Issue
Block a user