Skip to content

Test that GL_* values get passed to custom hooks

John Cai requested to merge jc-test-custom-hooks-gl into master

With hooks, we were missing test coverage to ensure that GL_USERNAME, GL_REPOSITORY, GL_ID, GL_PROTOCOL get propagated to custom hooks.

note: GL_PROTOCOL doesn't get through to the custom pre-receive hook, because it gets deleted by the gitlab hook: https://gitlab.com/gitlab-org/gitaly/-/blob/master/ruby/gitlab-shell/hooks/pre-receive#L8

This MR does the following:

  1. move WriteCustomHook and WriteEnvToCustomHook to the testhelper package.
  2. encapsulate GL_* values into a new struct GlHookValues to make the EnvForHooks signature a little nicer
  3. add assertions that test GL_* values get passed to custom hooks
Edited by GitLab Release Tools Bot

Merge request reports

Loading