-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Your Name
committed
Dec 9, 2024
1 parent
168eccc
commit 348a207
Showing
2 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
|
||
!/bin/bash | ||
#!/bin/bash | ||
echo "Running all test cases across the project..." | ||
|
||
# Initialize a failure counter | ||
failure_count=0 | ||
|
||
# Find and run all Python files starting with 'test_' in the entire project directory | ||
for test_file in $(find . -type f -name "test_*.py"); do | ||
echo "Running $test_file..." | ||
pytest "$test_file" | ||
|
||
# Check the exit status of pytest | ||
if [ $? -ne 0 ]; then | ||
echo "Test failed: $test_file" | ||
failure_count=$((failure_count + 1)) | ||
fi | ||
done | ||
|
||
echo "All tests completed!" | ||
# Report the results | ||
if [ $failure_count -ne 0 ]; then | ||
echo "$failure_count test(s) failed." | ||
exit 1 | ||
else | ||
echo "All tests passed successfully!" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters