Skip to content

Commit

Permalink
Create pipeline parameters for circleci config for ease of updating.
Browse files Browse the repository at this point in the history
- Create pipeline parameters for the ``go-ethereum`` version and the ``py-geth`` version for CI builds to more easily manage updates and generate less noise when updating the test fixtures.
- Update contributing docs to reflect all changes required when updating the integration test fixtures.
  • Loading branch information
fselmo committed Mar 28, 2023
1 parent 1828913 commit 7592e98
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 44 deletions.
56 changes: 13 additions & 43 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
version: 2.1

# heavily inspired by https://raw.githubusercontent.com/pinax/pinax-wiki/6bd2a99ab6f702e300d708532a6d1d9aa638b9f8/.circleci/config.yml
parameters:
# Note: update these defaults when updating the geth integration test fixture
geth_version:
default: "v1.11.5"
type: string
pygeth_version:
default: "3.12.0"
type: string

common: &common
working_directory: ~/repo
Expand Down Expand Up @@ -74,10 +81,10 @@ geth_steps: &geth_steps
name: build geth if missing
command: |
mkdir -p $HOME/.ethash
pip install --user py-geth>=3.12.0
pip install --user py-geth>=<< pipeline.parameters.pygeth_version >>
export GOROOT=/usr/local/go
echo $GETH_VERSION
export GETH_BINARY="$HOME/.py-geth/geth-$GETH_VERSION/bin/geth"
echo << pipeline.parameters.geth_version >>
export GETH_BINARY="$HOME/.py-geth/geth-<< pipeline.parameters.geth_version >>/bin/geth"
if [ ! -e "$GETH_BINARY" ]; then
curl -O https://storage.googleapis.com/golang/go1.20.1.linux-amd64.tar.gz
tar xvf go1.20.1.linux-amd64.tar.gz
Expand All @@ -86,9 +93,9 @@ geth_steps: &geth_steps
sudo ln -s /usr/local/go/bin/go /usr/local/bin/go
sudo apt-get update;
sudo apt-get install -y build-essential;
python -m geth.install $GETH_VERSION;
python -m geth.install << pipeline.parameters.geth_version >>;
fi
sudo ln -s /home/circleci/.py-geth/geth-$GETH_VERSION/bin/geth /usr/local/bin/geth
sudo ln -s /home/circleci/.py-geth/geth-<< pipeline.parameters.geth_version >>/bin/geth /usr/local/bin/geth
geth version
geth makedag 0 $HOME/.ethash
- run:
Expand Down Expand Up @@ -119,7 +126,6 @@ geth_custom_steps: &geth_custom_steps
command: |
mkdir -p $HOME/.ethash
export GOROOT=/usr/local/go
echo $GETH_VERSION
export GETH_BINARY="./custom_geth"
echo 'export GETH_BINARY="./custom_geth"' >> $BASH_ENV
curl -O https://storage.googleapis.com/golang/go1.20.1.linux-amd64.tar.gz
Expand Down Expand Up @@ -247,55 +253,48 @@ jobs:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-goethereum-ipc
GETH_VERSION: v1.11.5

py37-integration-goethereum-ipc_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-goethereum-ipc_flaky
GETH_VERSION: v1.11.5

py37-integration-goethereum-http:
<<: *geth_steps
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-goethereum-http
GETH_VERSION: v1.11.5

py37-integration-goethereum-http_async:
<<: *geth_steps
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-goethereum-http_async
GETH_VERSION: v1.11.5

py37-integration-goethereum-http_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-goethereum-http_flaky
GETH_VERSION: v1.11.5

py37-integration-goethereum-ws:
<<: *geth_steps
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-goethereum-ws
GETH_VERSION: v1.11.5

py37-integration-goethereum-ws_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-goethereum-ws_flaky
GETH_VERSION: v1.11.5

py37-integration-ethtester-pyevm:
<<: *common
Expand Down Expand Up @@ -351,55 +350,48 @@ jobs:
- image: cimg/python:3.8
environment:
TOXENV: py38-integration-goethereum-ipc
GETH_VERSION: v1.11.5

py38-integration-goethereum-ipc_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.8
environment:
TOXENV: py38-integration-goethereum-ipc_flaky
GETH_VERSION: v1.11.5

py38-integration-goethereum-http:
<<: *geth_steps
docker:
- image: cimg/python:3.8
environment:
TOXENV: py38-integration-goethereum-http
GETH_VERSION: v1.11.5

py38-integration-goethereum-http_async:
<<: *geth_steps
docker:
- image: cimg/python:3.8
environment:
TOXENV: py38-integration-goethereum-http_async
GETH_VERSION: v1.11.5

py38-integration-goethereum-http_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.8
environment:
TOXENV: py38-integration-goethereum-http_flaky
GETH_VERSION: v1.11.5

py38-integration-goethereum-ws:
<<: *geth_steps
docker:
- image: cimg/python:3.8
environment:
TOXENV: py38-integration-goethereum-ws
GETH_VERSION: v1.11.5

py38-integration-goethereum-ws_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.8
environment:
TOXENV: py38-integration-goethereum-ws_flaky
GETH_VERSION: v1.11.5

py38-integration-ethtester-pyevm:
<<: *common
Expand Down Expand Up @@ -455,55 +447,48 @@ jobs:
- image: cimg/python:3.9
environment:
TOXENV: py39-integration-goethereum-ipc
GETH_VERSION: v1.11.5

