From 896e8a660cdf602d712d2f16ef240fceb0594a57 Mon Sep 17 00:00:00 2001 From: spencer-tb Date: Fri, 8 Aug 2025 13:50:39 +0000 Subject: [PATCH] chore(ci): fix coverage when modifying existing ported tests. --- .github/scripts/parse_ported_tests.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/scripts/parse_ported_tests.sh b/.github/scripts/parse_ported_tests.sh index 5501635d0d2..25ea44e4425 100755 --- a/.github/scripts/parse_ported_tests.sh +++ b/.github/scripts/parse_ported_tests.sh @@ -12,8 +12,20 @@ WORKSPACE_PATH="${2:-$GITHUB_WORKSPACE}" echo "Changed or new test files: $CHANGED_TEST_FILES" -# Extract ported_from markers -uv run fill $CHANGED_TEST_FILES --show-ported-from --clean --quiet --links-as-filled --skip-coverage-missed-reason --ported-from-output-file ported_from_files.txt +FILTERED_FILES="" +for file in $CHANGED_TEST_FILES; do + if git diff origin/main -- "$file" | grep -q "^+.*@pytest.mark.ported_from"; then + FILTERED_FILES="$FILTERED_FILES $file" + fi +done + +if [[ -z "$FILTERED_FILES" ]]; then + echo "No new ported_from markers found." + echo "any_ported=false" >> "$GITHUB_OUTPUT" + exit 0 +fi + +uv run fill $FILTERED_FILES --show-ported-from --clean --quiet --links-as-filled --skip-coverage-missed-reason --ported-from-output-file ported_from_files.txt files=$(cat ported_from_files.txt) echo "Extracted converted tests:" echo "$files"