@@ -183,7 +183,7 @@ jobs:
183
183
echo "commands =" >> tox_pr.ini
184
184
185
185
# Always run a baseline test with coverage to ensure we have some data
186
- echo " pytest -xvs --cov=patterns tests/ --cov-report=term-missing || true " >> tox_pr.ini
186
+ echo " pytest -xvs --cov=patterns tests/ --cov-report=term-missing" >> tox_pr.ini
187
187
188
188
# Add coverage-focused test commands
189
189
echo " # Run specific tests for changed files" >> tox_pr.ini
@@ -196,15 +196,15 @@ jobs:
196
196
echo " # Testing $file" >> tox_pr.ini
197
197
198
198
# First check if there's a specific test for this module
199
- echo " pytest -xvs --cov=patterns --cov-append tests/${pattern_dir}/test_${module_name}.py 2>/dev/null || true " >> tox_pr.ini
199
+ echo " - python -c \"import os.path; exit(0 if os.path.exists('tests/${pattern_dir}/test_${module_name}.py') else 1)\" && pytest -xvs --cov=patterns --cov-append tests/${pattern_dir}/test_${module_name}.py" >> tox_pr.ini
200
200
201
201
# Also run more general tests for the directory
202
- echo " pytest -xvs --cov=patterns --cov-append tests/${pattern_dir}/ -k \"${module_name}\" || true " >> tox_pr.ini
202
+ echo " pytest -xvs --cov=patterns --cov-append tests/${pattern_dir}/ -k \"${module_name}\"" >> tox_pr.ini
203
203
fi
204
204
205
205
# Run test files directly if modified
206
206
if [[ $file == tests/* ]]; then
207
- echo " pytest -xvs --cov=patterns --cov-append $file || true " >> tox_pr.ini
207
+ echo " pytest -xvs --cov=patterns --cov-append $file" >> tox_pr.ini
208
208
fi
209
209
fi
210
210
done
@@ -213,18 +213,18 @@ jobs:
213
213
echo " # Run doctests" >> tox_pr.ini
214
214
for file in $changed_files; do
215
215
if [[ $file == patterns/*.py ]]; then
216
- echo " pytest --doctest-modules -v --cov=patterns --cov-append $file || true " >> tox_pr.ini
216
+ echo " pytest --doctest-modules -v --cov=patterns --cov-append $file" >> tox_pr.ini
217
217
fi
218
218
done
219
219
220
- # Add coverage report command (only executed if there's coverage data)
221
- echo " coverage combine || true " >> tox_pr.ini
222
- echo " coverage report || echo 'No coverage data available' " >> tox_pr.ini
220
+ # Add coverage report command
221
+ echo " coverage combine" >> tox_pr.ini
222
+ echo " coverage report" >> tox_pr.ini
223
223
224
224
# Run tox with the custom configuration
225
225
echo "Running tox with custom PR configuration..."
226
226
cat tox_pr.ini
227
- tox -c tox_pr.ini || true # Don't fail the build if tox fails
227
+ tox -c tox_pr.ini
228
228
229
229
summary :
230
230
needs : [check_changes, lint]
0 commit comments