* format using `goimports -local github.com/mattermost/mattermost-server/v5 -w`

* added goimports lint check to .golangci.yml

* format using `goimports -local github.com/mattermost/mattermost-server/v5 -w` for a corner case

* make app-layers, *-mocks and store-layers for ci check

Co-authored-by: Mahmudul Haque <mahmudulhaque@protonmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Agniva De Sarker
2021-01-07 22:42:43 +05:30
коммит произвёл GitHub
родитель 0c2c31bb0a
Коммит e89b26e8f3
337 изменённых файлов: 728 добавлений и 508 удалений

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

@@ -6,11 +6,10 @@ package localcachelayer
import (
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store/storetest"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
)

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

@@ -6,11 +6,12 @@ package localcachelayer
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store/storetest"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestEmojiStore(t *testing.T) {

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

@@ -6,11 +6,12 @@ package localcachelayer
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store/storetest"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestFileInfoStore(t *testing.T) {

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

@@ -7,15 +7,15 @@ import (
"fmt"
"testing"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/services/cache"
"github.com/stretchr/testify/mock"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/services/cache"
cachemocks "github.com/mattermost/mattermost-server/v5/services/cache/mocks"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/mattermost/mattermost-server/v5/testlib"
"github.com/stretchr/testify/mock"
)
var mainHelper *testlib.MainHelper

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

