Only start needed modules for tests

This commit is contained in:
Daniel 2021-12-22 11:19:06 +01:00
parent 466210b613
commit bbab3f11b0

View file

@ -53,7 +53,10 @@ func TestMain(m *testing.M, module *modules.Module) {
// afterStartFn after modules have started and beforeStopFn before modules // afterStartFn after modules have started and beforeStopFn before modules
// are shutdown. // are shutdown.
func TestMainWithHooks(m *testing.M, module *modules.Module, afterStartFn, beforeStopFn TestHookFunc) { func TestMainWithHooks(m *testing.M, module *modules.Module, afterStartFn, beforeStopFn TestHookFunc) {
// enable module for testing // Only enable needed modules.
modules.EnableModuleManagement(nil)
// Enable this module for testing.
if module != nil { if module != nil {
module.Enable() module.Enable()
} }