Remove last vestiges of Lua hooks from tests

Summary:
For Lua hooks, we needed to know whether to run the hook per file, or per changeset. Rust hooks know this implicitly, as they're built-in to the server.

Stop having the tests set an unnecessary config

Reviewed By: krallin

Differential Revision: D22282799

fbshipit-source-id: c9f6f6325823d06d03341f04ecf7152999fcdbe7
This commit is contained in:
Simon Farnsworth 2020-06-29 10:01:43 -07:00 committed by Facebook GitHub Bot
parent b7b5c9e7cc
commit 7e9b8dd9e9
4 changed files with 6 additions and 10 deletions

View File

@ -827,9 +827,8 @@ CONFIG
function register_hook {
hook_name="$1"
hook_type="$2"
shift 2
shift 1
EXTRA_CONFIG_DESCRIPTOR=""
if [[ $# -gt 0 ]]; then
EXTRA_CONFIG_DESCRIPTOR="$1"
@ -841,7 +840,6 @@ function register_hook {
hook_name="$hook_name"
[[hooks]]
name="$hook_name"
hook_type="$hook_type"
CONFIG
[ -n "$EXTRA_CONFIG_DESCRIPTOR" ] && cat "$EXTRA_CONFIG_DESCRIPTOR"
) >> "repos/$REPONAME/server.toml"
@ -1223,15 +1221,14 @@ name="$HOOKBOOKMARK"
CONFIG
HOOK_NAME="$1"
HOOK_TYPE="$2"
shift 2
shift 1
EXTRA_CONFIG_DESCRIPTOR=""
if [[ $# -gt 0 ]]; then
EXTRA_CONFIG_DESCRIPTOR="$1"
fi
register_hook "$HOOK_NAME" "$HOOK_TYPE" "$EXTRA_CONFIG_DESCRIPTOR"
register_hook "$HOOK_NAME" "$EXTRA_CONFIG_DESCRIPTOR"
setup_common_hg_configs
cd "$TESTTMP" || exit 1

View File

@ -15,7 +15,7 @@ setup configuration
> name="master_bookmark"
> CONFIG
$ register_hook limit_filesize PerAddedOrModifiedFile <(
$ register_hook limit_filesize <(
> cat <<CONF
> bypass_commit_string="@allow_large_files"
> config_ints={filesizelimit=10}

View File

@ -31,7 +31,6 @@
> hook_name="deny_files"
> [[hooks]]
> name="deny_files"
> hook_type="PerAddedOrModifiedFile"
> CONFIG
$ start_large_small_repo --local-configerator-path="$TESTTMP/configerator"
Starting Mononoke server

View File

@ -22,7 +22,7 @@ setup configuration
> name="master_bookmark"
> CONFIG
$ register_hook always_fail_changeset PerChangeset <(
$ register_hook always_fail_changeset <(
> echo 'bypass_pushvar="BYPASS_REVIEW=true"'
> )