@@ -4,13 +4,12 @@
package localcachelayer
import (
"fmt"
"strconv"
"strings"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"fmt"
)
type LocalCachePostStore struct {

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

@@ -7,11 +7,12 @@ import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store/storetest"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestPostStore(t *testing.T) {

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

@@ -6,11 +6,12 @@ package localcachelayer
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store/storetest"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestReactionStore(t *testing.T) {

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

@@ -6,11 +6,12 @@ package localcachelayer
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store/storetest"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestRoleStore(t *testing.T) {

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

@@ -6,11 +6,12 @@ package localcachelayer
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store/storetest"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestSchemeStore(t *testing.T) {

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

@@ -6,10 +6,11 @@ package localcachelayer
import (
"testing"
"github.com/mattermost/mattermost-server/v5/store/storetest"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/store/storetest"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
)
func TestTeamStore(t *testing.T) {

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

@@ -6,11 +6,12 @@ package localcachelayer
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store/storetest"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestTermsOfServiceStore(t *testing.T) {

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

@@ -8,9 +8,10 @@ import (
"github.com/go-sql-driver/mysql"
"github.com/lib/pq"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/pkg/errors"
)
func genStore() *mocks.Store {

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

@@ -4,11 +4,12 @@
package searchlayer
import (
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/services/searchengine"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/pkg/errors"
)
type SearchChannelStore struct {

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

@@ -4,11 +4,12 @@
package searchlayer
import (
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/services/searchengine"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/pkg/errors"
)
type SearchPostStore struct {

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

@@ -6,11 +6,12 @@ package searchlayer
import (
"strings"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/services/searchengine"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/pkg/errors"
)
type SearchUserStore struct {

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

@@ -3,7 +3,9 @@
package searchlayer
import "strings"
import (
"strings"
)
func sanitizeSearchTerm(term string) string {
return strings.TrimLeft(term, "@")

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

@@ -6,9 +6,10 @@ package searchtest
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/require"
)
var searchChannelStoreTests = []searchTest{

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

@@ -7,12 +7,12 @@ import (
"fmt"
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)
type SearchTestHelper struct {

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

@@ -7,9 +7,10 @@ import (
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/require"
)
var searchPostStoreTests = []searchTest{

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

@@ -6,9 +6,10 @@ package searchtest
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/require"
)
var searchUserStoreTests = []searchTest{

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

@@ -8,11 +8,11 @@ import (
"fmt"
"strings"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/einterfaces"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/pkg/errors"
)
// bot is a subset of the model.Bot type, omitting the model.User fields.

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

@@ -8,12 +8,11 @@ import (
"fmt"
sq "github.com/Masterminds/squirrel"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/pkg/errors"
)
type SqlChannelMemberHistoryStore struct {

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

@@ -11,15 +11,15 @@ import (
"strings"
"time"
sq "github.com/Masterminds/squirrel"
"github.com/mattermost/gorp"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/einterfaces"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/services/cache"
"github.com/mattermost/mattermost-server/v5/store"
sq "github.com/Masterminds/squirrel"
"github.com/pkg/errors"
)
const (

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

@@ -6,12 +6,12 @@ package sqlstore
import (
"fmt"
sq "github.com/Masterminds/squirrel"
"github.com/mattermost/gorp"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
sq "github.com/Masterminds/squirrel"
"github.com/pkg/errors"
)
func (s SqlChannelStore) CreateInitialSidebarCategories(userId, teamId string) error {

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

@@ -6,11 +6,11 @@ package sqlstore
import (
"database/sql"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
sq "github.com/Masterminds/squirrel"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)
type SqlCommandStore struct {

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

@@ -7,12 +7,11 @@ import (
"database/sql"
sq "github.com/Masterminds/squirrel"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/pkg/errors"
)
type SqlCommandWebhookStore struct {

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

@@ -7,10 +7,10 @@ import (
"strconv"
"strings"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/pkg/errors"
)
type SqlComplianceStore struct {

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

@@ -3,7 +3,9 @@
package sqlstore
import "context"
import (
"context"
)
// storeContextKey is the base type for all context keys for the store.
type storeContextKey string

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

@@ -7,11 +7,11 @@ import (
"database/sql"
"fmt"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/einterfaces"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/pkg/errors"
)
type SqlEmojiStore struct {

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

@@ -4,10 +4,10 @@
package sqlstore
import (
sq "github.com/Masterminds/squirrel"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
sq "github.com/Masterminds/squirrel"
)
type relationalCheckConfig struct {

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

@@ -9,9 +9,9 @@ import (
"strings"
sq "github.com/Masterminds/squirrel"
"github.com/mattermost/gorp"
"github.com/pkg/errors"
"github.com/mattermost/gorp"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)

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

@@ -4,9 +4,8 @@
package sqlstore
import (
"github.com/pkg/errors"
sq "github.com/Masterminds/squirrel"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"

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

@@ -6,11 +6,11 @@ package sqlstore
import (
"database/sql"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
sq "github.com/Masterminds/squirrel"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)
type SqlLinkMetadataStore struct {

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

@@ -8,7 +8,6 @@ import (
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/store/sqlstore"
"github.com/mattermost/mattermost-server/v5/testlib"
)

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

@@ -8,10 +8,10 @@ import (
"fmt"
"github.com/mattermost/gorp"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/pkg/errors"
)
type SqlOAuthStore struct {

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

@@ -4,9 +4,10 @@
package sqlstore
import (
"github.com/stretchr/testify/require"
"testing"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/store/searchtest"
"github.com/mattermost/mattermost-server/v5/store/storetest"
)

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

@@ -6,9 +6,9 @@ package sqlstore
import (
"fmt"
"github.com/mattermost/gorp"
"github.com/pkg/errors"
"github.com/mattermost/gorp"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"

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

@@ -6,11 +6,11 @@ package sqlstore
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/mattermost/mattermost-server/v5/store/storetest"
"github.com/stretchr/testify/require"
)
func TestPreferenceStore(t *testing.T) {

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

@@ -7,10 +7,10 @@ import (
"time"
sq "github.com/Masterminds/squirrel"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/pkg/errors"
)
type SqlProductNoticesStore struct {

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

@@ -4,12 +4,12 @@
package sqlstore
import (
"github.com/mattermost/gorp"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/mattermost/gorp"
"github.com/pkg/errors"
)
type SqlReactionStore struct {

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

@@ -9,9 +9,9 @@ import (
"strings"
sq "github.com/Masterminds/squirrel"
"github.com/mattermost/gorp"
"github.com/pkg/errors"
"github.com/mattermost/gorp"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)

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

@@ -9,10 +9,10 @@ import (
"strings"
"github.com/mattermost/gorp"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/pkg/errors"
)
type SqlSchemeStore struct {

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

@@ -15,21 +15,20 @@ import (
"sync/atomic"
"time"
"github.com/pkg/errors"
sq "github.com/Masterminds/squirrel"
"github.com/dyatlov/go-opengraph/opengraph"
"github.com/go-sql-driver/mysql"
_ "github.com/go-sql-driver/mysql"
"github.com/lib/pq"
_ "github.com/lib/pq"
"github.com/mattermost/gorp"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/einterfaces"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/mattermost/mattermost-server/v5/utils"
_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
)
const (

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

@@ -13,15 +13,15 @@ import (
"github.com/go-sql-driver/mysql"
"github.com/lib/pq"
"github.com/mattermost/gorp"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/mattermost/mattermost-server/v5/store/searchtest"
"github.com/mattermost/mattermost-server/v5/store/storetest"
_ "github.com/mattn/go-sqlite3"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
_ "github.com/mattn/go-sqlite3"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/mattermost/mattermost-server/v5/store/searchtest"
"github.com/mattermost/mattermost-server/v5/store/storetest"
)
type storeType struct {

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

@@ -10,11 +10,11 @@ import (
"strings"
"time"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/pkg/errors"
)
type SqlSystemStore struct {

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

@@ -10,9 +10,9 @@ import (
"strings"
sq "github.com/Masterminds/squirrel"
"github.com/mattermost/gorp"
"github.com/pkg/errors"
"github.com/mattermost/gorp"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/mattermost/mattermost-server/v5/utils"

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

@@ -6,11 +6,11 @@ package sqlstore
import (
"database/sql"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/einterfaces"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/pkg/errors"
)
type SqlTermsOfServiceStore struct {

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

@@ -7,12 +7,12 @@ import (
"database/sql"
"time"
sq "github.com/Masterminds/squirrel"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/pkg/errors"
sq "github.com/Masterminds/squirrel"
)
type SqlThreadStore struct {

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

@@ -7,11 +7,11 @@ import (
"database/sql"
"fmt"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/pkg/errors"
)
type SqlTokenStore struct {

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

@@ -6,8 +6,9 @@ package sqlstore
import (
"testing"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/store"
)
func TestStoreUpgrade(t *testing.T) {

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

@@ -6,12 +6,11 @@ package sqlstore
import (
"database/sql"
sq "github.com/Masterminds/squirrel"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
sq "github.com/Masterminds/squirrel"
)
type SqlUploadSessionStore struct {

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

@@ -7,9 +7,9 @@ import (
"database/sql"
"fmt"
"github.com/mattermost/gorp"
"github.com/pkg/errors"
"github.com/mattermost/gorp"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)

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

@@ -10,13 +10,13 @@ import (
"sort"
"strings"
sq "github.com/Masterminds/squirrel"
"github.com/mattermost/gorp"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/einterfaces"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
sq "github.com/Masterminds/squirrel"
"github.com/pkg/errors"
)
const (

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

@@ -6,10 +6,10 @@ package sqlstore
import (
"database/sql"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/pkg/errors"
)
type SqlUserTermsOfServiceStore struct {

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

@@ -10,6 +10,7 @@ import (
"unicode"
"github.com/mattermost/gorp"
"github.com/mattermost/mattermost-server/v5/mlog"
)

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

@@ -6,9 +6,9 @@ package sqlstore
import (
"database/sql"
sq "github.com/Masterminds/squirrel"
"github.com/pkg/errors"
sq "github.com/Masterminds/squirrel"
"github.com/mattermost/mattermost-server/v5/einterfaces"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"

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

@@ -7,10 +7,11 @@ import (
"testing"
"time"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)
func TestAuditStore(t *testing.T, ss store.Store) {

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

@@ -8,10 +8,11 @@ import (
"math"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)
func TestChannelMemberHistoryStore(t *testing.T, ss store.Store) {

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

@@ -11,10 +11,10 @@ import (
"testing"
"time"
"github.com/mattermost/gorp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/gorp"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/services/timezones"
"github.com/mattermost/mattermost-server/v5/store"

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

@@ -9,10 +9,11 @@ import (
"sync"
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)
func TestChannelStoreCategories(t *testing.T, ss store.Store, s SqlStore) {

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

@@ -5,13 +5,13 @@ package storetest
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestClusterDiscoveryStore(t *testing.T, ss store.Store) {

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

@@ -7,10 +7,11 @@ import (
"errors"
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)
func TestCommandWebhookStore(t *testing.T, ss store.Store) {

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

@@ -8,10 +8,11 @@ import (
"testing"
"time"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)
func cleanupStoreState(t *testing.T, ss store.Store) {

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

@@ -9,10 +9,11 @@ import (
"time"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)
func TestJobStore(t *testing.T, ss store.Store) {

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

@@ -6,9 +6,10 @@ package storetest
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/require"
)
func TestLicenseStore(t *testing.T, ss store.Store) {

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

@@ -9,10 +9,11 @@ import (
"time"
"github.com/dyatlov/go-opengraph/opengraph"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)
// These tests are ran on the same store instance, so this provides easier unique, valid timestamps

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

@@ -4,7 +4,9 @@
package mocks
import mock "github.com/stretchr/testify/mock"
import (
mock "github.com/stretchr/testify/mock"
)
// ObjectCache is an autogenerated mock type for the ObjectCache type
type ObjectCache struct {

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

@@ -6,10 +6,11 @@ package storetest
import (
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)
func TestOAuthStore(t *testing.T, ss store.Store) {

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

@@ -7,11 +7,11 @@ import (
"sort"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/assert"
)
func TestPluginStore(t *testing.T, ss store.Store, s SqlStore) {

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

@@ -10,11 +10,12 @@ import (
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestPostStore(t *testing.T, ss store.Store, s SqlStore) {

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

@@ -4,11 +4,12 @@
package storetest
import (
"github.com/mattermost/mattermost-server/v5/model"
"testing"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)
func TestProductNoticesStore(t *testing.T, ss store.Store) {

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

@@ -8,12 +8,12 @@ import (
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/mattermost/mattermost-server/v5/store/retrylayer"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestReactionStore(t *testing.T, ss store.Store) {

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

@@ -6,11 +6,11 @@ package storetest
import (
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)
const (

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

@@ -4,14 +4,13 @@
package storetest
import (
"database/sql"
"flag"
"fmt"
"net/url"
"os"
"path"
"database/sql"
"github.com/go-sql-driver/mysql"
_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"

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

@@ -7,10 +7,11 @@ import (
"context"
"time"
"github.com/stretchr/testify/mock"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/stretchr/testify/mock"
)
// Store can be used to provide mock stores for testing.

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

@@ -6,10 +6,11 @@ package storetest
import (
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)
func TestTermsOfServiceStore(t *testing.T, ss store.Store) {

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

@@ -7,10 +7,11 @@ import (
"testing"
"time"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)
func TestThreadStore(t *testing.T, ss store.Store, s SqlStore) {

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

@@ -7,10 +7,10 @@ import (
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/require"
)
func TestUploadSessionStore(t *testing.T, ss store.Store) {

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

@@ -6,9 +6,10 @@ package storetest
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/require"
)
func TestUserAccessTokenStore(t *testing.T, ss store.Store) {

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

@@ -7,10 +7,11 @@ import (
"errors"
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)
func TestUserTermsOfServiceStore(t *testing.T, ss store.Store) {

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

@@ -8,10 +8,10 @@ import (
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/stretchr/testify/require"
)
func TestWebhookStore(t *testing.T, ss store.Store) {