Skip to content

Commit 4f16b18

Browse files
committed
Fixed bug
1 parent e3fa2e0 commit 4f16b18

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.github/workflows/lint_pr.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ jobs:
183183
echo "commands =" >> tox_pr.ini
184184
185185
# 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
187187
188188
# Add coverage-focused test commands
189189
echo " # Run specific tests for changed files" >> tox_pr.ini
@@ -196,15 +196,15 @@ jobs:
196196
echo " # Testing $file" >> tox_pr.ini
197197
198198
# 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
200200
201201
# 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
203203
fi
204204
205205
# Run test files directly if modified
206206
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
208208
fi
209209
fi
210210
done
@@ -213,18 +213,18 @@ jobs:
213213
echo " # Run doctests" >> tox_pr.ini
214214
for file in $changed_files; do
215215
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
217217
fi
218218
done
219219
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
223223
224224
# Run tox with the custom configuration
225225
echo "Running tox with custom PR configuration..."
226226
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
228228
229229
summary:
230230
needs: [check_changes, lint]

0 commit comments

Comments
 (0)