# Pastebin ZRjtV5ya #!/bin/bash PYENV_HOME=$WORKSPACE/.pyenv/ # Create virtualenv and install necessary packages virtualenv --no-site-packages $PYENV_HOME . $PYENV_HOME/bin/activate pip install -U pip pip install -U pytest pip install -r requirements.txt # Creating config file cp $WORKSPACE/config.py.sample $WORKSPACE/config.py sed -i 's/TEST_SQLALCHEMY_DATABASE_URI = "postgresql://lb_test@/lb_test"/TEST_SQLALCHEMY_DATABASE_URI = "postgresql://lb_test:lb_test@localhost:5432/lb_test"/g' $WORKSPACE/config.py sed -i 's/SQLALCHEMY_DATABASE_URI = "postgresql://listenbrainz@/listenbrainz"/SQLALCHEMY_DATABASE_URI = "postgresql://lb_test:lb_test@localhost:5432/lb_test"/g' $WORKSPACE/config.py sed -i 's/MESSYBRAINZ_SQLALCHEMY_DATABASE_URI = "postgresql://messybrainz@/messybrainz"/MESSYBRAINZ_SQLALCHEMY_DATABASE_URI = "postgresql://messybrainz:messybrainz@localhost:5432/messybrainz"/g' $WORKSPACE/config.py sed -i 's/KAFKA_CONNECT = "localhost:9092"/#KAFKA_CONNECT = "localhost:9092"/g' $WORKSPACE/config.py # MESSYBRAINZ git clone https://github.com/metabrainz/messybrainz-server.git $WORKSPACE/messybrainz cd $WORKSPACE/messybrainz pip install -r requirements.txt python setup.py install rm -r $WORKSPACE/messybrainz cd $WORKSPACE py.test --junitxml=test_report.xml