Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for running worker mode against redis #857

Merged
merged 1 commit into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/SyTest/Homeserver/Synapse.pm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ sub _init

$self->{paths} = {};
$self->{dendron} = '';
$self->{redis_host} = '';

$self->SUPER::_init( $args );

Expand Down Expand Up @@ -282,6 +283,11 @@ sub start
limit_usage_by_mau => "true",
max_mau_value => 50000000,

redis => {
enabled => $self->{redis_host} ne '',
host => $self->{redis_host},
},

map {
defined $self->{$_} ? ( $_ => $self->{$_} ) : ()
} qw(
Expand Down Expand Up @@ -653,6 +659,7 @@ sub _init
$self->SUPER::_init( @_ );

$self->{dendron} = delete $args->{dendron_binary};
$self->{redis_host} = delete $args->{redis_host};

if( my $level = delete $args->{torture_replication} ) {
# torture the replication protocol a bit, to replicate bugs.
Expand Down
6 changes: 5 additions & 1 deletion lib/SyTest/HomeserverFactory/Synapse.pm
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,17 @@ sub _init
$self->{impl} = "SyTest::Homeserver::Synapse::ViaDendron";
$self->{args}{dendron_binary} = "";
$self->{args}{torture_replication} = 0;
$self->{args}{redis_host} = "";
}

sub get_options
{
my $self = shift;

return (
'dendron-binary=s' => \$self->{args}{dendron_binary},
'dendron-binary=s' => \$self->{args}{dendron_binary},
'torture-replication:50' => \$self->{args}{torture_replication},
'redis-host=s' => \$self->{args}{redis_host},
$self->SUPER::get_options(),
);
}
Expand All @@ -125,6 +127,8 @@ sub print_usage
--dendron-binary PATH - path to the 'dendron' binary

--torture-replication[=LEVEL] - enable torturing of the replication protocol

--redis-host HOST - if set then use redis for replication
EOF
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/synapse_sytest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ if [ -n "$OFFLINE" ]; then
else
# We've already created the virtualenv, but lets double check we have all
# deps.
/venv/bin/pip install -q --upgrade --no-cache-dir /src
/venv/bin/pip install -q --upgrade --no-cache-dir /src[redis]
clokep marked this conversation as resolved.
Show resolved Hide resolved
/venv/bin/pip install -q --upgrade --no-cache-dir \
lxml psycopg2 coverage codecov tap.py coverage_enable_subprocess

Expand Down