mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-15 10:53:09 -06:00
Fix broken symbols due to rename
Also: rename SyncServerDatabase to SyncServerDatasource in comment in syncserver.go
This commit is contained in:
parent
9f63d9f0c3
commit
81126c21d9
2
go.sum
2
go.sum
|
|
@ -82,6 +82,7 @@ github.com/pierrec/xxHash v0.0.0-20160112165351-5a004441f897 h1:jp3jc/PyyTrTKjJJ
|
|||
github.com/pierrec/xxHash v0.0.0-20160112165351-5a004441f897/go.mod h1:w2waW5Zoa/Wc4Yqe0wgrIYAGKqRMf7czn2HNKXmuL+I=
|
||||
github.com/pkg/errors v0.0.0-20170505043639-c605e284fe17 h1:chPfVn+gpAM5CTpTyVU9j8J+xgRGwmoDlNDLjKnJiYo=
|
||||
github.com/pkg/errors v0.0.0-20170505043639-c605e284fe17/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_golang v0.0.0-20180519192340-c51dc758d4bb h1:ghXIh3jvLRo/h3y2O7wBgcmH1th5NXQ4XHwK5CgI//I=
|
||||
github.com/prometheus/client_golang v0.0.0-20180519192340-c51dc758d4bb/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
|
|
@ -104,6 +105,7 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
|||
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
|
||||
github.com/stretchr/testify v0.0.0-20170809224252-890a5c3458b4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/tidwall/gjson v1.0.2 h1:5BsM7kyEAHAUGEGDkEKO9Mdyiuw6QQ6TSDdarP0Nnmk=
|
||||
github.com/tidwall/gjson v1.0.2/go.mod h1:c/nTNbUr0E0OrXEhq1pwa8iEgc2DOt4ZZqAt1HtCkPA=
|
||||
|
|
|
|||
|
|
@ -3,14 +3,15 @@ package storage
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/matrix-org/dendrite/roomserver/api"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/matrix-org/dendrite/roomserver/api"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
var dataSource string
|
||||
|
|
@ -57,7 +58,7 @@ func init() {
|
|||
const testEventID = "$test-event-id:test-domain.example.com"
|
||||
|
||||
func Test_sanityCheckOutputRoomEvents(t *testing.T) {
|
||||
db, err := NewSyncServerDatabase(dataSource)
|
||||
db, err := NewSyncServerDatasource(dataSource)
|
||||
assert.Nil(t, err)
|
||||
|
||||
err = db.events.prepare(db.db)
|
||||
|
|
@ -69,8 +70,8 @@ func Test_sanityCheckOutputRoomEvents(t *testing.T) {
|
|||
truncateTable(t, db)
|
||||
}
|
||||
|
||||
func TestSyncServerDatabase_selectEventsWithEventIDs(t *testing.T) {
|
||||
db, err := NewSyncServerDatabase(dataSource)
|
||||
func TestSyncServerDatasource_selectEventsWithEventIDs(t *testing.T) {
|
||||
db, err := NewSyncServerDatasource(dataSource)
|
||||
assert.Nil(t, err)
|
||||
insertTestEvent(t, db)
|
||||
ctx := context.Background()
|
||||
|
|
@ -86,7 +87,7 @@ func TestSyncServerDatabase_selectEventsWithEventIDs(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func insertTestEvent(t *testing.T, db *SyncServerDatabase) {
|
||||
func insertTestEvent(t *testing.T, db *SyncServerDatasource) {
|
||||
txn, err := db.db.Begin()
|
||||
assert.Nil(t, err)
|
||||
|
||||
|
|
@ -128,7 +129,7 @@ func insertTestEvent(t *testing.T, db *SyncServerDatabase) {
|
|||
})
|
||||
}
|
||||
|
||||
func selectTestEvent(t *testing.T, db *SyncServerDatabase) {
|
||||
func selectTestEvent(t *testing.T, db *SyncServerDatasource) {
|
||||
ctx := context.Background()
|
||||
|
||||
var eventIDs = []string{testEventID}
|
||||
|
|
@ -141,7 +142,7 @@ func selectTestEvent(t *testing.T, db *SyncServerDatabase) {
|
|||
})
|
||||
}
|
||||
|
||||
func truncateTable(t *testing.T, db *SyncServerDatabase) {
|
||||
func truncateTable(t *testing.T, db *SyncServerDatasource) {
|
||||
_, err := db.db.Exec("TRUNCATE syncapi_output_room_events")
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ type SyncServerDatasource struct {
|
|||
typingCache *cache.TypingCache
|
||||
}
|
||||
|
||||
// NewSyncServerDatabase creates a new sync server database
|
||||
// NewSyncServerDatasource creates a new sync server database
|
||||
func NewSyncServerDatasource(dbDataSourceName string) (*SyncServerDatasource, error) {
|
||||
var d SyncServerDatasource
|
||||
var err error
|
||||
|
|
|
|||
Loading…
Reference in a new issue