Git Hooks: Add tests documentation and update image tag
This commit is contained in:
@@ -1,5 +1,48 @@
|
||||
# Git Hooks
|
||||
|
||||
## Tests
|
||||
|
||||
For our `deny-binary` Git hook, we have several test cases. They can be run locally:
|
||||
|
||||
```bash
|
||||
$ ./test/run_deny_binary_tests.sh
|
||||
== Running tests in directory deny_binary ==
|
||||
Running 10_initial_text_file_test.sh... ok
|
||||
Running 11_add_text_file_test.sh... ok
|
||||
Running 20_initial_binary_file_test.sh... ok
|
||||
Running 21_add_binary_file_test.sh... ok
|
||||
Running 22_add_suspicious_binary_file_test.sh... ok
|
||||
Running 30_add_binary_lfs_file_test.sh... ok
|
||||
Running 40_add_binary_file_and_convert_test.sh... ok
|
||||
Running 50_migrate_legacy_file_to_lfs_test.sh... ok
|
||||
Running 51_move_legacy_file_with_binary.sh... ok
|
||||
All tests passed.
|
||||
```
|
||||
|
||||
Or they can be run using the Gitea image to do end-to-end testing (see `docker-compose.yml` for changing the image).
|
||||
|
||||
```bash
|
||||
$ docker compose up
|
||||
[+] Running 11/11
|
||||
✔ gitea_deny_binary_tests Pulled
|
||||
[+] Running 2/2
|
||||
✔ Network git-hooks_default Created 0.0s
|
||||
✔ Container gitea_deny_binary_tests Created 0.2s
|
||||
Attaching to gitea_deny_binary_tests
|
||||
gitea_deny_binary_tests | == Running tests in directory deny_binary ==
|
||||
gitea_deny_binary_tests | Running 10_initial_text_file_test.sh... ok
|
||||
gitea_deny_binary_tests | Running 11_add_text_file_test.sh... ok
|
||||
gitea_deny_binary_tests | Running 20_initial_binary_file_test.sh... ok
|
||||
gitea_deny_binary_tests | Running 21_add_binary_file_test.sh... ok
|
||||
gitea_deny_binary_tests | Running 22_add_suspicious_binary_file_test.sh... ok
|
||||
gitea_deny_binary_tests | Running 30_add_binary_lfs_file_test.sh... ok
|
||||
gitea_deny_binary_tests | Running 40_add_binary_file_and_convert_test.sh... ok
|
||||
gitea_deny_binary_tests | Running 50_migrate_legacy_file_to_lfs_test.sh... ok
|
||||
gitea_deny_binary_tests | Running 51_move_legacy_file_with_binary.sh... ok
|
||||
gitea_deny_binary_tests | All tests passed.
|
||||
gitea_deny_binary_tests exited with code 0
|
||||
```
|
||||
|
||||
## Reject Merge Commits
|
||||
|
||||
The `blender_merged_hook` script rejects merge commits to branches were we don't want them. It is installed as an `pre-receive` hook in the following repositories:
|
||||
|
||||
Reference in New Issue
Block a user