From 635bf324f808783332e722d00d68801f344ebbd4 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 13 Mar 2020 21:09:57 +0000 Subject: [PATCH] Pin pytest to 5.3.5, and bitcoind download for travis As of 13 March the latest pytest breaks the twisted tests. As a result the version is pinned until that can be fixed. Additionally, at the same time, the bitcoin ppa has been removed and so cannot be used in our travis testing setup. Hence we install bitcoin directly (for tests only, of course) from bitcoin.org, copying bitcoind and bitcoin-cli to `/usr/local/lib`. --- .travis.yml | 6 ++---- install_bitcoind.sh | 21 +++++++++++++++++++++ requirements/testing.txt | 2 +- 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100755 install_bitcoind.sh diff --git a/.travis.yml b/.travis.yml index 7af0321..f7b9368 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,11 +14,7 @@ matrix: env: PIP_DOWNLOAD_CACHE=$HOME/.cache/pip addons: apt: - sources: - - sourceline: 'ppa:bitcoin/bitcoin' - key_url: 'http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0xD46F45428842CE5E' packages: - - bitcoind - python3-dev - python3-pip - python-virtualenv @@ -46,6 +42,7 @@ before_install: - do_on osx pip install virtualenv cache: directories: + - $HOME/bitcoin/bitcoin-0.19.1/bin - $HOME/downloads - $HOME/.cache/pip - $HOME/Library/Caches/pip @@ -56,6 +53,7 @@ install: - mkdir -p "$HOME/downloads" - mkdir -p "$TRAVIS_BUILD_DIR/deps/cache/" - find "$HOME/downloads" -type f -exec cp -v {} "$TRAVIS_BUILD_DIR/deps/cache/" \; + - on_host do_on linux ./install_bitcoind.sh - on_host do_on linux ./install.sh --develop --with-qt - on_host do_on osx virtualenv --python=python3 jmvenv - on_host find "$TRAVIS_BUILD_DIR/deps/cache/" -type f -exec cp -v {} "$HOME/downloads/" \; diff --git a/install_bitcoind.sh b/install_bitcoind.sh new file mode 100755 index 0000000..41f6b5a --- /dev/null +++ b/install_bitcoind.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -ev + +export BITCOIND_VERSION=0.19.1 + +if sudo cp ~/bitcoin/bitcoin-$BITCOIND_VERSION/bin/bitcoind /usr/local/bin/bitcoind +then + echo "found cached bitcoind" + sudo cp ~/bitcoin/bitcoin-$BITCOIND_VERSION/bin/bitcoin-cli /usr/local/bin/bitcoin-cli +else + mkdir -p ~/bitcoin && \ + pushd ~/bitcoin && \ + wget https://bitcoin.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz && \ + tar xvfz bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz && \ + sudo cp ./bitcoin-$BITCOIND_VERSION/bin/bitcoind /usr/local/bin/bitcoind && \ + sudo cp ./bitcoin-$BITCOIND_VERSION/bin/bitcoin-cli /usr/local/bin/bitcoin-cli && \ + popd +fi + + diff --git a/requirements/testing.txt b/requirements/testing.txt index bdcada4..5d65637 100644 --- a/requirements/testing.txt +++ b/requirements/testing.txt @@ -3,7 +3,7 @@ # numpy pexpect coverage==4.0.3 -pytest +pytest==5.3.5 pytest-cov>=2.4.0,<2.6 python-coveralls mock