-
Notifications
You must be signed in to change notification settings - Fork 21
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
Run blackbox tests within a container. #389
base: master
Are you sure you want to change the base?
Conversation
575eb80
to
9fa36ca
Compare
I'm getting "bitcoind now synced" errors when running server tests:
Does bitcoind need to be fully synced before running the server tests? |
2b729ea
to
9b73b2f
Compare
Thank you for getting together a repro. Before i dive deeper into it, did you try running essentially what the CI does? For instance here is a simple Dockerfile from the CI config that you can run with:
And that will setup Postgre and run the tests. FROM rust:latest
# Install the deps
RUN apt update && apt install -y postgresql python3 python3-venv
# Clone a fresh version of the master branch, for repro
RUN git clone https://github.com/revault/revaultd /srv/revaultd
# Compile the daemon and the servers
RUN cd /srv/revaultd && cargo build --release && \
git submodule update --init && \
cd tests/servers && \
cd miradord && cargo build && \
cd ../coordinatord && cargo build && \
cd ../cosignerd && cargo build
ENV REVAULTD_PATH=/srv/revaultd/target/release/revaultd
ENV MIRADORD_PATH=/srv/revaultd/tests/servers/miradord/target/debug/miradord
ENV COORDINATORD_PATH=/srv/revaultd/tests/servers/coordinatord/target/debug/coordinatord
ENV COSIGNERD_PATH=/srv/revaultd/tests/servers/cosignerd/target/debug/cosignerd
# Download the bitcoind binary
ENV BITCOIND_VERSION=22.0
ENV BITCOIND_DIR_NAME="bitcoin-$BITCOIND_VERSION"
ENV ARCHIVE_NAME="$BITCOIND_DIR_NAME.tar.gz"
RUN curl https://bitcoincore.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz -o $ARCHIVE_NAME && \
tar -xzf $ARCHIVE_NAME && \
mv $BITCOIND_DIR_NAME /srv
ENV BITCOIND_PATH=/srv/$BITCOIND_DIR_NAME/bin/bitcoind
# Setup the postgres instance for the servers, then run the functional tests.
CMD pg_ctlcluster 13 main start && \
su -c "psql -c \"CREATE ROLE test CREATEDB LOGIN PASSWORD 'test'\"" - postgres && \
cd /srv/revaultd && \
python3 -m venv venv && \
. venv/bin/activate && \
pip install -r tests/requirements.txt && \
POSTGRES_USER=test POSTGRES_PASS=test pytest -vvv -n 8
What version of bitcoind are you running? We need at least
We use bitcoind in regtest mode (no chain but the genesis block), no network (whether it'd be mainnet or testnet) need to be synced. |
I hadn't seen that Dockerfile before now. Where is it hosted? I thought this was the CI config.
The Containerfile I wrote uses 22.0, see here.
I'll take a look. |
No. I wrote and tested it just now so you can run a working config in no time. |
3766f99 Skip tests if postgres has not been setup. (rndhouse) Pull request description: This is a cherry-pick of the first commit of #389. This bug was also reported by @Zshan0 on IRC. Thanks @rndhouse for the fix! ACKs for top commit: darosior: ACK 3766f99 Tree-SHA512: a8372e37234b0556316c134593e12b041c1076f39e9ebbb74a58f5eea702368c48565d2a91bb39349d6c45d918598acde8b01dfd3cec9c35b62b391337b833dd
I'm having trouble running the blackbox tests. So I figured I'd run them in a container so that I can share my environment.
Contrary to README, minimum supported Rust version is probably not 1.43, see: #390 . Going with version 1.58 for now.