hunk.code_window: 	RootCmd.AddCommand(TestCmd)
   }
   func webClientTestsCmdF(command *cobra.Command, args []string) error {
   	a, err := InitDBCommandContextCobra(command)
   	if err != nil {
   		return err
   	}
   	defer a.Srv().Shutdown()
  
hunk.labels: keep keep keep keep replace keep keep keep keep keep
hunk.after_edit: 	a, err := InitDBCommandContextCobra(command, app.StartMetrics)
  
hunk.file_path: cmd/mattermost/commands/test.go
hunk.type: replace
file: SET @preparedStatement = (SELECT IF(
      (
          SELECT COUNT(*) FROM INFORMATION_SCHEMA.STATISTICS
          WHERE table_name = 'UserGroups'
          AND table_schema = DATABASE()
          AND index_name = 'idx_usergroups_displayname'
      ) > 0,
      'DROP INDEX idx_usergroups_displayname ON UserGroups;',
      'SELECT 1'
  ));
  
  PREPARE removeIndexIfExists FROM @preparedStatement;
  EXECUTE removeIndexIfExists;
  DEALLOCATE PREPARE removeIndexIfExists;