Skip to content

Commit 54003b0

Browse files
authored
chore(ci): fix coverage when modifying existing ported tests. (#2013)
1 parent ed123f6 commit 54003b0

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/scripts/parse_ported_tests.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,20 @@ WORKSPACE_PATH="${2:-$GITHUB_WORKSPACE}"
1212

1313
echo "Changed or new test files: $CHANGED_TEST_FILES"
1414

15-
# Extract ported_from markers
16-
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
15+
FILTERED_FILES=""
16+
for file in $CHANGED_TEST_FILES; do
17+
if git diff origin/main -- "$file" | grep -q "^+.*@pytest.mark.ported_from"; then
18+
FILTERED_FILES="$FILTERED_FILES $file"
19+
fi
20+
done
21+
22+
if [[ -z "$FILTERED_FILES" ]]; then
23+
echo "No new ported_from markers found."
24+
echo "any_ported=false" >> "$GITHUB_OUTPUT"
25+
exit 0
26+
fi
27+
28+
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
1729
files=$(cat ported_from_files.txt)
1830
echo "Extracted converted tests:"
1931
echo "$files"

0 commit comments

Comments
 (0)