-
Notifications
You must be signed in to change notification settings - Fork 59
Fix Synapse container failing in offline mode due to missing test deps #1219
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
Conversation
Signed-off-by: Sean Quah <seanq@element.io>
# Pre-install test dependencies installed by `scripts/synapse_sytest.sh`. | ||
RUN /venv/bin/pip install -q --no-cache-dir \ | ||
lxml psycopg2 coverage codecov tap.py coverage_enable_subprocess | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The relevant part of scripts/synapse_sytest.sh
is
sytest/scripts/synapse_sytest.sh
Lines 132 to 151 in 2052139
if [ -n "$OFFLINE" ]; then | |
# if we're in offline mode, just put synapse into the virtualenv, and | |
# hope that the deps are up-to-date. | |
# | |
# --no-use-pep517 works around what appears to be a pip issue | |
# (https://github.com/pypa/pip/issues/5402 possibly) where pip wants | |
# to reinstall any requirements for the build system, even if they are | |
# already installed. | |
/venv/bin/pip install --no-index --no-use-pep517 "$SYNAPSE_SOURCE" | |
else | |
# We've already created the virtualenv, but lets double check we have all | |
# deps. | |
/venv/bin/pip install -q --upgrade --no-cache-dir "$SYNAPSE_SOURCE"[redis] | |
/venv/bin/pip install -q --upgrade --no-cache-dir \ | |
lxml psycopg2 coverage codecov tap.py coverage_enable_subprocess | |
# Make sure all Perl deps are installed -- this is done in the docker build | |
# so will only install packages added since the last Docker build | |
./install-deps.pl | |
fi |
SyTest starts Synapse using coverage
:
sytest/lib/SyTest/Homeserver/Synapse.pm
Lines 414 to 422 in 2052139
if( $self->{coverage} ) { | |
# Ensures that even --generate-config has coverage reports. This is intentional | |
push @synapse_command, | |
"-m", "coverage", "run", "--source=$self->{synapse_dir}/synapse", "--rcfile=$self->{synapse_dir}/.coveragerc"; | |
} | |
push @synapse_command, | |
"-m", $app, | |
"--config-path" => $self->{paths}{config}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. To check I understand: this should just mean that we cache these packages in the docker image, rather than having to pip install them every time?
That sounds right. We install these packages in the Docker image. The later pip install in * or at least |
Turns out I missed that we already do the install on line 17: which I broke during the poetry work. |
Signed-off-by: Sean Quah seanq@element.io