Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit59e83ab

Browse files
committed
Improved coverage report merge and removed the test_driver test for faster testing
1 parent9cb8999 commit59e83ab

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

‎.github/workflows/coverage-check-parallel.yml‎

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
-name:Discover test files
2222
id:discover
2323
run:|
24-
# Find all test files in e2e directory and create JSON array
25-
TEST_FILES=$(find tests/e2e -name "test_*.py" -type f | sort | jq -R -s -c 'split("\n")[:-1]')
24+
# Find all test files in e2e directory and create JSON array (excluding test_driver.py for now)
25+
TEST_FILES=$(find tests/e2e -name "test_*.py" -type f |grep -v test_driver.py |sort | jq -R -s -c 'split("\n")[:-1]')
2626
echo "test-files=$TEST_FILES" >> $GITHUB_OUTPUT
2727
echo "Discovered test files: $TEST_FILES"
2828
@@ -90,24 +90,33 @@ jobs:
9090
9191
TEST_NAME=$(basename "${{ matrix.test_file }}" .py)
9292
COVERAGE_FILE="coverage-${TEST_NAME}-${{ matrix.mode }}.xml"
93+
COVERAGE_DATA=".coverage-${TEST_NAME}-${{ matrix.mode }}"
9394
echo "TEST_NAME=$TEST_NAME" >> $GITHUB_ENV
9495
9596
poetry run pytest "${{ matrix.test_file }}" "$TEST_FILTER" "$TEST_EXPRESSION" \
96-
--cov=src --cov-report=xml:$COVERAGE_FILE --cov-report=term \
97+
--cov=src --cov-append --cov-report=xml:$COVERAGE_FILE --cov-report=term \
9798
-v || [ $? -eq 5 ]
9899
99100
# Ensure .coverage file exists for merging (even if empty)
100-
if [ ! -f ".coverage" ]; then
101-
touch .coverage
101+
if [ -f ".coverage" ]; then
102+
mv .coverage "$COVERAGE_DATA"
103+
echo "✅ Saved coverage data as $COVERAGE_DATA"
104+
else
105+
echo "⚠️ No .coverage generated, creating empty file"
106+
touch "$COVERAGE_DATA"
102107
fi
108+
109+
# Debug: Show what files we have for upload
110+
echo "📁 Files available for upload:"
111+
ls -la .coverage* 2>/dev/null || echo "No coverage files found"
103112
104113
-name:Upload coverage artifact
105114
uses:actions/upload-artifact@v4
106115
if:always()
107116
with:
108117
name:coverage-${{ env.TEST_NAME }}-${{ matrix.mode }}
109118
path:|
110-
.coverage
119+
.coverage-*
111120
coverage-*-${{ matrix.mode }}.xml
112121
if-no-files-found:warn
113122

@@ -163,23 +172,21 @@ jobs:
163172
if [ -d "$artifact_dir" ]; then
164173
echo "Artifact: $(basename "$artifact_dir")"
165174
ls -la "$artifact_dir" || echo " (empty or inaccessible)"
166-
if [ -f "$artifact_dir/.coverage" ]; then
167-
artifact_name=$(basename "$artifact_dir")
168-
cp "$artifact_dir/.coverage" ".coverage.$artifact_name"
169-
echo " ✅ Copied .coverage file"
170-
else
171-
echo " ⚠️ No .coverage file found"
172-
fi
175+
for cov_file in "$artifact_dir"/.coverage-*; do
176+
if [ -f "$cov_file" ]; then
177+
cp "$cov_file" .
178+
echo " ✅ Copied $(basename "$cov_file")"
179+
fi
180+
done
173181
fi
174182
done
175-
183+
176184
echo "Available .coverage files for merging:"
177-
ls -la .coverage.* 2>/dev/null || echo "No .coverage.* files found"
178-
179-
# Combine all coverage data (ignore if no files found)
180-
poetry run coverage combine .coverage.* 2>/dev/null ||true
181-
poetry run coverage xml 2>/dev/null || echo '<coverage lines-covered="0" lines-valid="1"></coverage>' > coverage.xml
182-
poetry run coverage report 2>/dev/null ||true
185+
ls -la .coverage-* 2>/dev/null || echo "No .coverage-* files found"
186+
187+
poetry run coverage combine .coverage-* ||true
188+
poetry run coverage xml || echo '<coverage lines-covered="0" lines-valid="1"></coverage>' > coverage.xml
189+
poetry run coverage report ||true
183190
184191
-name:Report coverage percentage
185192
run:|

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp