File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ echo " Running tests with coverage..."
4+
5+ coverage run manage.py test
6+ status=$?
7+
8+ if [ $status -ne 0 ]; then
9+ echo " ❌ Tests failed. Push aborted."
10+ exit 1
11+ fi
12+
13+ coverage report --fail-under=85 # set your threshold
14+ if [ $? -ne 0 ]; then
15+ echo " ❌ Coverage is below threshold. Push aborted."
16+ exit 1
17+ fi
18+
19+ echo " ✅ Tests passed and coverage is acceptable. Proceeding with push."
Original file line number Diff line number Diff line change @@ -1073,3 +1073,17 @@ python3 manage.py test
10731073 ` ` `
10741074
10751075- Note:- pre commit official [doc](https://pre-commit.com/)
1076+
1077+ 14. Setup pre push hook
1078+
1079+ - for linux or macos
1080+
1081+ ` ` ` sh
1082+ cp .githooks/pre-push .git/hooks/pre-push && chmod +x .git/hooks/pre-push
1083+ ` ` `
1084+
1085+ - for windowns
1086+
1087+ ` ` ` sh
1088+ copy .githooks\p re-push .git\h ooks\p re-push
1089+ ` ` `
You can’t perform that action at this time.
0 commit comments