Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 23 additions & 33 deletions .github/workflows/_unit_test_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,15 @@ jobs:
bash scripts/coverage_run.sh || TEST_EXIT_CODE=8
echo "TEST_EXIT_CODE=${TEST_EXIT_CODE}" >> exit_code.env
coverage combine coveragedata/ || echo "No data to combine"
coverage report
coverage report -m > full_coverage_report.txt
echo "=== Full Coverage Report ==="
cat full_coverage_report.txt
coverage xml -o python_coverage_all.xml
COVERAGE_EXIT_CODE=0
if [[ "$IS_PR" == "true" ]]; then
diff-cover python_coverage_all.xml --diff-file=diff.txt --fail-under=80 --json-report diff_coverage.json || COVERAGE_EXIT_CODE=9
python scripts/generate_diff_coverage_xml.py diff.txt python_coverage_all.xml
python scripts/generate_all_coverage_xlsx.py full_coverage_report.txt full_coverage_report.xlsx
else
echo "Not a PR, skipping diff-cover"
fi
Expand Down Expand Up @@ -240,6 +243,25 @@ jobs:
echo "unittest_failed_url=${UNIT_TEST_RESULT_URL}" >> $GITHUB_OUTPUT
echo "unittest_failed_url=${UNIT_TEST_RESULT_URL}" >> $GITHUB_ENV
fi
full_cov_file="full_coverage_report.txt"
full_cov_excel="full_coverage_report.xlsx"

if [ -f ${full_cov_file} ]; then
# Upload TXT report
python ${push_file} ${full_cov_file} ${target_path}/CoverageData
target_path_stripped="${target_path#paddle-github-action/}"
FULL_COV_FILE_URL=https://paddle-github-action.bj.bcebos.com/${target_path_stripped}/CoverageData/${full_cov_file}
echo "full_coverage_report_url=${FULL_COV_FILE_URL}" >> $GITHUB_OUTPUT
echo "full_coverage_report_url=${FULL_COV_FILE_URL}" >> $GITHUB_ENV

# Upload XLSX report if it exists
if [ -f ${full_cov_excel} ]; then
python ${push_file} ${full_cov_excel} ${target_path}/CoverageData
FULL_COV_EXCEL_URL=https://paddle-github-action.bj.bcebos.com/${target_path_stripped}/CoverageData/${full_cov_excel}
echo "full_coverage_excel_url=${FULL_COV_EXCEL_URL}" >> $GITHUB_OUTPUT
echo "full_coverage_excel_url=${FULL_COV_EXCEL_URL}" >> $GITHUB_ENV
fi
fi
- name: Check Unit Test Success
shell: bash
run: |
Expand Down Expand Up @@ -287,35 +309,3 @@ jobs:
fi
echo "coverage passed"
exit 0

diff_coverage_report:
needs: run_tests_with_coverage
if: always()
runs-on: ubuntu-latest
timeout-minutes: 15
env:
fd_archive_url: ${{ inputs.FASTDEPLOY_ARCHIVE_URL }}
steps:
- name: coverage diff file download
shell: bash
env:
diff_cov_file_url: ${{ needs.run_tests_with_coverage.outputs.diff_cov_file_url }}
run: |
wget -q --no-proxy ${fd_archive_url}
tar -xf FastDeploy.tar.gz
cd FastDeploy
if [ -z "${diff_cov_file_url}" ]; then
echo "No diff coverage file URL provided."
exit 0
fi
wget "${diff_cov_file_url}" -O ./diff_coverage.xml || echo "Download cov file failed, but continuing..."
- name: Upload diff coverage report
if: ${{ needs.run_tests_with_coverage.outputs.diff_cov_file_url != null && needs.run_tests_with_coverage.outputs.diff_cov_file_url != '' }}
uses: codecov/codecov-action@v5
with:
files: ./FastDeploy/diff_coverage.xml
name: python diff coverage
verbose: true
disable_search: true
commit_parent: false
flags: diff
89 changes: 0 additions & 89 deletions .github/workflows/ci_iluvatar.yml

This file was deleted.

88 changes: 0 additions & 88 deletions .github/workflows/ci_xpu.yml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/pr_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,53 +45,3 @@ jobs:
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}

logprob_test:
name: Run FastDeploy LogProb Tests
needs: [build]
uses: ./.github/workflows/_logprob_test_linux.yml
with:
DOCKER_IMAGE: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddleqa:fastdeploy-ciuse-cuda126-dailyupdate
PADDLETEST_ARCHIVE_URL: "https://xly-devops.bj.bcebos.com/PaddleTest/PaddleTest.tar.gz"
FASTDEPLOY_WHEEL_URL: ${{ needs.build.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"

pre_ce_test:
name: Extracted partial CE model tasks to run in CI.
needs: [clone,build]
uses: ./.github/workflows/_pre_ce_test.yml
with:
DOCKER_IMAGE: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddleqa:fastdeploy-ciuse-cuda126-dailyupdate
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
FASTDEPLOY_WHEEL_URL: ${{ needs.build.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"

base_test:
name: Run Base Tests
needs: [clone,build]
uses: ./.github/workflows/_base_test.yml
with:
DOCKER_IMAGE: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddleqa:fastdeploy-ciuse-cuda126-dailyupdate
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
FASTDEPLOY_WHEEL_URL: ${{ needs.build.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"

accuracy_test:
name: Run Accuracy Tests
needs: [clone,build]
uses: ./.github/workflows/_accuracy_test.yml
with:
DOCKER_IMAGE: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddleqa:fastdeploy-ciuse-cuda126-dailyupdate
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
FASTDEPLOY_WHEEL_URL: ${{ needs.build.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"

stable_test:
name: Run Stable Tests
needs: [clone,build]
uses: ./.github/workflows/_stable_test.yml
with:
DOCKER_IMAGE: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddleqa:fastdeploy-ciuse-cuda126-dailyupdate
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
FASTDEPLOY_WHEEL_URL: ${{ needs.build.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
81 changes: 81 additions & 0 deletions scripts/generate_all_coverage_xlsx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import re
import sys

import pandas as pd


def txt_to_excel(txt_file_path, excel_file_path):
rows = []
total_row = None

with open(txt_file_path, "r", encoding="utf-8") as f:
lines = f.readlines()

for line in lines:
line = line.rstrip()
if not line:
continue

# Skip headers and separators
if line.startswith("Name") or set(line.strip()) == set("-"):
continue

# Match TOTAL line (e.g., "TOTAL 123 4 10 2 95% missing_info")
m_total = re.match(r"^TOTAL\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+([\d.]+)%\s*(.*)$", line)
if m_total:
stmts, miss, branch, brpart, cover, missing = m_total.groups()
total_row = {
"File": "TOTAL",
"Stmts": int(stmts),
"Miss": int(miss),
"Branch": int(branch),
"BrPart": int(brpart),
"Cover(%)": float(cover) if "." in cover else int(cover),
"Missing": missing.strip(),
}
continue

# Match regular file rows
m = re.match(r"^(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+([\d.]+)%\s*(.*)$", line)
if m:
filename, stmts, miss, branch, brpart, cover, missing = m.groups()
rows.append(
{
"File": filename,
"Stmts": int(stmts),
"Miss": int(miss),
"Branch": int(branch),
"BrPart": int(brpart),
"Cover(%)": float(cover) if "." in cover else int(cover),
"Missing": missing.strip() if missing.strip() else "",
}
)
else:
continue

# Sort by coverage ascending (excluding TOTAL)
if rows:
df = pd.DataFrame(rows)
df.sort_values("Cover(%)", inplace=True)
else:
df = pd.DataFrame(columns=["File", "Stmts", "Miss", "Branch", "BrPart", "Cover(%)", "Missing"])

# Append TOTAL at the bottom
if total_row:
df_total = pd.DataFrame([total_row])
df = pd.concat([df, df_total], ignore_index=True)

# Save as Excel file
df.to_excel(excel_file_path, index=False, engine="openpyxl")
print("✅ Saved coverage Excel file: {}".format(excel_file_path))


if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: python generate_all_coverage_xlsx.py <input_txt_path> <output_excel_path>")
sys.exit(1)

txt_file_path = sys.argv[1]
excel_file_path = sys.argv[2]

txt_to_excel(txt_file_path, excel_file_path)
1 change: 1 addition & 0 deletions scripts/unittest_requirement.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ diff-cover
partial_json_parser
jsonschema
aistudio_sdk==0.3.5
openpyxl==3.1.5
Loading
Loading