py39-integration-goethereum-ipc_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.9
environment:
TOXENV: py39-integration-goethereum-ipc_flaky
GETH_VERSION: v1.11.5

py39-integration-goethereum-http:
<<: *geth_steps
docker:
- image: cimg/python:3.9
environment:
TOXENV: py39-integration-goethereum-http
GETH_VERSION: v1.11.5

py39-integration-goethereum-http_async:
<<: *geth_steps
docker:
- image: cimg/python:3.9
environment:
TOXENV: py39-integration-goethereum-http_async
GETH_VERSION: v1.11.5

py39-integration-goethereum-http_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.9
environment:
TOXENV: py39-integration-goethereum-http_flaky
GETH_VERSION: v1.11.5

py39-integration-goethereum-ws:
<<: *geth_steps
docker:
- image: cimg/python:3.9
environment:
TOXENV: py39-integration-goethereum-ws
GETH_VERSION: v1.11.5

py39-integration-goethereum-ws_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.9
environment:
TOXENV: py39-integration-goethereum-ws_flaky
GETH_VERSION: v1.11.5

py39-integration-ethtester-pyevm:
<<: *common
Expand Down Expand Up @@ -559,55 +544,48 @@ jobs:
- image: cimg/python:3.10
environment:
TOXENV: py310-integration-goethereum-ipc
GETH_VERSION: v1.11.5

py310-integration-goethereum-ipc_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.10
environment:
TOXENV: py310-integration-goethereum-ipc_flaky
GETH_VERSION: v1.11.5

py310-integration-goethereum-http:
<<: *geth_steps
docker:
- image: cimg/python:3.10
environment:
TOXENV: py310-integration-goethereum-http
GETH_VERSION: v1.11.5

py310-integration-goethereum-http_async:
<<: *geth_steps
docker:
- image: cimg/python:3.10
environment:
TOXENV: py310-integration-goethereum-http_async
GETH_VERSION: v1.11.5

py310-integration-goethereum-http_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.10
environment:
TOXENV: py310-integration-goethereum-http_flaky
GETH_VERSION: v1.11.5

py310-integration-goethereum-ws:
<<: *geth_steps
docker:
- image: cimg/python:3.10
environment:
TOXENV: py310-integration-goethereum-ws
GETH_VERSION: v1.11.5

py310-integration-goethereum-ws_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.10
environment:
TOXENV: py310-integration-goethereum-ws_flaky
GETH_VERSION: v1.11.5

py310-integration-ethtester-pyevm:
<<: *common
Expand Down Expand Up @@ -668,55 +646,48 @@ jobs:
- image: cimg/python:3.11
environment:
TOXENV: py311-integration-goethereum-ipc
GETH_VERSION: v1.11.5

py311-integration-goethereum-ipc_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.11
environment:
TOXENV: py311-integration-goethereum-ipc_flaky
GETH_VERSION: v1.11.5

py311-integration-goethereum-http:
<<: *geth_steps
docker:
- image: cimg/python:3.11
environment:
TOXENV: py311-integration-goethereum-http
GETH_VERSION: v1.11.5

py311-integration-goethereum-http_async:
<<: *geth_steps
docker:
- image: cimg/python:3.11
environment:
TOXENV: py311-integration-goethereum-http_async
GETH_VERSION: v1.11.5

py311-integration-goethereum-http_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.11
environment:
TOXENV: py311-integration-goethereum-http_flaky
GETH_VERSION: v1.11.5

py311-integration-goethereum-ws:
<<: *geth_steps
docker:
- image: cimg/python:3.11
environment:
TOXENV: py311-integration-goethereum-ws
GETH_VERSION: v1.11.5

py311-integration-goethereum-ws_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.11
environment:
TOXENV: py311-integration-goethereum-ws_flaky
GETH_VERSION: v1.11.5

py311-integration-ethtester-pyevm:
<<: *common
Expand All @@ -739,7 +710,6 @@ jobs:
- image: cimg/python:3.10
environment:
TOXENV: benchmark
GETH_VERSION: v1.11.5

workflows:
version: 2.1
Expand Down
8 changes: 7 additions & 1 deletion docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,17 @@ Geth Fixtures
$ GETH_BINARY=~/.py-geth/geth-v1.11.5/bin/geth python ./tests/integration/generate_fixtures/go_ethereum.py ./tests/integration/geth-1.11.5-fixture
3. The output of this script is your fixture, a zip file, which is now stored in ``/tests/integration/``.
Update the ``/tests/integration/go_ethereum/conftest.py`` file to point to this new fixture. Delete the old fixture.
Update the ``/tests/integration/go_ethereum/conftest.py`` and
``/web3/tools/benchmark/node.py`` files to point to this new fixture. Delete the old
fixture.

4. Run the tests. To ensure that the tests run with the correct Geth version locally,
you may again include the ``GETH_BINARY`` environment variable.

5. Update the ``geth_version`` and ``pygeth_version`` parameter defaults in
``/.circleci/config.yml`` to match the ``go-ethereum`` version used to generate the
test fixture and the ``py-geth`` version that supports installing it.


CI Testing With a Nightly Geth Build
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit 7592e98

Please sign in to comment.