mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-21 13:53:09 -06:00
Fix more tests
This commit is contained in:
parent
11a7073c97
commit
65cae7a8f4
|
|
@ -19,19 +19,14 @@ import (
|
||||||
// Relevant for v3 rooms and a cause of flakey sytests as the IDs are randomly generated.
|
// Relevant for v3 rooms and a cause of flakey sytests as the IDs are randomly generated.
|
||||||
func TestRoomsV3URLEscapeDoNot404(t *testing.T) {
|
func TestRoomsV3URLEscapeDoNot404(t *testing.T) {
|
||||||
_, privKey, _ := ed25519.GenerateKey(nil)
|
_, privKey, _ := ed25519.GenerateKey(nil)
|
||||||
cfg := &config.Dendrite{
|
cfg := &config.Dendrite{}
|
||||||
Global: config.Global{
|
cfg.Defaults()
|
||||||
KeyID: gomatrixserverlib.KeyID("ed25519:auto"),
|
cfg.Global.KeyID = gomatrixserverlib.KeyID("ed25519:auto")
|
||||||
ServerName: gomatrixserverlib.ServerName("localhost"),
|
cfg.Global.ServerName = gomatrixserverlib.ServerName("localhost")
|
||||||
PrivateKey: privKey,
|
cfg.Global.PrivateKey = privKey
|
||||||
},
|
|
||||||
FederationSender: config.FederationSender{
|
|
||||||
Database: "file::memory:",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
cfg.FederationSender.Matrix = &cfg.Global
|
|
||||||
cfg.Global.Kafka.UseNaffka = true
|
cfg.Global.Kafka.UseNaffka = true
|
||||||
// TODO: cfg.SetDefaults()
|
cfg.Global.Kafka.Database = "file::memory:"
|
||||||
|
cfg.FederationSender.Database = "file::memory:"
|
||||||
base := setup.NewBaseDendrite(cfg, "Test", false)
|
base := setup.NewBaseDendrite(cfg, "Test", false)
|
||||||
keyRing := &test.NopJSONVerifier{}
|
keyRing := &test.NopJSONVerifier{}
|
||||||
fsAPI := base.FederationSenderHTTPClient()
|
fsAPI := base.FederationSenderHTTPClient()
|
||||||
|
|
|
||||||
|
|
@ -33,48 +33,156 @@ func TestLoadConfigRelative(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const testConfig = `
|
const testConfig = `
|
||||||
version: 0
|
version: 1
|
||||||
matrix:
|
global:
|
||||||
server_name: localhost
|
server_name: localhost
|
||||||
private_key: matrix_key.pem
|
private_key: matrix.pem
|
||||||
federation_certificates: [tls_cert.pem]
|
key_validity_period: 168h0m0s
|
||||||
media:
|
trusted_third_party_id_servers: []
|
||||||
base_path: media_store
|
kafka:
|
||||||
kafka:
|
addresses: []
|
||||||
addresses: ["localhost:9092"]
|
use_naffka: true
|
||||||
|
naffka_database: file:naffka.db
|
||||||
|
naffka_database_options:
|
||||||
|
database_max_open_conns: 0
|
||||||
|
database_max_idle_conns: 0
|
||||||
|
database_conn_max_lifetime: -1
|
||||||
topics:
|
topics:
|
||||||
output_room_event: output.room
|
output_room_event: OutputRoomEventTopic
|
||||||
output_client_data: output.client
|
output_client_data: OutputClientDataTopic
|
||||||
output_typing_event: output.typing
|
output_typing_event: OutputTypingEventTopic
|
||||||
output_send_to_device_event: output.std
|
output_send_to_device_event: OutputSendToDeviceEventTopic
|
||||||
output_key_change_event: output.key_change
|
output_key_change_event: OutputKeyChangeEventTopic
|
||||||
user_updates: output.user
|
metrics:
|
||||||
database:
|
enabled: false
|
||||||
media_api: "postgresql:///media_api"
|
basic_auth:
|
||||||
account: "postgresql:///account"
|
username: metrics
|
||||||
device: "postgresql:///device"
|
password: metrics
|
||||||
server_key: "postgresql:///server_keys"
|
app_service_api:
|
||||||
sync_api: "postgresql:///syn_api"
|
listen: localhost:7777
|
||||||
room_server: "postgresql:///room_server"
|
bind: localhost:7777
|
||||||
appservice: "postgresql:///appservice"
|
database: file:appservice.db
|
||||||
current_state: "postgresql:///current_state"
|
database_options:
|
||||||
e2e_key: "postgresql:///e2e_key"
|
database_max_open_conns: 0
|
||||||
listen:
|
database_max_idle_conns: 0
|
||||||
room_server: "localhost:7770"
|
database_conn_max_lifetime: -1
|
||||||
client_api: "localhost:7771"
|
config_files: []
|
||||||
federation_api: "localhost:7772"
|
client_api:
|
||||||
sync_api: "localhost:7773"
|
listen: localhost:7771
|
||||||
media_api: "localhost:7774"
|
bind: localhost:7771
|
||||||
appservice_api: "localhost:7777"
|
registration_shared_secret: ""
|
||||||
edu_server: "localhost:7778"
|
recaptcha_public_key: ""
|
||||||
user_api: "localhost:7779"
|
recaptcha_private_key: ""
|
||||||
current_state_server: "localhost:7775"
|
enable_registration_captcha: false
|
||||||
key_server: "localhost:7776"
|
captcha_bypass_secret: ""
|
||||||
logging:
|
recaptcha_siteverify_api: ""
|
||||||
- type: "file"
|
registration_disabled: false
|
||||||
level: "info"
|
turn:
|
||||||
params:
|
turn_user_lifetime: ""
|
||||||
path: "/my/log/dir"
|
turn_uris: []
|
||||||
|
turn_shared_secret: ""
|
||||||
|
turn_username: ""
|
||||||
|
turn_password: ""
|
||||||
|
current_state_server:
|
||||||
|
listen: localhost:7782
|
||||||
|
bind: localhost:7782
|
||||||
|
database: file:currentstate.db
|
||||||
|
database_options:
|
||||||
|
database_max_open_conns: 0
|
||||||
|
database_max_idle_conns: 0
|
||||||
|
database_conn_max_lifetime: -1
|
||||||
|
edu_server:
|
||||||
|
listen: localhost:7778
|
||||||
|
bind: localhost:7778
|
||||||
|
federation_api:
|
||||||
|
listen: localhost:7772
|
||||||
|
bind: localhost:7772
|
||||||
|
federation_certificates: []
|
||||||
|
federation_sender:
|
||||||
|
listen: localhost:7775
|
||||||
|
bind: localhost:7775
|
||||||
|
database: file:federationsender.db
|
||||||
|
database_options:
|
||||||
|
database_max_open_conns: 0
|
||||||
|
database_max_idle_conns: 0
|
||||||
|
database_conn_max_lifetime: -1
|
||||||
|
federation_max_retries: 16
|
||||||
|
proxy:
|
||||||
|
protocol: ""
|
||||||
|
host: ""
|
||||||
|
port: 0
|
||||||
|
key_server:
|
||||||
|
listen: localhost:7779
|
||||||
|
bind: localhost:7779
|
||||||
|
database: file:keyserver.db
|
||||||
|
database_options:
|
||||||
|
database_max_open_conns: 0
|
||||||
|
database_max_idle_conns: 0
|
||||||
|
database_conn_max_lifetime: -1
|
||||||
|
media_api:
|
||||||
|
listen: localhost:7774
|
||||||
|
bind: localhost:7774
|
||||||
|
database: file:mediaapi.db
|
||||||
|
database_options:
|
||||||
|
database_max_open_conns: 0
|
||||||
|
database_max_idle_conns: 0
|
||||||
|
database_conn_max_lifetime: -1
|
||||||
|
base_path: ""
|
||||||
|
max_file_size_bytes: 10485760
|
||||||
|
dynamic_thumbnails: false
|
||||||
|
max_thumbnail_generators: 10
|
||||||
|
thumbnail_sizes: []
|
||||||
|
room_server:
|
||||||
|
listen: localhost:7770
|
||||||
|
bind: localhost:7770
|
||||||
|
database: file:roomserver.db
|
||||||
|
database_options:
|
||||||
|
database_max_open_conns: 0
|
||||||
|
database_max_idle_conns: 0
|
||||||
|
database_conn_max_lifetime: -1
|
||||||
|
server_key_api:
|
||||||
|
listen: localhost:7780
|
||||||
|
bind: localhost:7780
|
||||||
|
database: file:serverkeyapi.db
|
||||||
|
database_options:
|
||||||
|
database_max_open_conns: 0
|
||||||
|
database_max_idle_conns: 0
|
||||||
|
database_conn_max_lifetime: -1
|
||||||
|
key_perspectives: []
|
||||||
|
sync_api:
|
||||||
|
listen: localhost:7773
|
||||||
|
bind: localhost:7773
|
||||||
|
database: file:syncapi.db
|
||||||
|
database_options:
|
||||||
|
database_max_open_conns: 0
|
||||||
|
database_max_idle_conns: 0
|
||||||
|
database_conn_max_lifetime: -1
|
||||||
|
user_api:
|
||||||
|
listen: localhost:7781
|
||||||
|
bind: localhost:7781
|
||||||
|
account_database: file:userapi_accounts.db
|
||||||
|
account_database_options:
|
||||||
|
database_max_open_conns: 0
|
||||||
|
database_max_idle_conns: 0
|
||||||
|
database_conn_max_lifetime: -1
|
||||||
|
device_database: file:userapi_devices.db
|
||||||
|
device_database_options:
|
||||||
|
database_max_open_conns: 0
|
||||||
|
database_max_idle_conns: 0
|
||||||
|
database_conn_max_lifetime: -1
|
||||||
|
tracing:
|
||||||
|
enabled: false
|
||||||
|
jaeger:
|
||||||
|
serviceName: ""
|
||||||
|
disabled: false
|
||||||
|
rpc_metrics: false
|
||||||
|
tags: []
|
||||||
|
sampler: null
|
||||||
|
reporter: null
|
||||||
|
headers: null
|
||||||
|
baggage_restrictions: null
|
||||||
|
throttler: null
|
||||||
|
logging: []
|
||||||
`
|
`
|
||||||
|
|
||||||
type mockReadFile map[string]string
|
type mockReadFile map[string]string
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue