From 2c8c8c7323303ad32556635a1ab9e064c53c5668 Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Mon, 20 Jan 2020 10:48:11 +0100 Subject: [PATCH] Updates circle-ci with basic e2e infraestructure --- .circleci/config.yml | 22 ++++++++++++++++------ test/pisa/e2e/bitcoin.conf | 27 +++++++++++++++++++++++++++ test/pisa/e2e/conf.py | 19 +++++++++++++++++++ 3 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 test/pisa/e2e/bitcoin.conf create mode 100644 test/pisa/e2e/conf.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 41711ad..da9ac56 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,7 +32,8 @@ jobs: command: | python3 -m venv venv . venv/bin/activate - pip install -r pisa/requirements.txt + sudo pip install --upgrade pip + pip install -r pisa/requirements.txt pip install -r pisa/requirements-dev.txt pip install -r apps/cli/requirements-dev.txt @@ -41,11 +42,20 @@ jobs: - ./venv key: v1-dependencies-{{ checksum "pisa/requirements.txt" }}-{{ checksum "pisa/requirements-dev.txt" }}-{{ checksum "apps/cli/requirements-dev.txt" }} - # run tests! - # this example uses Django's built-in test-runner - # other common Python testing frameworks include pytest and nose - # https://pytest.org - # https://nose.readthedocs.io + # Build docker env for E2E testing + - run: + name: build bitcoin_sandbox + command: | + git clone --single-branch --branch ln https://github.com/sr-gi/bitcoin_sandbox.git + . venv/bin/activate + pip install -r bitcoin_sandbox/requirements.txt + cp test/pisa/e2e/bitcoin.conf bitcoin_sandbox/ + cp test/pisa/e2e/conf.py bitcoin_sandbox/bitcoin_sandbox/ + mv bitcoin_sandbox/bitcoin_sandbox venv/lib/python3.6/site-packages + python venv/lib/python3.6/site-packages/bitcoin_sandbox/run_scenarios.py + + + # Run unit tests - run: name: create config command: cp pisa/sample_conf.py pisa/conf.py diff --git a/test/pisa/e2e/bitcoin.conf b/test/pisa/e2e/bitcoin.conf new file mode 100644 index 0000000..92c9105 --- /dev/null +++ b/test/pisa/e2e/bitcoin.conf @@ -0,0 +1,27 @@ +# [network] +dnsseed=0 + +# [debug] +regtest=1 +debug=1 +logips=1 + +# [rpc] +server=1 +rpcuser=user +rpcpassword=passwd +rpcallowip=0.0.0.0/0 +rpcservertimeout=300 + +# [zmq] +zmqpubhashblock=tcp://0.0.0.0:28332 +zmqpubrawblock=tcp://0.0.0.0:28332 +zmqpubrawtx=tcp://0.0.0.0:28333 + +# [blockchain] +txindex=1 + +# There are some parameters that only work in the specific on regtest if specified in the regtest section +[regtest] +rpcbind=0.0.0.0 +rpcport=18443 \ No newline at end of file diff --git a/test/pisa/e2e/conf.py b/test/pisa/e2e/conf.py new file mode 100644 index 0000000..cbdd3d0 --- /dev/null +++ b/test/pisa/e2e/conf.py @@ -0,0 +1,19 @@ +# Copy this file with your own configuration and save it as conf.py + +# Docker +DOCK_NETWORK_NAME = "pisa_net" +DOCK_NETWORK_SUBNET = "172.16.0.0/16" +DOCK_NETWORK_GW = "172.16.0.1" +DOCK_CONTAINER_NAME_PREFIX = "btc_n" +DOCK_IMAGE_NAME = "sandbox_btc" +DOCKER_INI_PORT_MAPPING = 22000 +DOCKER_RPC_PORT_MAPPING = 18444 +DOCKER_ZMQ_BLOCK_PORT_MAPPING = 28334 + +# Log +LOG_FILE = "bitcoin_sandbox.log" + +# Graphs +BITCOIN_GRAPH_FILE = "./graphs/basic3.graphml" +LN_GRAPH_FILE = "./graphs/basic3_ln.graphml" +DEFAULT_LN_GRAPH_WEIGHT = 10000