|
21 | 21 | -name:Discover test files |
22 | 22 | id:discover |
23 | 23 | 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]') |
26 | 26 | echo "test-files=$TEST_FILES" >> $GITHUB_OUTPUT |
27 | 27 | echo "Discovered test files: $TEST_FILES" |
28 | 28 |
|
@@ -90,24 +90,33 @@ jobs: |
90 | 90 |
|
91 | 91 | TEST_NAME=$(basename "${{ matrix.test_file }}" .py) |
92 | 92 | COVERAGE_FILE="coverage-${TEST_NAME}-${{ matrix.mode }}.xml" |
| 93 | + COVERAGE_DATA=".coverage-${TEST_NAME}-${{ matrix.mode }}" |
93 | 94 | echo "TEST_NAME=$TEST_NAME" >> $GITHUB_ENV |
94 | 95 |
|
95 | 96 | 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 \ |
97 | 98 | -v || [ $? -eq 5 ] |
98 | 99 |
|
99 | 100 | # 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" |
102 | 107 | 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" |
103 | 112 |
|
104 | 113 | -name:Upload coverage artifact |
105 | 114 | uses:actions/upload-artifact@v4 |
106 | 115 | if:always() |
107 | 116 | with: |
108 | 117 | name:coverage-${{ env.TEST_NAME }}-${{ matrix.mode }} |
109 | 118 | path:| |
110 | | - .coverage |
| 119 | + .coverage-* |
111 | 120 | coverage-*-${{ matrix.mode }}.xml |
112 | 121 | if-no-files-found:warn |
113 | 122 |
|
@@ -163,23 +172,21 @@ jobs: |
163 | 172 | if [ -d "$artifact_dir" ]; then |
164 | 173 | echo "Artifact: $(basename "$artifact_dir")" |
165 | 174 | 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 |
173 | 181 | fi |
174 | 182 | done |
175 | | -
|
| 183 | +
|
176 | 184 | 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 |
183 | 190 |
|
184 | 191 | -name:Report coverage percentage |
185 | 192 | run:| |
|