Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavlo Strokov <pstrokov@gitlab.com>2021-03-15 15:10:38 +0300
committerPavlo Strokov <pstrokov@gitlab.com>2021-03-18 12:49:31 +0300
commit63c55949d54543fce205c0f750f8fc502ed9566a (patch)
treea26b220fde2aea0495789d584b35432bc6212751 /cmd/gitaly-ssh
parent2093a05fa4214e69abc75eacea26e926266264b1 (diff)
Linguist converted into an instantiation dependency
Implementation of the linguist package relies on the package-private state: the use of the colorMap variable. It is filled with a hook mechanism after validation of the gitaly configuration. The problem is that this operation invokes ruby code to get it done and this call is pretty expensive. It also doesn't allow us to convert tests to parallel as it causes race conditions in attempt to fill the global variable. The solution to this problem is creation of the struct instance that encapsulates the state and can be instantiated only when needed. The change also includes minification in generating test configuration that does not require to make a ruby call and uses a stub file for initialisation. The behaviour could be returned back to the normal with usage of the WithActualLinguist option for configuration creation. The change also includes renames of the test functions for the linguist package. The change speeds up execution of the tests: before 0m43.907s and after 0m21.659s on my local. Part of: https://gitlab.com/gitlab-org/gitaly/-/issues/2699
Diffstat (limited to 'cmd/gitaly-ssh')
-rw-r--r--cmd/gitaly-ssh/auth_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/gitaly-ssh/auth_test.go b/cmd/gitaly-ssh/auth_test.go
index 50160eb0c..bc428ef04 100644
--- a/cmd/gitaly-ssh/auth_test.go
+++ b/cmd/gitaly-ssh/auth_test.go
@@ -136,7 +136,7 @@ func runServer(t *testing.T, secure bool, cfg config.Cfg, connectionType string,
gitCmdFactory := git.NewExecCommandFactory(cfg)
srv, err := server.New(secure, cfg, testhelper.DiscardTestEntry(t))
require.NoError(t, err)
- service.RegisterAll(srv, cfg, nil, hookManager, txManager, locator, conns, gitCmdFactory)
+ service.RegisterAll(srv, cfg, nil, hookManager, txManager, locator, conns, gitCmdFactory, nil)
listener, err := net.Listen(connectionType, addr)
require.NoError(t, err)