* Enable products for channels tests

* increase unit test timeout; check IsConfigReadOnly

* make app-layers

* Avoid loading boards tempaltes between tests to improve speed

* Fix delete query to be compatible with both databases

* Avoid preserving the templates for boards store tests

* Run all tests in one command

* Revert "Run all tests in one command"

This reverts commit 0330f7cd8f96b47776770e8f80ba6ba18d98b8d1.

* concurrent pkg group tests in CI

* Revert "Revert "Run all tests in one command""

This reverts commit 73892fec772575ff054a99ba9e00a7b57ca74164.

* Revert "concurrent pkg group tests in CI"

This reverts commit 550fb6cdd4a7f14d9632f2626bc66f389173b5d9.

* try testing 3 subsets of packages concurrently to improve time taken

* Revert "try testing 3 subsets of packages concurrently to improve time taken"

This reverts commit 97475f3c4eafa8bbe047097e0841220884f68cdc.

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: wiggin77 <wiggin77@warpmail.net>
Этот коммит содержится в:
Miguel de la Cruz
2023-04-18 13:58:33 +02:00
коммит произвёл GitHub
родитель a8d79ec3da
Коммит 067e36c23c
43 изменённых файлов: 377 добавлений и 105 удалений

Просмотреть файл

@@ -20,11 +20,13 @@ const (
botDescription = "Created by Boards plugin."
)
var FocalboardBot = &mm_model.Bot{
Username: botUsername,
DisplayName: botDisplayname,
Description: botDescription,
OwnerId: SystemUserID,
func GetDefaultFocalboardBot() *mm_model.Bot {
return &mm_model.Bot{
Username: botUsername,
DisplayName: botDisplayname,
Description: botDescription,
OwnerId: SystemUserID,
}
}
type ServicesAPI interface {

Просмотреть файл

@@ -66,7 +66,7 @@ func createSubscriptionsNotifyBackend(params notifyBackendParams) (*notifysubscr
}
func createDelivery(servicesAPI model.ServicesAPI, serverRoot string) (*plugindelivery.PluginDelivery, error) {
bot := model.FocalboardBot
bot := model.GetDefaultFocalboardBot()
botID, err := servicesAPI.EnsureBot(bot)
if err != nil {

Просмотреть файл

@@ -70,9 +70,10 @@ func New(dbType string, db *sql.DB, store store.Store, logger mlog.LoggerIFace,
return layer, nil
}
// Shutdown close the connection with the store.
// For MattermostAuthLayer we don't close the database connection
// because it's directly managed by the platform
func (s *MattermostAuthLayer) Shutdown() error {
return s.Store.Shutdown()
return nil
}
func (s *MattermostAuthLayer) GetRegisteredUserCount() (int, error) {
@@ -1218,7 +1219,7 @@ func (s *MattermostAuthLayer) GetChannel(teamID, channelID string) (*mm_model.Ch
func (s *MattermostAuthLayer) getBoardsBotID() (string, error) {
if boardsBotID == "" {
var err error
boardsBotID, err = s.servicesAPI.EnsureBot(model.FocalboardBot)
boardsBotID, err = s.servicesAPI.EnsureBot(model.GetDefaultFocalboardBot())
if err != nil {
s.logger.Error("failed to ensure boards bot", mlog.Err(err))
return "", err

Просмотреть файл

@@ -24,11 +24,11 @@ func TestGetBoardsBotID(t *testing.T) {
mmAuthLayer, _ := New("test", nil, nil, mlog.CreateConsoleTestLogger(true, mlog.LvlError), servicesAPI, "")
servicesAPI.EXPECT().EnsureBot(model.FocalboardBot).Return("", errTest)
servicesAPI.EXPECT().EnsureBot(model.GetDefaultFocalboardBot()).Return("", errTest)
_, err := mmAuthLayer.getBoardsBotID()
require.NotEmpty(t, err)
servicesAPI.EXPECT().EnsureBot(model.FocalboardBot).Return("TestBotID", nil).Times(1)
servicesAPI.EXPECT().EnsureBot(model.GetDefaultFocalboardBot()).Return("TestBotID", nil).Times(1)
botID, err := mmAuthLayer.getBoardsBotID()
require.Empty(t, err)
require.NotEmpty(t, botID)

Просмотреть файл

@@ -199,6 +199,10 @@ func (s *SQLStore) DBVersion() string {
return version
}
// dropAllTables deletes the contents of all the database tables
// except the schema_migrations table with the intention of cleaning
// the state for the next text to execute without having to run the
// migrations.
func (s *SQLStore) dropAllTables(db sq.BaseRunner) error {
if s.DBType() == model.PostgresDBType {
_, err := db.Exec(`DO