nixos/synapse: add test for running synapse with workers
Co-authored-by: Daniel Olsen <daniel.olsen99@gmail.com>
This commit is contained in:
parent
3a6a07ecf1
commit
b20cbb12cd
@ -468,6 +468,7 @@ in {
|
|||||||
matrix-appservice-irc = handleTest ./matrix/appservice-irc.nix {};
|
matrix-appservice-irc = handleTest ./matrix/appservice-irc.nix {};
|
||||||
matrix-conduit = handleTest ./matrix/conduit.nix {};
|
matrix-conduit = handleTest ./matrix/conduit.nix {};
|
||||||
matrix-synapse = handleTest ./matrix/synapse.nix {};
|
matrix-synapse = handleTest ./matrix/synapse.nix {};
|
||||||
|
matrix-synapse-workers = handleTest ./matrix/synapse-workers.nix {};
|
||||||
mattermost = handleTest ./mattermost.nix {};
|
mattermost = handleTest ./mattermost.nix {};
|
||||||
mediamtx = handleTest ./mediamtx.nix {};
|
mediamtx = handleTest ./mediamtx.nix {};
|
||||||
mediatomb = handleTest ./mediatomb.nix {};
|
mediatomb = handleTest ./mediatomb.nix {};
|
||||||
|
55
nixos/tests/matrix/synapse-workers.nix
Normal file
55
nixos/tests/matrix/synapse-workers.nix
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
import ../make-test-python.nix ({ pkgs, ... }: {
|
||||||
|
name = "matrix-synapse-workers";
|
||||||
|
meta = with pkgs.lib; {
|
||||||
|
maintainers = teams.matrix.members;
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes = {
|
||||||
|
homeserver =
|
||||||
|
{ pkgs
|
||||||
|
, nodes
|
||||||
|
, ...
|
||||||
|
}: {
|
||||||
|
services.postgresql = {
|
||||||
|
enable = true;
|
||||||
|
initialScript = pkgs.writeText "synapse-init.sql" ''
|
||||||
|
CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'synapse';
|
||||||
|
CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse"
|
||||||
|
TEMPLATE template0
|
||||||
|
LC_COLLATE = "C"
|
||||||
|
LC_CTYPE = "C";
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
services.matrix-synapse = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
database = {
|
||||||
|
name = "psycopg2";
|
||||||
|
args.password = "synapse";
|
||||||
|
};
|
||||||
|
enable_registration = true;
|
||||||
|
enable_registration_without_verification = true;
|
||||||
|
|
||||||
|
federation_sender_instances = [ "federation_sender" ];
|
||||||
|
};
|
||||||
|
configureRedisLocally = true;
|
||||||
|
workers = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
"federation_sender" = {
|
||||||
|
worker_app = "synapse.app.generic_worker";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
start_all()
|
||||||
|
|
||||||
|
homeserver.wait_for_unit("matrix-synapse.service");
|
||||||
|
homeserver.wait_for_unit("matrix-synapse-worker-federation_sender.service");
|
||||||
|
'';
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user