Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 11 additions & 3 deletions docker/synapse_sytest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fi
# Build the virtualenv, install extra deps that we will need for the tests
$PYTHON -m virtualenv -p $PYTHON /venv/
/venv/bin/pip install -q --no-cache-dir -e /src/
/venv/bin/pip install -q --no-cache-dir lxml psycopg2
/venv/bin/pip install -q --no-cache-dir lxml psycopg2 coverage codecov

# 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
Expand All @@ -58,9 +58,9 @@ $PYTHON -m virtualenv -p $PYTHON /venv/
TEST_STATUS=0
if [ -n "$WORKERS" ]
then
./run-tests.pl -I Synapse::ViaHaproxy --python=/venv/bin/python --dendron-binary=/test/docker/pydron.py -O tap --all > results.tap || TEST_STATUS=$?
./run-tests.pl -I Synapse::ViaHaproxy --python=/venv/bin/python --synapse-directory=/src --coverage --dendron-binary=/test/docker/pydron.py -O tap --all > results.tap || TEST_STATUS=$?
else
./run-tests.pl -I Synapse --python=/venv/bin/python -O tap --all > results.tap || TEST_STATUS=$?
./run-tests.pl -I Synapse --python=/venv/bin/python --synapse-directory=/src --coverage -O tap --all > results.tap || TEST_STATUS=$?
fi

# Copy out the logs
Expand All @@ -72,4 +72,12 @@ rsync --ignore-missing-args -av server-0 server-1 /logs --include "*/" --include
mkdir -p /logs/sytest
perl /tap-to-junit-xml.pl --puretap --input=/logs/results.tap --output=/logs/sytest/results.xml "SyTest"

# Upload coverage to codecov, if running on CircleCI
if [ -n "$CIRCLECI" ]
then
/venv/bin/coverage combine || IGN=$?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/venv/bin/coverage combine || IGN=$?
/venv/bin/coverage combine || true

Although, why do we want to ignore the error here and not at line 80?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codecov doesn't return non-0 if it fails searching, only if it fails uploading

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too manynegatives I think ... this line is a search rather than an upload? So according to what you wrote, it always returns 0 here, so the || true is redundant?

/venv/bin/coverage xml || IGN=$?
/venv/bin/codecov -X gcov -f coverage.xml
fi

exit $TEST_STATUS
2 changes: 1 addition & 1 deletion lib/SyTest/Homeserver/Synapse.pm
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ sub start
if( $self->{coverage} ) {
# Ensures that even --generate-config has coverage reports. This is intentional
push @synapse_command,
"-m", "coverage", "run", "-p", "--source=$self->{synapse_dir}/synapse";
"-m", "coverage", "run", "--rcfile=$self->{synapse_dir}/.coveragerc";
}

push @synapse_command,
Expand Down