[MM-62660] Makefile: add ability to run local file store tests as standalone (#30260)
* server/Makefile: add ability to test&benchmark local file store only * remove benchmark
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
b0b379e167
Коммит
a7905541b8
@@ -846,3 +846,6 @@ test-migration:
|
|||||||
# for now we exclude plugins such as playbooks and focalboard
|
# for now we exclude plugins such as playbooks and focalboard
|
||||||
# we also exlude systems table temporarily due to adding some keys while running the initial migration
|
# we also exlude systems table temporarily due to adding some keys while running the initial migration
|
||||||
bin/dbcmp --source "${MYSQL_DSN}" --target "${POSTGRES_DSN}" --exclude="db_migrations","ir_","focalboard","systems"
|
bin/dbcmp --source "${MYSQL_DSN}" --target "${POSTGRES_DSN}" --exclude="db_migrations","ir_","focalboard","systems"
|
||||||
|
|
||||||
|
test-local-filestore: # Run tests for local filestore
|
||||||
|
$(GO) test ./platform/shared/filestore -run '^TestLocalFileBackend' -v
|
||||||
|
|||||||
@@ -44,9 +44,34 @@ func TestLocalFileBackendTestSuite(t *testing.T) {
|
|||||||
|
|
||||||
mlog.InitGlobalLogger(logger)
|
mlog.InitGlobalLogger(logger)
|
||||||
|
|
||||||
dir, err := os.MkdirTemp("", "")
|
var dir string
|
||||||
require.NoError(t, err)
|
|
||||||
defer os.RemoveAll(dir)
|
// If MM_FILESETTINGS_DIRECTORY is set, use it as the directory for the local file backend.
|
||||||
|
// We don't remove the directory after the test since it's provided by the user.
|
||||||
|
if val := os.Getenv("MM_FILESETTINGS_DIRECTORY"); val != "" {
|
||||||
|
dir = val
|
||||||
|
info, err := os.Stat(dir)
|
||||||
|
require.False(t, os.IsNotExist(err))
|
||||||
|
require.True(t, info.IsDir())
|
||||||
|
|
||||||
|
t.Cleanup(func() {
|
||||||
|
entries, err := os.ReadDir(dir)
|
||||||
|
require.NoError(t, err)
|
||||||
|
for _, entry := range entries {
|
||||||
|
p := filepath.Join(dir, entry.Name())
|
||||||
|
require.NoError(t, os.RemoveAll(p))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
var err error
|
||||||
|
dir, err = os.MkdirTemp("", "")
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
t.Cleanup(func() {
|
||||||
|
err := os.RemoveAll(dir)
|
||||||
|
require.NoError(t, err)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
suite.Run(t, &FileBackendTestSuite{
|
suite.Run(t, &FileBackendTestSuite{
|
||||||
settings: FileBackendSettings{
|
settings: FileBackendSettings{
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user